Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
illuna-minetest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
illuna-minetest
Commits
4f684b58
Commit
4f684b58
authored
8 years ago
by
red-001
Committed by
Zeno-
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add a button for disabling all mods to world config. (#3900)
parent
b6569f1c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
builtin/mainmenu/dlg_config_world.lua
+28
-9
28 additions, 9 deletions
builtin/mainmenu/dlg_config_world.lua
with
28 additions
and
9 deletions
builtin/mainmenu/dlg_config_world.lua
+
28
−
9
View file @
4f684b58
...
...
@@ -16,6 +16,9 @@
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
--------------------------------------------------------------------------------
local
enabled_all
=
false
local
function
modname_valid
(
name
)
return
not
name
:
find
(
"[^a-z0-9_]"
)
end
...
...
@@ -80,11 +83,15 @@ local function get_formspec(data)
end
end
end
retval
=
retval
..
"button[8.75,0.125;2.5,0.5;btn_all_mods;"
..
fgettext
(
"Enable all"
)
..
"]"
..
"textlist[5.5,0.75;5.75,5.25;world_config_modlist;"
if
enabled_all
then
retval
=
retval
..
"button[8.75,0.125;2.5,0.5;btn_disable_all_mods;"
..
fgettext
(
"Disable all"
)
..
"]"
..
"textlist[5.5,0.75;5.75,5.25;world_config_modlist;"
else
retval
=
retval
..
"button[8.75,0.125;2.5,0.5;btn_enable_all_mods;"
..
fgettext
(
"Enable all"
)
..
"]"
..
"textlist[5.5,0.75;5.75,5.25;world_config_modlist;"
end
retval
=
retval
..
modmgr
.
render_modlist
(
data
.
list
)
retval
=
retval
..
";"
..
data
.
selected_mod
..
"]"
...
...
@@ -229,15 +236,27 @@ local function handle_buttons(this, fields)
return
true
end
if
fields
[
"
btn_all_mods
"
]
then
if
fields
.
btn_
enable_
all_mods
then
local
list
=
this
.
data
.
list
:
get_raw_list
()
for
i
=
1
,
#
list
,
1
do
if
list
[
i
].
typ
~=
"game_mod"
and
not
list
[
i
].
is_modpack
then
for
i
=
1
,
#
list
do
if
list
[
i
].
typ
~=
"game_mod"
and
not
list
[
i
].
is_modpack
then
list
[
i
].
enabled
=
true
end
end
enabled_all
=
true
return
true
end
if
fields
.
btn_disable_all_mods
then
local
list
=
this
.
data
.
list
:
get_raw_list
()
for
i
=
1
,
#
list
do
if
list
[
i
].
typ
~=
"game_mod"
and
not
list
[
i
].
is_modpack
then
list
[
i
].
enabled
=
false
end
end
enabled_all
=
false
return
true
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment