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,
|
tomes = 0,
|
||||||
bonus = 0
|
bonus = 0
|
||||||
},
|
},
|
||||||
difficulties = {
|
difficulty_levels = {
|
||||||
"easy",
|
"easy",
|
||||||
"normal",
|
"normal",
|
||||||
"hard",
|
"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.
|
This determines how many additional dice the players will get for completing maps with your mutator enabled.
|
||||||
|
|
||||||
```
|
```
|
||||||
difficulties = {
|
difficulty_levels = {
|
||||||
"easy",
|
"easy",
|
||||||
"normal",
|
"normal",
|
||||||
"hard",
|
"hard",
|
||||||
|
|
|
@ -7,7 +7,7 @@ return {
|
||||||
title = "",
|
title = "",
|
||||||
short_title = "",
|
short_title = "",
|
||||||
description = "No description provided",
|
description = "No description provided",
|
||||||
difficulties = {
|
difficulty_levels = {
|
||||||
"easy",
|
"easy",
|
||||||
"normal",
|
"normal",
|
||||||
"hard",
|
"hard",
|
||||||
|
|
|
@ -285,7 +285,7 @@ local mutators_view = {
|
||||||
|
|
||||||
if not supports_difficulty then
|
if not supports_difficulty then
|
||||||
text = text .. "\nSupported difficulty levels:"
|
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)
|
text = text .. (i == 1 and " " or ", ") .. manager:localize(difficulty)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -284,9 +284,9 @@ local function can_be_enabled(self, ignore_map)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function supports_current_difficulty(self, ignore_map)
|
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 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 = not ignore_map and mutators_view.map_view
|
||||||
local map_view_active = map_view and map_view.active
|
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_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_layout = difficulty_data and difficulty_data[map_view.selected_difficulty_stepper_index]
|
||||||
local difficulty_key = difficulty_layout and difficulty_layout.key
|
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
|
end
|
||||||
|
|
||||||
return (map_view_active and right_unapplied_difficulty) or (not map_view_active and right_difficulty)
|
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({
|
mutator2:register_as_mutator({
|
||||||
compatible_with_all = true,
|
compatible_with_all = true,
|
||||||
difficulties = {
|
difficulty_levels = {
|
||||||
"hardest"
|
"hardest"
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Reference in a new issue