Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tales of MajEyal
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
tome
Tales of MajEyal
Commits
5eaddec4
Commit
5eaddec4
authored
10 years ago
by
DarkGod
Browse files
Options
Downloads
Patches
Plain Diff
Addons can now be bundled into packages containing multiple ones
parent
a530af63
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
game/engines/default/engine/Module.lua
+21
-6
21 additions, 6 deletions
game/engines/default/engine/Module.lua
game/engines/default/engine/utils.lua
+14
-0
14 additions, 0 deletions
game/engines/default/engine/utils.lua
with
35 additions
and
6 deletions
game/engines/default/engine/Module.lua
+
21
−
6
View file @
5eaddec4
...
...
@@ -289,7 +289,7 @@ end
--- List all available addons
function
_M
:
listAddons
(
mod
,
ignore_compat
)
local
adds
=
{}
local
load
=
function
(
dir
,
teaa
)
local
load
=
function
(
dir
,
teaa
,
teaac
)
local
add_def
=
loadfile
(
dir
..
"/init.lua"
)
if
add_def
then
local
add
=
{}
...
...
@@ -299,6 +299,7 @@ function _M:listAddons(mod, ignore_compat)
if
(
ignore_compat
or
engine
.
version_nearly_same
(
mod
.
version
,
add
.
version
))
and
add
.
for_module
==
mod
.
short_name
then
add
.
dir
=
dir
add
.
teaa
=
teaa
add
.
teaac
=
teaac
add
.
natural_compatible
=
engine
.
version_nearly_same
(
mod
.
version
,
add
.
version
)
add
.
version_txt
=
(
"%d.%d.%d"
):
format
(
add
.
version
[
1
],
add
.
version
[
2
],
add
.
version
[
3
])
if
add
.
dlc
and
not
profile
:
isDonator
(
add
.
dlc
)
then
add
.
dlc
=
"no"
end
...
...
@@ -309,7 +310,7 @@ function _M:listAddons(mod, ignore_compat)
end
local
parse
=
function
(
basedir
)
for
i
,
short_name
in
ipairs
(
fs
.
list
(
basedir
))
do
if
short_name
:
find
(
"^"
..
mod
.
short_name
..
"%-"
)
then
for
i
,
short_name
in
ipairs
(
fs
.
list
(
basedir
))
do
if
short_name
:
find
(
"^"
..
mod
.
short_name
..
"%-"
)
or
short_name
:
find
(
".teaac$"
)
then
local
dir
=
basedir
..
short_name
print
(
"Checking addon"
,
short_name
,
":: (as dir)"
,
fs
.
exists
(
dir
..
"/init.lua"
),
":: (as teaa)"
,
short_name
:
find
(
".teaa$"
),
""
)
if
fs
.
exists
(
dir
..
"/init.lua"
)
then
...
...
@@ -321,6 +322,16 @@ function _M:listAddons(mod, ignore_compat)
load
(
"/testload"
,
dir
)
end
fs
.
umount
(
fs
.
getRealPath
(
dir
))
elseif
short_name
:
find
(
".teaac$"
)
then
fs
.
mount
(
fs
.
getRealPath
(
dir
),
"/testload"
,
false
)
for
sdir
in
fs
.
iterate
(
"/testload"
,
function
(
p
)
return
p
:
find
(
"%-"
)
end
)
do
print
(
" * Addon collection subaddon"
,
sdir
)
local
mod
if
fs
.
exists
(
"/testload/"
..
sdir
..
"/init.lua"
)
then
load
(
"/testload/"
..
sdir
,
dir
,
sdir
)
end
end
fs
.
umount
(
fs
.
getRealPath
(
dir
))
end
end
end
end
...
...
@@ -454,13 +465,15 @@ You may try to force loading if you are sure the savefile does not use that addo
if
add
.
data
then
print
(
" * with data"
)
if
add
.
teaa
then
fs
.
mount
(
"subdir:/data/|"
..
fs
.
getRealPath
(
add
.
teaa
),
"/data-"
..
add
.
short_name
,
true
)
if
add
.
teaac
then
fs
.
mount
(
"subdir:/"
..
add
.
teaac
..
"/data/|"
..
fs
.
getRealPath
(
add
.
teaa
),
"/data-"
..
add
.
short_name
,
true
)
elseif
add
.
teaa
then
fs
.
mount
(
"subdir:/data/|"
..
fs
.
getRealPath
(
add
.
teaa
),
"/data-"
..
add
.
short_name
,
true
)
else
fs
.
mount
(
base
..
"/data"
,
"/data-"
..
add
.
short_name
,
true
)
end
end
if
add
.
superload
then
print
(
" * with superload"
)
if
add
.
teaa
then
fs
.
mount
(
"subdir:/superload/|"
..
fs
.
getRealPath
(
add
.
teaa
),
"/mod/addons/"
..
add
.
short_name
..
"/superload"
,
true
)
if
add
.
teaac
then
fs
.
mount
(
"subdir:/"
..
add
.
teaac
..
"/superload/|"
..
fs
.
getRealPath
(
add
.
teaa
),
"/mod/addons/"
..
add
.
short_name
..
"/superload"
,
true
)
elseif
add
.
teaa
then
fs
.
mount
(
"subdir:/superload/|"
..
fs
.
getRealPath
(
add
.
teaa
),
"/mod/addons/"
..
add
.
short_name
..
"/superload"
,
true
)
else
fs
.
mount
(
base
..
"/superload"
,
"/mod/addons/"
..
add
.
short_name
..
"/superload"
,
true
)
end
...
...
@@ -468,12 +481,14 @@ You may try to force loading if you are sure the savefile does not use that addo
end
if
add
.
overload
then
print
(
" * with overload"
)
if
add
.
teaa
then
fs
.
mount
(
"subdir:/overload/|"
..
fs
.
getRealPath
(
add
.
teaa
),
"/"
,
false
)
if
add
.
teaac
then
fs
.
mount
(
"subdir:/"
..
add
.
teaac
..
"/overload/|"
..
fs
.
getRealPath
(
add
.
teaa
),
"/"
,
false
)
elseif
add
.
teaa
then
fs
.
mount
(
"subdir:/overload/|"
..
fs
.
getRealPath
(
add
.
teaa
),
"/"
,
false
)
else
fs
.
mount
(
base
..
"/overload"
,
"/"
,
false
)
end
end
if
add
.
hooks
then
if
add
.
teaa
then
fs
.
mount
(
"subdir:/hooks/|"
..
fs
.
getRealPath
(
add
.
teaa
),
"/hooks/"
..
add
.
short_name
,
true
)
if
add
.
teaac
then
fs
.
mount
(
"subdir:/"
..
add
.
teaac
..
"/hooks/|"
..
fs
.
getRealPath
(
add
.
teaa
),
"/hooks/"
..
add
.
short_name
,
true
)
elseif
add
.
teaa
then
fs
.
mount
(
"subdir:/hooks/|"
..
fs
.
getRealPath
(
add
.
teaa
),
"/hooks/"
..
add
.
short_name
,
true
)
else
fs
.
mount
(
base
..
"/hooks"
,
"/hooks/"
..
add
.
short_name
,
true
)
end
...
...
This diff is collapsed.
Click to expand it.
game/engines/default/engine/utils.lua
+
14
−
0
View file @
5eaddec4
...
...
@@ -988,6 +988,20 @@ function core.display.loadImage(path)
return
oldloadimage
(
path
)
end
function
fs
.
iterate
(
path
,
filter
)
local
list
=
fs
.
list
(
path
)
if
filter
then
for
i
=
#
list
,
1
,
-
1
do
if
not
filter
(
list
[
i
])
then
table.remove
(
list
,
i
)
end
end
end
local
i
=
0
return
function
()
i
=
i
+
1
return
list
[
i
]
end
end
local
oldfsexists
=
fs
.
exists
function
fs
.
exists
(
path
)
if
virtualimages
[
path
]
then
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