editor config and add description to mod menu
This commit is contained in:
parent
eca671c7f7
commit
8d8872c61c
3 changed files with 46 additions and 4 deletions
7
.editorconfig
Normal file
7
.editorconfig
Normal file
|
@ -0,0 +1,7 @@
|
|||
root = true
|
||||
|
||||
[*.lua]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 2
|
|
@ -35,6 +35,23 @@ local create_header_template = function (self, params)
|
|||
end
|
||||
_type_template_map["header"] = create_header_template
|
||||
|
||||
-- ##########################
|
||||
-- ###### Description #######
|
||||
-- ##########################
|
||||
|
||||
-- Create description template
|
||||
local create_description_template = function (self, params)
|
||||
|
||||
local template = {
|
||||
category = params.category,
|
||||
group_name = params.mod_name,
|
||||
display_name = params.description,
|
||||
widget_type = "description",
|
||||
after = params.after
|
||||
}
|
||||
return template
|
||||
end
|
||||
_type_template_map["description"] = create_description_template
|
||||
|
||||
-- ###########################
|
||||
-- ###### Percent Slider #####
|
||||
|
@ -358,6 +375,24 @@ dmf.create_mod_options_settings = function (self, options_templates)
|
|||
settings[#settings + 1] = template
|
||||
end
|
||||
|
||||
-- Create the mod description
|
||||
if mod_data[1].tooltip then
|
||||
local desc_widget_data = {
|
||||
mod_name = mod_data[1].mod_name,
|
||||
description = mod_data[1].tooltip,
|
||||
category = category.display_name,
|
||||
display_name = category.display_name,
|
||||
after = #settings,
|
||||
type = "description"
|
||||
}
|
||||
local desc_template = create_option_template(self, desc_widget_data, category.display_name, index_offset)
|
||||
|
||||
if desc_template then
|
||||
settings[#settings + 1] = desc_template
|
||||
index_offset = index_offset + 1
|
||||
end
|
||||
end
|
||||
|
||||
-- Create a top-level toggle option if the mod is togglable
|
||||
if mod_data[1].is_togglable then
|
||||
local toggle_widget_data = {
|
||||
|
|
Loading…
Add table
Reference in a new issue