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
4242782d
Commit
4242782d
authored
11 years ago
by
Kahrl
Browse files
Options
Downloads
Patches
Plain Diff
World config dialog: Use engine determined path for game mods
parent
8548bb75
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
builtin/gamemgr.lua
+28
-15
28 additions, 15 deletions
builtin/gamemgr.lua
builtin/mainmenu.lua
+5
-7
5 additions, 7 deletions
builtin/mainmenu.lua
builtin/modmgr.lua
+4
-9
4 additions, 9 deletions
builtin/modmgr.lua
with
37 additions
and
31 deletions
builtin/gamemgr.lua
+
28
−
15
View file @
4242782d
...
...
@@ -155,22 +155,35 @@ function gamemgr.delete_mod(gamespec,modindex)
end
--------------------------------------------------------------------------------
function
gamemgr
.
get_game_mods
(
gamespec
)
function
gamemgr
.
find_by_gameid
(
gameid
)
for
i
=
1
,
#
gamemgr
.
games
,
1
do
if
gamemgr
.
games
[
i
].
id
==
gameid
then
return
gamemgr
.
games
[
i
],
i
end
end
return
nil
,
nil
end
local
retval
=
""
if
gamespec
.
gamemods_path
~=
nil
and
--------------------------------------------------------------------------------
function
gamemgr
.
get_game_mods
(
gamespec
,
retval
)
if
gamespec
~=
nil
and
gamespec
.
gamemods_path
~=
nil
and
gamespec
.
gamemods_path
~=
""
then
local
game_mods
=
{}
get_mods
(
gamespec
.
gamemods_path
,
game_mods
)
for
i
=
1
,
#
game_mods
,
1
do
if
retval
~=
""
then
retval
=
retval
..
","
end
retval
=
retval
..
game_mods
[
i
].
name
end
get_mods
(
gamespec
.
gamemods_path
,
retval
)
end
end
--------------------------------------------------------------------------------
function
gamemgr
.
get_game_modlist
(
gamespec
)
local
retval
=
""
local
game_mods
=
{}
gamemgr
.
get_game_mods
(
gamespec
,
game_mods
)
for
i
=
1
,
#
game_mods
,
1
do
if
retval
~=
""
then
retval
=
retval
..
","
end
retval
=
retval
..
game_mods
[
i
].
name
end
return
retval
end
...
...
@@ -220,7 +233,7 @@ function gamemgr.tab()
"label[6,1.4;"
..
fgettext
(
"Mods:"
)
..
"]"
..
"button[9.7,1.5;2,0.2;btn_game_mgr_edit_game;"
..
fgettext
(
"edit game"
)
..
"]"
..
"textlist[6,2;5.5,3.3;game_mgr_modlist;"
..
gamemgr
.
get_game_mod
s
(
current_game
)
..
";0]"
..
..
gamemgr
.
get_game_mod
list
(
current_game
)
..
";0]"
..
"button[1,4.75;3.2,0.5;btn_game_mgr_new_game;"
..
fgettext
(
"new game"
)
..
"]"
end
return
retval
...
...
@@ -243,7 +256,7 @@ function gamemgr.dialog_edit_game()
retval
=
retval
..
"textlist[0.5,0.5;4.5,4.3;mods_current;"
..
gamemgr
.
get_game_mod
s
(
current_game
)
..
";0]"
..
gamemgr
.
get_game_mod
list
(
current_game
)
..
";0]"
retval
=
retval
..
...
...
This diff is collapsed.
Click to expand it.
builtin/mainmenu.lua
+
5
−
7
View file @
4242782d
...
...
@@ -237,13 +237,11 @@ function menu.update_last_game()
if
current_world
==
nil
then
return
end
for
i
=
1
,
#
gamemgr
.
games
,
1
do
if
gamemgr
.
games
[
i
].
id
==
current_world
.
gameid
then
menu
.
last_game
=
i
engine
.
setting_set
(
"main_menu_last_game_idx"
,
menu
.
last_game
)
break
end
local
gamespec
,
i
=
gamemgr
.
find_by_gameid
(
current_world
.
gameid
)
if
i
~=
nil
then
menu
.
last_game
=
i
engine
.
setting_set
(
"main_menu_last_game_idx"
,
menu
.
last_game
)
end
end
...
...
This diff is collapsed.
Click to expand it.
builtin/modmgr.lua
+
4
−
9
View file @
4242782d
...
...
@@ -529,9 +529,8 @@ function modmgr.get_worldconfig(worldpath)
end
--read gamemods
local
gamemodpath
=
engine
.
get_gamepath
()
..
DIR_DELIM
..
worldconfig
.
id
..
DIR_DELIM
..
"mods"
get_mods
(
gamemodpath
,
worldconfig
.
game_mods
)
local
gamespec
=
gamemgr
.
find_by_gameid
(
worldconfig
.
id
)
gamemgr
.
get_game_mods
(
gamespec
,
worldconfig
.
game_mods
)
return
worldconfig
end
...
...
@@ -871,12 +870,8 @@ function modmgr.preparemodlist(data)
end
--read game mods
if
data
.
gameid
~=
nil
and
data
.
gameid
~=
""
then
local
gamemodpath
=
engine
.
get_gamepath
()
..
DIR_DELIM
..
data
.
gameid
..
DIR_DELIM
..
"mods"
get_mods
(
gamemodpath
,
game_mods
)
end
local
gamespec
=
gamemgr
.
find_by_gameid
(
data
.
gameid
)
gamemgr
.
get_game_mods
(
gamespec
,
game_mods
)
for
i
=
1
,
#
game_mods
,
1
do
game_mods
[
i
].
typ
=
"game_mod"
...
...
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