mutators: difficulties -> difficulty_levels
This commit is contained in:
parent
271ddc1660
commit
bc4377a4c3
4 changed files with 8 additions and 8 deletions
|
@ -29,7 +29,7 @@ The config object is optional but obviously you'd want to provide at least a rea
|
|||
tomes = 0,
|
||||
bonus = 0
|
||||
},
|
||||
difficulties = {
|
||||
difficulty_levels = {
|
||||
"easy",
|
||||
"normal",
|
||||
"hard",
|
||||
|
@ -62,7 +62,7 @@ The description will show up in the tooltip of your mutator on the map screen.
|
|||
This determines how many additional dice the players will get for completing maps with your mutator enabled.
|
||||
|
||||
```
|
||||
difficulties = {
|
||||
difficulty_levels = {
|
||||
"easy",
|
||||
"normal",
|
||||
"hard",
|
||||
|
|
|
@ -7,7 +7,7 @@ return {
|
|||
title = "",
|
||||
short_title = "",
|
||||
description = "No description provided",
|
||||
difficulties = {
|
||||
difficulty_levels = {
|
||||
"easy",
|
||||
"normal",
|
||||
"hard",
|
||||
|
|
|
@ -285,7 +285,7 @@ local mutators_view = {
|
|||
|
||||
if not supports_difficulty then
|
||||
text = text .. "\nSupported difficulty levels:"
|
||||
for i, difficulty in ipairs(config.difficulties) do
|
||||
for i, difficulty in ipairs(config.difficulty_levels) do
|
||||
text = text .. (i == 1 and " " or ", ") .. manager:localize(difficulty)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -284,9 +284,9 @@ local function can_be_enabled(self, ignore_map)
|
|||
end
|
||||
|
||||
local function supports_current_difficulty(self, ignore_map)
|
||||
local mutator_difficulties = self:get_config().difficulties
|
||||
local mutator_difficulty_levels = self:get_config().difficulty_levels
|
||||
local actual_difficulty = Managers.state and Managers.state.difficulty:get_difficulty()
|
||||
local right_difficulty = not actual_difficulty or table.has_item(mutator_difficulties, actual_difficulty)
|
||||
local right_difficulty = not actual_difficulty or table.has_item(mutator_difficulty_levels, actual_difficulty)
|
||||
|
||||
local map_view = not ignore_map and mutators_view.map_view
|
||||
local map_view_active = map_view and map_view.active
|
||||
|
@ -297,7 +297,7 @@ local function supports_current_difficulty(self, ignore_map)
|
|||
local difficulty_data = map_view.selected_level_index and map_view:get_difficulty_data(map_view.selected_level_index)
|
||||
local difficulty_layout = difficulty_data and difficulty_data[map_view.selected_difficulty_stepper_index]
|
||||
local difficulty_key = difficulty_layout and difficulty_layout.key
|
||||
right_unapplied_difficulty = difficulty_key and table.has_item(mutator_difficulties, difficulty_key)
|
||||
right_unapplied_difficulty = difficulty_key and table.has_item(mutator_difficulty_levels, difficulty_key)
|
||||
end
|
||||
|
||||
return (map_view_active and right_unapplied_difficulty) or (not map_view_active and right_difficulty)
|
||||
|
@ -437,7 +437,7 @@ mutator3.on_disabled = function() end
|
|||
|
||||
mutator2:register_as_mutator({
|
||||
compatible_with_all = true,
|
||||
difficulties = {
|
||||
difficulty_levels = {
|
||||
"hardest"
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue