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
6201b170
Commit
6201b170
authored
9 years ago
by
DarkGod
Browse files
Options
Downloads
Patches
Plain Diff
Made the zone load tips look nicer
parent
433c9cc6
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/Zone.lua
+7
-7
7 additions, 7 deletions
game/engines/default/engine/Zone.lua
game/engines/default/engine/ui/Dialog.lua
+39
-2
39 additions, 2 deletions
game/engines/default/engine/ui/Dialog.lua
with
46 additions
and
9 deletions
game/engines/default/engine/Zone.lua
+
7
−
7
View file @
6201b170
...
@@ -822,9 +822,9 @@ end
...
@@ -822,9 +822,9 @@ end
function
_M
:
getLoadTips
()
function
_M
:
getLoadTips
()
if
self
.
load_tips
then
if
self
.
load_tips
then
local
l
=
rng
.
table
(
self
.
load_tips
)
local
l
=
rng
.
table
(
self
.
load_tips
)
return
l
.
text
return
"#{italic}##ANTIQUE_WHITE#"
..
l
.
text
..
"#WHITE##{normal}#"
else
else
return
""
return
nil
end
end
end
end
...
@@ -845,7 +845,7 @@ function _M:getLevel(game, lev, old_lev, no_close)
...
@@ -845,7 +845,7 @@ function _M:getLevel(game, lev, old_lev, no_close)
-- Load persistent level?
-- Load persistent level?
if
type
(
level_data
.
persistent
)
==
"string"
and
level_data
.
persistent
==
"zone_temporary"
then
if
type
(
level_data
.
persistent
)
==
"string"
and
level_data
.
persistent
==
"zone_temporary"
then
forceprint
(
"Loading zone temporary level"
,
self
.
short_name
,
lev
)
forceprint
(
"Loading zone temporary level"
,
self
.
short_name
,
lev
)
local
popup
=
Dialog
:
simpleWaiter
(
"Loading level"
,
"Please wait while loading the level... "
..
self
:
getLoadTips
(),
nil
,
10000
)
local
popup
=
Dialog
:
simpleWaiter
Tip
(
"Loading level"
,
"Please wait while loading the level... "
,
self
:
getLoadTips
(),
nil
,
10000
)
core
.
display
.
forceRedraw
()
core
.
display
.
forceRedraw
()
self
.
temp_memory_levels
=
self
.
temp_memory_levels
or
{}
self
.
temp_memory_levels
=
self
.
temp_memory_levels
or
{}
...
@@ -861,7 +861,7 @@ function _M:getLevel(game, lev, old_lev, no_close)
...
@@ -861,7 +861,7 @@ function _M:getLevel(game, lev, old_lev, no_close)
popup
:
done
()
popup
:
done
()
elseif
type
(
level_data
.
persistent
)
==
"string"
and
level_data
.
persistent
==
"zone"
and
not
self
.
save_per_level
then
elseif
type
(
level_data
.
persistent
)
==
"string"
and
level_data
.
persistent
==
"zone"
and
not
self
.
save_per_level
then
forceprint
(
"Loading zone persistance level"
,
self
.
short_name
,
lev
)
forceprint
(
"Loading zone persistance level"
,
self
.
short_name
,
lev
)
local
popup
=
Dialog
:
simpleWaiter
(
"Loading level"
,
"Please wait while loading the level... "
..
self
:
getLoadTips
(),
nil
,
10000
)
local
popup
=
Dialog
:
simpleWaiter
Tip
(
"Loading level"
,
"Please wait while loading the level... "
,
self
:
getLoadTips
(),
nil
,
10000
)
core
.
display
.
forceRedraw
()
core
.
display
.
forceRedraw
()
self
.
memory_levels
=
self
.
memory_levels
or
{}
self
.
memory_levels
=
self
.
memory_levels
or
{}
...
@@ -877,7 +877,7 @@ function _M:getLevel(game, lev, old_lev, no_close)
...
@@ -877,7 +877,7 @@ function _M:getLevel(game, lev, old_lev, no_close)
popup
:
done
()
popup
:
done
()
elseif
type
(
level_data
.
persistent
)
==
"string"
and
level_data
.
persistent
==
"memory"
then
elseif
type
(
level_data
.
persistent
)
==
"string"
and
level_data
.
persistent
==
"memory"
then
forceprint
(
"Loading memory persistance level"
,
self
.
short_name
,
lev
)
forceprint
(
"Loading memory persistance level"
,
self
.
short_name
,
lev
)
local
popup
=
Dialog
:
simpleWaiter
(
"Loading level"
,
"Please wait while loading the level... "
..
self
:
getLoadTips
(),
nil
,
10000
)
local
popup
=
Dialog
:
simpleWaiter
Tip
(
"Loading level"
,
"Please wait while loading the level... "
,
self
:
getLoadTips
(),
nil
,
10000
)
core
.
display
.
forceRedraw
()
core
.
display
.
forceRedraw
()
game
.
memory_levels
=
game
.
memory_levels
or
{}
game
.
memory_levels
=
game
.
memory_levels
or
{}
...
@@ -893,7 +893,7 @@ function _M:getLevel(game, lev, old_lev, no_close)
...
@@ -893,7 +893,7 @@ function _M:getLevel(game, lev, old_lev, no_close)
popup
:
done
()
popup
:
done
()
elseif
level_data
.
persistent
then
elseif
level_data
.
persistent
then
forceprint
(
"Loading level persistance level"
,
self
.
short_name
,
lev
)
forceprint
(
"Loading level persistance level"
,
self
.
short_name
,
lev
)
local
popup
=
Dialog
:
simpleWaiter
(
"Loading level"
,
"Please wait while loading the level... "
..
self
:
getLoadTips
(),
nil
,
10000
)
local
popup
=
Dialog
:
simpleWaiter
Tip
(
"Loading level"
,
"Please wait while loading the level... "
,
self
:
getLoadTips
(),
nil
,
10000
)
core
.
display
.
forceRedraw
()
core
.
display
.
forceRedraw
()
-- Try to load from a savefile
-- Try to load from a savefile
...
@@ -909,7 +909,7 @@ function _M:getLevel(game, lev, old_lev, no_close)
...
@@ -909,7 +909,7 @@ function _M:getLevel(game, lev, old_lev, no_close)
-- In any cases, make one if none was found
-- In any cases, make one if none was found
if
not
level
then
if
not
level
then
forceprint
(
"Creating level"
,
self
.
short_name
,
lev
)
forceprint
(
"Creating level"
,
self
.
short_name
,
lev
)
local
popup
=
Dialog
:
simpleWaiter
(
"Generating level"
,
"Please wait while generating the level... "
..
self
:
getLoadTips
(),
nil
,
10000
)
local
popup
=
Dialog
:
simpleWaiter
Tip
(
"Generating level"
,
"Please wait while generating the level... "
,
self
:
getLoadTips
(),
nil
,
10000
)
core
.
display
.
forceRedraw
()
core
.
display
.
forceRedraw
()
level
=
self
:
newLevel
(
level_data
,
lev
,
old_lev
,
game
)
level
=
self
:
newLevel
(
level_data
,
lev
,
old_lev
,
game
)
...
...
This diff is collapsed.
Click to expand it.
game/engines/default/engine/ui/Dialog.lua
+
39
−
2
View file @
6201b170
...
@@ -29,11 +29,17 @@ module(..., package.seeall, class.inherit(Base))
...
@@ -29,11 +29,17 @@ module(..., package.seeall, class.inherit(Base))
--- Requests a simple waiter dialog
--- Requests a simple waiter dialog
function
_M
:
simpleWaiter
(
title
,
text
,
width
,
count
,
max
)
function
_M
:
simpleWaiter
(
title
,
text
,
width
,
count
,
max
)
width
=
width
or
400
width
=
width
or
400
local
w
,
h
=
self
.
font
:
size
(
text
)
local
_
,
th
=
self
.
font
:
size
(
title
)
local
d
=
new
(
title
,
1
,
1
)
local
d
=
new
(
title
,
1
,
1
)
local
max_h
=
9999
local
textzone
=
require
(
"engine.ui.Textzone"
).
new
{
width
=
width
+
10
,
auto_height
=
true
,
scrollbar
=
true
,
text
=
text
}
if
textzone
.
h
>
max_h
then
textzone
.
h
=
max_h
else
textzone
.
scrollbar
=
nil
end
local
wait
=
require
(
"engine.ui.Waiter"
).
new
{
size
=
width
,
known_max
=
max
}
local
wait
=
require
(
"engine.ui.Waiter"
).
new
{
size
=
width
,
known_max
=
max
}
d
:
loadUI
{
d
:
loadUI
{
{
left
=
3
,
top
=
3
,
ui
=
require
(
"engine.ui.Textzone"
).
new
{
width
=
w
+
10
,
height
=
h
+
5
,
text
=
text
}
},
{
left
=
3
,
top
=
3
,
ui
=
textzone
},
{
left
=
3
,
bottom
=
3
,
ui
=
wait
},
{
left
=
3
,
bottom
=
3
,
ui
=
wait
},
}
}
d
:
setupUI
(
true
,
true
)
d
:
setupUI
(
true
,
true
)
...
@@ -50,6 +56,37 @@ function _M:simpleWaiter(title, text, width, count, max)
...
@@ -50,6 +56,37 @@ function _M:simpleWaiter(title, text, width, count, max)
return
d
return
d
end
end
--- Requests a simple waiter dialog
function
_M
:
simpleWaiterTip
(
title
,
text
,
tip
,
width
,
count
,
max
)
if
not
tip
then
return
self
:
simpleWaiter
(
title
,
text
,
width
,
count
,
max
)
end
width
=
width
or
400
local
_
,
th
=
self
.
font
:
size
(
title
)
local
d
=
new
(
title
,
1
,
1
)
local
wait
=
require
(
"engine.ui.Waiter"
).
new
{
size
=
width
,
known_max
=
max
}
local
textzone
=
require
(
"engine.ui.Textzone"
).
new
{
width
=
wait
.
w
,
auto_height
=
true
,
scrollbar
=
false
,
text
=
text
}
local
tipzone
=
require
(
"engine.ui.Textzone"
).
new
{
width
=
wait
.
w
,
auto_height
=
true
,
scrollbar
=
false
,
text
=
tip
}
local
split
=
require
(
"engine.ui.Separator"
).
new
{
dir
=
"vertical"
,
size
=
wait
.
w
-
12
}
d
:
loadUI
{
{
left
=
3
,
top
=
3
,
ui
=
textzone
},
{
left
=
3
+
6
,
top
=
3
+
textzone
.
h
,
ui
=
split
},
{
left
=
3
,
top
=
3
+
textzone
.
h
+
split
.
h
,
ui
=
tipzone
},
{
left
=
3
,
bottom
=
3
,
ui
=
wait
},
}
d
:
setupUI
(
true
,
true
)
d
.
done
=
function
(
self
)
game
:
unregisterDialog
(
self
)
end
d
.
timeout
=
function
(
self
,
secs
,
cb
)
wait
:
setTimeout
(
secs
,
function
()
cb
()
local
done
=
self
.
done
self
.
done
=
function
()
end
done
(
self
)
end
)
end
d
.
manual
=
function
(
self
,
...
)
wait
:
manual
(
...
)
end
d
.
manualStep
=
function
(
self
,
...
)
wait
:
manualStep
(
...
)
end
game
:
registerDialog
(
d
)
core
.
wait
.
enable
(
count
,
wait
:
getWaitDisplay
(
d
))
return
d
end
--- Requests a simple, press any key, dialog
--- Requests a simple, press any key, dialog
function
_M
:
listPopup
(
title
,
text
,
list
,
w
,
h
,
fct
)
function
_M
:
listPopup
(
title
,
text
,
list
,
w
,
h
,
fct
)
...
...
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