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
284fefb0
Commit
284fefb0
authored
10 years ago
by
Loïc Blot
Browse files
Options
Downloads
Patches
Plain Diff
Remove duplicate code since
8ca08a85
parent
b711d904
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/common.lua
+14
-17
14 additions, 17 deletions
builtin/mainmenu/common.lua
with
14 additions
and
17 deletions
builtin/mainmenu/common.lua
+
14
−
17
View file @
284fefb0
...
...
@@ -40,6 +40,18 @@ local function render_client_count(n)
end
end
local
function
configure_selected_world_params
(
idx
)
local
worldconfig
=
modmgr
.
get_worldconfig
(
menudata
.
worldlist
:
get_list
()[
idx
].
path
)
if
worldconfig
.
creative_mode
~=
nil
then
core
.
setting_set
(
"creative_mode"
,
worldconfig
.
creative_mode
)
end
if
worldconfig
.
enable_damage
~=
nil
then
core
.
setting_set
(
"enable_damage"
,
worldconfig
.
enable_damage
)
end
end
--------------------------------------------------------------------------------
function
image_column
(
tooltip
,
flagname
)
return
"image,"
..
...
...
@@ -197,15 +209,7 @@ function menu_handle_key_up_down(fields,textlist,settingname)
core
.
setting_set
(
settingname
,
menudata
.
worldlist
:
get_raw_index
(
newidx
))
local
worldconfig
=
modmgr
.
get_worldconfig
(
menudata
.
worldlist
:
get_list
()[
newidx
].
path
)
if
worldconfig
.
creative_mode
~=
nil
then
core
.
setting_set
(
"creative_mode"
,
worldconfig
.
creative_mode
)
end
if
worldconfig
.
enable_damage
~=
nil
then
core
.
setting_set
(
"enable_damage"
,
worldconfig
.
enable_damage
)
end
configure_selected_world_params
(
newidx
)
end
return
true
end
...
...
@@ -217,15 +221,8 @@ function menu_handle_key_up_down(fields,textlist,settingname)
local
newidx
=
oldidx
+
1
core
.
setting_set
(
settingname
,
menudata
.
worldlist
:
get_raw_index
(
newidx
))
local
worldconfig
=
modmgr
.
get_worldconfig
(
menudata
.
worldlist
:
get_list
()[
newidx
].
path
)
if
worldconfig
.
creative_mode
~=
nil
then
core
.
setting_set
(
"creative_mode"
,
worldconfig
.
creative_mode
)
end
if
worldconfig
.
enable_damage
~=
nil
then
core
.
setting_set
(
"enable_damage"
,
worldconfig
.
enable_damage
)
end
configure_selected_world_params
(
newidx
)
end
return
true
...
...
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