Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tales of MajEyal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
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
yutio888
Tales of MajEyal
Commits
3c752800
Commit
3c752800
authored
15 years ago
by
dg
Browse files
Options
Downloads
Patches
Plain Diff
fix loading level
git-svn-id:
http://svn.net-core.org/repos/t-engine4@407
51575b47-30f0-44d4-a5cc-537603b46e54
parent
d5e3ef1f
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/engine/Savefile.lua
+1
-1
1 addition, 1 deletion
game/engine/Savefile.lua
game/engine/class.lua
+11
-1
11 additions, 1 deletion
game/engine/class.lua
with
12 additions
and
2 deletions
game/engine/Savefile.lua
+
1
−
1
View file @
3c752800
...
...
@@ -130,7 +130,7 @@ end
function
_M
:
loadReal
(
load
)
if
self
.
loaded
[
load
]
then
return
self
.
loaded
[
load
]
end
local
f
=
fs
.
open
(
self
.
load_dir
..
load
,
"r"
)
--
print("loading", load)
print
(
"loading"
,
load
)
local
lines
=
{}
while
true
do
local
l
=
f
:
read
()
...
...
This diff is collapsed.
Click to expand it.
game/engine/class.lua
+
11
−
1
View file @
3c752800
...
...
@@ -118,6 +118,12 @@ local function serialize_data(outf, name, value, saved, filter, allow, savefile,
else
saved
[
value
]
=
name
-- save name for next time
outf
(
"{}\n"
)
-- create a new table
-- If we are the base table, decalre ourselves
if
name
==
"data"
then
outf
(
'setLoaded("'
..
savefile
:
getFileName
(
value
)
..
'", data)\n'
)
end
for
k
,
v
in
pairs
(
value
)
do
-- save its fields
-- print(allow, k , filter[k])
if
(
not
allow
and
not
filter
[
k
])
or
(
allow
and
filter
[
k
])
then
...
...
@@ -140,7 +146,7 @@ end
local
function
serialize
(
data
,
filter
,
allow
,
savefile
)
local
tbl
=
{}
local
outf
=
function
(
...
)
for
i
,
str
in
ipairs
(
arg
)
do
table.insert
(
tbl
,
str
)
end
end
local
outf
=
function
(
...
)
for
i
,
str
in
ipairs
{
...
}
do
table.insert
(
tbl
,
str
)
end
end
serialize_data
(
outf
,
"data"
,
data
,
nil
,
filter
,
allow
,
savefile
,
true
)
table.insert
(
tbl
,
"return data\n"
)
return
tbl
...
...
@@ -166,6 +172,10 @@ local function deserialize(string, src)
local
f
,
err
=
loadstring
(
string
)
if
err
then
print
(
"error deserializing"
,
string
,
err
)
end
setfenv
(
f
,
{
setLoaded
=
function
(
name
,
t
)
print
(
"[setLoaded]"
,
name
,
t
)
engine
.
Savefile
.
current_save
.
loaded
[
name
]
=
t
end
,
loadstring
=
loadstring
,
loadObject
=
function
(
n
)
if
n
==
src
then
...
...
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