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
e4b6b890
Commit
e4b6b890
authored
11 years ago
by
DarkGod
Browse files
Options
Downloads
Patches
Plain Diff
Fixed ListColumns to be includable in UIContainer
parent
73ebdc6b
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/ui/ListColumns.lua
+33
-33
33 additions, 33 deletions
game/engines/default/engine/ui/ListColumns.lua
game/engines/default/engine/ui/UIContainer.lua
+1
-0
1 addition, 0 deletions
game/engines/default/engine/ui/UIContainer.lua
with
34 additions
and
33 deletions
game/engines/default/engine/ui/ListColumns.lua
+
33
−
33
View file @
e4b6b890
...
...
@@ -44,7 +44,7 @@ function _M:init(t)
self
.
all_clicks
=
t
.
all_clicks
self
.
floating_headers
=
t
.
floating_headers
or
true
self
.
hide_columns
=
t
.
hide_columns
or
false
self
.
clip
_area
=
t
.
clip
_area
and
t
.
clip
_area
or
{
w
=
self
.
w
,
h
=
self
.
h
}
self
.
dest
_area
=
t
.
dest
_area
and
t
.
dest
_area
or
{
w
=
self
.
w
,
h
=
self
.
h
}
self
.
text_shadow
=
t
.
text_shadow
or
self
.
text_shadow
self
.
click_select
=
t
.
click_select
or
false
self
.
only_display
=
t
.
only_display
or
false
...
...
@@ -205,7 +205,7 @@ function _M:generateRow(row, force)
end
if
col
.
direct_draw
then
row
.
cells
[
j
].
w
,
row
.
cells
[
j
].
h
=
col
.
direct_draw
(
row
,
0
,
0
,
col
.
width
,
self
.
row_height
,
0
,
0
,
0
,
0
,
self
.
clip
_area
)
or
self
.
row_height
,
self
.
row_height
row
.
cells
[
j
].
w
,
row
.
cells
[
j
].
h
=
col
.
direct_draw
(
row
,
0
,
0
,
col
.
width
,
self
.
row_height
,
0
,
0
,
0
,
0
,
self
.
dest
_area
)
or
self
.
row_height
,
self
.
row_height
else
if
type
(
col
.
display_prop
)
==
"function"
then
text
=
tostring
(
col
.
display_prop
(
row
))
...
...
@@ -224,9 +224,9 @@ function _M:generateRow(row, force)
row
.
h
=
self
.
row_height
or
max_h
end
function
_M
:
drawRow
(
row
,
row_i
,
nb_keyframes
,
x
,
y
,
total_w
,
total_h
,
loffset_x
,
loffset_y
,
clip
_area
)
function
_M
:
drawRow
(
row
,
row_i
,
nb_keyframes
,
x
,
y
,
total_w
,
total_h
,
loffset_x
,
loffset_y
,
dest
_area
)
nb_keyframes
=
(
nb_keyframes
or
0
)
*
0
.
5
clip
_area
=
clip
_area
or
self
.
clip
_area
dest
_area
=
dest
_area
or
self
.
dest
_area
local
column_w_offset
=
x
local
clip_y_start
=
0
local
clip_y_end
=
0
...
...
@@ -251,16 +251,16 @@ function _M:drawRow(row, row_i, nb_keyframes, x, y, total_w, total_h, loffset_x,
if
not
self
.
only_display
then
if
self
.
sel
==
row_i
then
if
self
.
focused
then
self
:
drawFrame
(
col
.
frame_sel
,
column_w_offset
,
y
,
nil
,
nil
,
nil
,
nil
,
nil
,
nil
,
0
,
total_h
,
0
,
loffset_y
,
clip
_area
)
self
:
drawFrame
(
col
.
frame_sel
,
column_w_offset
,
y
,
nil
,
nil
,
nil
,
nil
,
nil
,
nil
,
0
,
total_h
,
0
,
loffset_y
,
dest
_area
)
else
self
:
drawFrame
(
col
.
frame_usel
,
column_w_offset
,
y
,
nil
,
nil
,
nil
,
nil
,
nil
,
nil
,
0
,
total_h
,
0
,
loffset_y
,
clip
_area
)
self
:
drawFrame
(
col
.
frame_usel
,
column_w_offset
,
y
,
nil
,
nil
,
nil
,
nil
,
nil
,
nil
,
0
,
total_h
,
0
,
loffset_y
,
dest
_area
)
end
else
if
row
.
focus_decay
then
if
self
.
focused
then
self
:
drawFrame
(
col
.
frame_sel
,
column_w_offset
,
y
,
1
,
1
,
1
,
row
.
focus_decay
*
self
.
one_by_focus_decay
,
nil
,
nil
,
0
,
total_h
,
0
,
loffset_y
,
clip
_area
)
else
self
:
drawFrame
(
col
.
frame_usel
,
column_w_offset
,
y
,
1
,
1
,
1
,
row
.
focus_decay
*
self
.
one_by_focus_decay
,
nil
,
nil
,
0
,
total_h
,
0
,
loffset_y
,
clip
_area
)
end
if
self
.
focused
then
self
:
drawFrame
(
col
.
frame_sel
,
column_w_offset
,
y
,
1
,
1
,
1
,
row
.
focus_decay
*
self
.
one_by_focus_decay
,
nil
,
nil
,
0
,
total_h
,
0
,
loffset_y
,
dest
_area
)
else
self
:
drawFrame
(
col
.
frame_usel
,
column_w_offset
,
y
,
1
,
1
,
1
,
row
.
focus_decay
*
self
.
one_by_focus_decay
,
nil
,
nil
,
0
,
total_h
,
0
,
loffset_y
,
dest
_area
)
end
else
self
:
drawFrame
(
col
.
frame
,
column_w_offset
,
y
,
nil
,
nil
,
nil
,
nil
,
nil
,
nil
,
0
,
total_h
,
0
,
loffset_y
,
clip
_area
)
self
:
drawFrame
(
col
.
frame
,
column_w_offset
,
y
,
nil
,
nil
,
nil
,
nil
,
nil
,
nil
,
0
,
total_h
,
0
,
loffset_y
,
dest
_area
)
end
end
...
...
@@ -268,7 +268,7 @@ function _M:drawRow(row, row_i, nb_keyframes, x, y, total_w, total_h, loffset_x,
local
c
=
row
.
special_bg
if
type
(
c
)
==
"function"
then
c
=
c
(
row
)
end
if
c
then
self
:
drawFrame
(
col
.
frame_special
,
column_w_offset
,
y
,
c
.
r
,
c
.
g
,
c
.
b
,
c
.
a
or
1
,
nil
,
nil
,
0
,
total_h
,
0
,
loffset_y
,
clip
_area
)
self
:
drawFrame
(
col
.
frame_special
,
column_w_offset
,
y
,
c
.
r
,
c
.
g
,
c
.
b
,
c
.
a
or
1
,
nil
,
nil
,
0
,
total_h
,
0
,
loffset_y
,
dest
_area
)
end
end
if
total_h
<
loffset_y
then
...
...
@@ -279,7 +279,7 @@ function _M:drawRow(row, row_i, nb_keyframes, x, y, total_w, total_h, loffset_x,
if
clip_y_start
>
clip_maxy_start
then
clip_maxy_start
=
clip_y_start
end
if
col
.
direct_draw
then
_
,
_
,
clip_x_start
,
clip_x_end
,
clip_y_start
,
clip_y_end
=
col
.
direct_draw
(
row
,
column_w_offset
,
y
,
col
.
width
,
self
.
row_height
,
total_w
,
total_h
,
loffset_x
,
loffset_y
,
clip
_area
)
or
0
,
0
,
0
,
0
,
0
,
0
_
,
_
,
clip_x_start
,
clip_x_end
,
clip_y_start
,
clip_y_end
=
col
.
direct_draw
(
row
,
column_w_offset
,
y
,
col
.
width
,
self
.
row_height
,
total_w
,
total_h
,
loffset_x
,
loffset_y
,
dest
_area
)
or
0
,
0
,
0
,
0
,
0
,
0
frame_clip_y
=
0
elseif
row
.
cells
[
j
].
_tex
then
local
center_h
=
(
(
self
.
row_height
and
self
.
row_height
or
row
.
cells
[
j
].
h
)
-
row
.
cells
[
j
].
h
)
*
0
.
5
...
...
@@ -290,8 +290,8 @@ function _M:drawRow(row, row_i, nb_keyframes, x, y, total_w, total_h, loffset_x,
frame_clip_y
=
center_h
end
-- if it ended after visible area then compute its bottom clip
if
total_h
+
row
.
cells
[
j
].
h
+
center_h
>
loffset_y
+
clip
_area
.
h
then
clip_y_end
=
total_h
+
row
.
cells
[
j
].
h
+
center_h
-
loffset_y
-
clip
_area
.
h
if
total_h
+
row
.
cells
[
j
].
h
+
center_h
>
loffset_y
+
dest
_area
.
h
then
clip_y_end
=
total_h
+
row
.
cells
[
j
].
h
+
center_h
-
loffset_y
-
dest
_area
.
h
end
-- clip clipping to avoid texture display errors
...
...
@@ -322,15 +322,15 @@ function _M:drawRow(row, row_i, nb_keyframes, x, y, total_w, total_h, loffset_x,
else
row
.
cells
[
j
].
display_offset
.
x
=
0
end
_
,
_
,
frame_clip_y
,
_
=
util
.
clipOffset
(
0
,
center_h
,
total_w
,
total_h
,
loffset_x
,
loffset_y
,
clip
_area
)
_
,
_
,
frame_clip_y
,
_
=
util
.
clipOffset
(
0
,
center_h
,
total_w
,
total_h
,
loffset_x
,
loffset_y
,
dest
_area
)
total_h
=
tmp_total_h
+
center_h
if
self
.
text_shadow
then
util
.
clipTexture
(
row
.
cells
[
j
],
column_w_offset
+
1
+
col
.
frame_sel
.
b4
.
w
,
y
+
1
+
center_h
-
frame_clip_y
,
row
.
cells
[
j
].
w
,
row
.
cells
[
j
].
h
,
0
,
total_h
,
row
.
cells
[
j
].
display_offset
.
x
,
loffset_y
,
{
w
=
col
.
width
-
2
*
col
.
frame_sel
.
b4
.
w
,
h
=
clip
_area
.
h
},
0
,
0
,
0
,
self
.
text_shadow
)
end
util
.
clipTexture
(
row
.
cells
[
j
],
column_w_offset
+
col
.
frame_sel
.
b4
.
w
,
y
+
center_h
-
frame_clip_y
,
row
.
cells
[
j
].
w
,
row
.
cells
[
j
].
h
,
0
,
total_h
,
row
.
cells
[
j
].
display_offset
.
x
,
loffset_y
,
{
w
=
col
.
width
-
2
*
col
.
frame_sel
.
b4
.
w
,
h
=
clip
_area
.
h
},
row
.
color
[
1
]
*
one_by_white
,
row
.
color
[
2
]
*
one_by_white
,
row
.
color
[
3
]
*
one_by_white
,
1
.
0
)
if
self
.
text_shadow
then
util
.
clipTexture
(
row
.
cells
[
j
],
column_w_offset
+
1
+
col
.
frame_sel
.
b4
.
w
,
y
+
1
+
center_h
-
frame_clip_y
,
row
.
cells
[
j
].
w
,
row
.
cells
[
j
].
h
,
0
,
total_h
,
row
.
cells
[
j
].
display_offset
.
x
,
loffset_y
,
{
w
=
col
.
width
-
2
*
col
.
frame_sel
.
b4
.
w
,
h
=
dest
_area
.
h
},
0
,
0
,
0
,
self
.
text_shadow
)
end
util
.
clipTexture
(
row
.
cells
[
j
],
column_w_offset
+
col
.
frame_sel
.
b4
.
w
,
y
+
center_h
-
frame_clip_y
,
row
.
cells
[
j
].
w
,
row
.
cells
[
j
].
h
,
0
,
total_h
,
row
.
cells
[
j
].
display_offset
.
x
,
loffset_y
,
{
w
=
col
.
width
-
2
*
col
.
frame_sel
.
b4
.
w
,
h
=
dest
_area
.
h
},
row
.
color
[
1
]
*
one_by_white
,
row
.
color
[
2
]
*
one_by_white
,
row
.
color
[
3
]
*
one_by_white
,
1
.
0
)
else
_
,
_
,
frame_clip_y
,
_
=
util
.
clipOffset
(
0
,
center_h
,
total_w
,
total_h
,
loffset_x
,
loffset_y
,
clip
_area
)
_
,
_
,
frame_clip_y
,
_
=
util
.
clipOffset
(
0
,
center_h
,
total_w
,
total_h
,
loffset_x
,
loffset_y
,
dest
_area
)
total_h
=
tmp_total_h
+
center_h
if
self
.
text_shadow
then
util
.
clipTexture
(
row
.
cells
[
j
],
column_w_offset
+
1
+
col
.
frame_sel
.
b4
.
w
,
y
+
1
+
center_h
-
frame_clip_y
,
row
.
cells
[
j
].
w
,
row
.
cells
[
j
].
h
,
0
,
total_h
,
0
,
loffset_y
,
clip
_area
,
0
,
0
,
0
,
self
.
text_shadow
)
end
util
.
clipTexture
(
row
.
cells
[
j
],
column_w_offset
+
col
.
frame_sel
.
b4
.
w
,
y
+
center_h
-
frame_clip_y
,
row
.
cells
[
j
].
w
,
row
.
cells
[
j
].
h
,
0
,
total_h
,
0
,
loffset_y
,
clip
_area
,
row
.
color
[
1
]
*
one_by_white
,
row
.
color
[
2
]
*
one_by_white
,
row
.
color
[
3
]
*
one_by_white
,
1
.
0
)
if
self
.
text_shadow
then
util
.
clipTexture
(
row
.
cells
[
j
],
column_w_offset
+
1
+
col
.
frame_sel
.
b4
.
w
,
y
+
1
+
center_h
-
frame_clip_y
,
row
.
cells
[
j
].
w
,
row
.
cells
[
j
].
h
,
0
,
total_h
,
0
,
loffset_y
,
dest
_area
,
0
,
0
,
0
,
self
.
text_shadow
)
end
util
.
clipTexture
(
row
.
cells
[
j
],
column_w_offset
+
col
.
frame_sel
.
b4
.
w
,
y
+
center_h
-
frame_clip_y
,
row
.
cells
[
j
].
w
,
row
.
cells
[
j
].
h
,
0
,
total_h
,
0
,
loffset_y
,
dest
_area
,
row
.
color
[
1
]
*
one_by_white
,
row
.
color
[
2
]
*
one_by_white
,
row
.
color
[
3
]
*
one_by_white
,
1
.
0
)
end
end
clip_y_start
=
clip_y_start
+
frame_clip_y
...
...
@@ -535,7 +535,7 @@ function _M:display(x, y, nb_keyframes, screen_x, screen_y, offset_x, offset_y,
local
clip_y_start
=
0
local
clip_y_end
=
0
local
frame_clip_y
=
0
local
clip
_area
=
table
.
clone
(
self
.
clip
_area
)
local
dest
_area
=
table
.
clone
(
self
.
dest
_area
)
local
frame_clip_y_start
,
frame_clip_y_end
local
max_h
=
0
...
...
@@ -550,10 +550,10 @@ function _M:display(x, y, nb_keyframes, screen_x, screen_y, offset_x, offset_y,
else
self
:
drawFrame
(
col
.
frame_col_sel
,
x
+
current_x
,
y
+
current_y
)
end
local
one_by_tex_h
=
1
/
col
.
_tex_h
col
.
_tex
:
toScreenPrecise
(
x
+
current_x
+
col
.
frame_sel
.
b4
.
w
,
y
+
current_y
+
center_h
,
col
.
w
,
col
.
h
-
(
clip_y_start
+
clip_y_end
),
0
,
col
.
w
/
col
.
_tex_w
,
clip_y_start
*
one_by_tex_h
,
(
col
.
h
-
clip_y_end
)
*
one_by_tex_h
)
elseif
total_h
+
self
.
max_h_columns
>
loffset_y
and
total_h
<
loffset_y
+
clip
_area
.
h
then
elseif
total_h
+
self
.
max_h_columns
>
loffset_y
and
total_h
<
loffset_y
+
dest
_area
.
h
then
if
self
.
cur_col
==
j
then
_
,
_
,
frame_clip_y_start
,
frame_clip_y_end
=
self
:
drawFrame
(
col
.
frame_col
,
x
+
current_x
,
y
+
current_y
,
nil
,
nil
,
nil
,
nil
,
nil
,
nil
,
0
,
total_h
,
0
,
loffset_y
,
clip
_area
)
else
_
,
_
,
frame_clip_y_start
,
frame_clip_y_end
=
self
:
drawFrame
(
col
.
frame_col_sel
,
x
+
current_x
,
y
+
current_y
,
nil
,
nil
,
nil
,
nil
,
nil
,
nil
,
0
,
total_h
,
0
,
loffset_y
,
clip
_area
)
end
if
self
.
cur_col
==
j
then
_
,
_
,
frame_clip_y_start
,
frame_clip_y_end
=
self
:
drawFrame
(
col
.
frame_col
,
x
+
current_x
,
y
+
current_y
,
nil
,
nil
,
nil
,
nil
,
nil
,
nil
,
0
,
total_h
,
0
,
loffset_y
,
dest
_area
)
else
_
,
_
,
frame_clip_y_start
,
frame_clip_y_end
=
self
:
drawFrame
(
col
.
frame_col_sel
,
x
+
current_x
,
y
+
current_y
,
nil
,
nil
,
nil
,
nil
,
nil
,
nil
,
0
,
total_h
,
0
,
loffset_y
,
dest
_area
)
end
self
.
mouse
:
updateZone
((
"column header%d"
):
format
(
j
),
current_x
,
current_y
,
col
.
width
,
self
.
row_height
-
frame_clip_y_start
-
frame_clip_y_end
)
if
self
.
only_display
then
frame_clip_y
=
center_h
else
frame_clip_y
=
loffset_y
-
total_h
end
...
...
@@ -565,11 +565,11 @@ function _M:display(x, y, nb_keyframes, screen_x, screen_y, offset_x, offset_y,
end
-- if it ended after visible area then compute its bottom clip
if
total_h
+
col
.
h
+
center_h
>
loffset_y
+
clip
_area
.
h
then
clip_y_end
=
total_h
+
col
.
h
+
center_h
-
loffset_y
-
clip
_area
.
h
if
total_h
+
col
.
h
+
center_h
>
loffset_y
+
dest
_area
.
h
then
clip_y_end
=
total_h
+
col
.
h
+
center_h
-
loffset_y
-
dest
_area
.
h
end
local
one_by_tex_h
=
1
/
col
.
_tex_h
if
total_h
+
col
.
h
>
loffset_y
and
total_h
<
loffset_y
+
clip
_area
.
h
then
if
total_h
+
col
.
h
>
loffset_y
and
total_h
<
loffset_y
+
dest
_area
.
h
then
col
.
_tex
:
toScreenPrecise
(
x
+
current_x
+
col
.
frame_sel
.
b4
.
w
,
y
+
current_y
+
center_h
-
frame_clip_y
,
col
.
w
,
col
.
h
-
(
clip_y_start
+
clip_y_end
),
0
,
col
.
w
/
col
.
_tex_w
,
clip_y_start
*
one_by_tex_h
,
(
col
.
h
-
clip_y_end
)
*
one_by_tex_h
)
end
end
...
...
@@ -580,10 +580,10 @@ function _M:display(x, y, nb_keyframes, screen_x, screen_y, offset_x, offset_y,
max_h
=
self
.
row_height
or
max_h
if
self
.
floating_headers
then
clip
_area
.
h
=
clip
_area
.
h
-
max_h
dest
_area
.
h
=
dest
_area
.
h
-
max_h
current_y
=
current_y
+
max_h
loffset_y
=
loffset_y
+
max_h
elseif
total_h
+
max_h
>
loffset_y
and
total_h
<
loffset_y
+
clip
_area
.
h
then
elseif
total_h
+
max_h
>
loffset_y
and
total_h
<
loffset_y
+
dest
_area
.
h
then
current_y
=
current_y
+
max_h
if
not
self
.
only_display
then
current_y
=
current_y
+
total_h
-
loffset_y
end
end
...
...
@@ -600,12 +600,12 @@ function _M:display(x, y, nb_keyframes, screen_x, screen_y, offset_x, offset_y,
if
self
.
focus_decay_max
then
self
.
list
[
self
.
sel
].
focus_decay
=
self
.
focus_decay_max
end
-- if we are too deep then end this
if
total_h
>
loffset_y
+
clip
_area
.
h
then
return
end
if
total_h
>
loffset_y
+
dest
_area
.
h
then
return
end
for
i
=
1
,
#
self
.
list
do
row
=
self
.
list
[
i
]
-- if its visible then draw it
if
total_h
+
row
.
h
>
loffset_y
and
total_h
<
loffset_y
+
clip
_area
.
h
then
_
,
_
,
clip_y_start
,
clip_y_end
=
self
:
drawRow
(
row
,
i
,
nb_keyframes
,
x
,
y
+
current_y
,
0
,
total_h
,
0
,
loffset_y
,
clip
_area
)
if
total_h
+
row
.
h
>
loffset_y
and
total_h
<
loffset_y
+
dest
_area
.
h
then
_
,
_
,
clip_y_start
,
clip_y_end
=
self
:
drawRow
(
row
,
i
,
nb_keyframes
,
x
,
y
+
current_y
,
0
,
total_h
,
0
,
loffset_y
,
dest
_area
)
row
.
last_display_x
=
screen_x
row
.
last_display_y
=
screen_y
+
current_y
...
...
@@ -623,7 +623,7 @@ function _M:display(x, y, nb_keyframes, screen_x, screen_y, offset_x, offset_y,
-- add full size of row
total_h
=
total_h
+
row
.
h
-- if we are too deep then end this
if
total_h
>
loffset_y
+
clip
_area
.
h
then
break
end
if
total_h
>
loffset_y
+
dest
_area
.
h
then
break
end
end
-- show scrollbar only if there is one, total size of UI element is greater than visible one and only_display switch is not set
...
...
@@ -657,4 +657,4 @@ function _M:display(x, y, nb_keyframes, screen_x, screen_y, offset_x, offset_y,
if
not
self
.
click_select
then
self
:
onSelect
()
end
end
end
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
game/engines/default/engine/ui/UIContainer.lua
+
1
−
0
View file @
e4b6b890
...
...
@@ -106,6 +106,7 @@ function _M:display(x, y, nb_keyframes, screen_x, screen_y, offset_x, offset_y,
local
first
=
true
for
i
=
1
,
#
self
.
uis
do
ui
=
self
.
uis
[
i
]
ui
.
dest_area
=
ui
.
dest_area
or
{}
ui
.
dest_area
.
h
=
self
.
dest_area
.
h
if
offset_y
<=
total_h
+
self
.
uis
[
i
].
h
then
ui
:
display
(
x
,
current_y
,
nb_keyframes
,
x
,
current_y
,
offset_x
,
offset_y
,
local_x
,
local_y
)
...
...
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