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
K'van
Tales of MajEyal
Commits
5b1fbf2b
Commit
5b1fbf2b
authored
10 years ago
by
DarkGod
Browse files
Options
Downloads
Patches
Plain Diff
Dragging hotkeys around will show a grid of where they will end up
parent
7c5b048a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
game/engines/default/engine/HotkeysIconsDisplay.lua
+43
-28
43 additions, 28 deletions
game/engines/default/engine/HotkeysIconsDisplay.lua
with
43 additions
and
28 deletions
game/engines/default/engine/HotkeysIconsDisplay.lua
+
43
−
28
View file @
5b1fbf2b
...
...
@@ -221,6 +221,19 @@ function _M:display()
self
.
items
[
#
self
.
items
+
1
]
=
{
i
=
i
,
x
=
x
,
y
=
y
,
e
=
display_entity
or
self
.
default_entity
,
color
=
color
,
angle
=
angle
,
key
=
key
,
gtxt
=
gtxt
,
frame
=
frame
,
pagesel
=
lpage
==
spage
}
self
.
clics
[
i
]
=
{
x
,
y
,
w
,
h
}
else
local
i
=
i
+
(
12
*
(
page
-
bpage
))
local
angle
=
0
local
color
=
{
190
,
190
,
190
}
local
frame
=
"disabled"
self
.
font
:
setStyle
(
"bold"
)
local
ks
=
game
.
key
:
formatKeyString
(
game
.
key
:
findBoundKeys
(
"HOTKEY_"
..
page_to_hotkey
[
page
]
..
bi
))
local
key
=
self
.
font
:
draw
(
ks
,
self
.
font
:
size
(
ks
),
colors
.
ANTIQUE_WHITE
.
r
,
colors
.
ANTIQUE_WHITE
.
g
,
colors
.
ANTIQUE_WHITE
.
b
,
true
)[
1
]
self
.
font
:
setStyle
(
"normal"
)
self
.
items
[
#
self
.
items
+
1
]
=
{
show_on_drag
=
true
,
i
=
i
,
x
=
x
,
y
=
y
,
e
=
nil
,
color
=
color
,
angle
=
angle
,
key
=
key
,
gtxt
=
nil
,
frame
=
frame
}
self
.
clics
[
i
]
=
{
x
,
y
,
w
,
h
,
fake
=
true
}
end
if
orient
==
"down"
or
orient
==
"up"
then
...
...
@@ -247,38 +260,40 @@ function _M:toScreen()
if
self
.
bg_texture
then
self
.
bg_texture
:
toScreenFull
(
self
.
display_x
,
self
.
display_y
,
self
.
w
,
self
.
h
,
self
.
bg_texture_w
,
self
.
bg_texture_h
)
end
for
i
=
1
,
#
self
.
items
do
local
item
=
self
.
items
[
i
]
local
key
=
item
.
key
local
gtxt
=
item
.
gtxt
local
frame
=
frames_colors
[
item
.
frame
]
local
pagesel
=
item
.
pagesel
and
1
or
0
.
5
if
not
item
.
show_on_drag
or
(
game
.
mouse
and
game
.
mouse
.
drag
and
self
.
cur_sel
)
then
local
key
=
item
.
key
local
gtxt
=
item
.
gtxt
local
frame
=
frames_colors
[
item
.
frame
]
local
pagesel
=
item
.
pagesel
and
1
or
0
.
5
item
.
e
:
toScreen
(
self
.
tiles
,
self
.
display_x
+
item
.
x
+
self
.
frames
.
fx
,
self
.
display_y
+
item
.
y
+
self
.
frames
.
fy
,
self
.
icon_w
,
self
.
icon_h
)
if
item
.
e
then
item
.
e
:
toScreen
(
self
.
tiles
,
self
.
display_x
+
item
.
x
+
self
.
frames
.
fx
,
self
.
display_y
+
item
.
y
+
self
.
frames
.
fy
,
self
.
icon_w
,
self
.
icon_h
)
end
if
item
.
color
then
core
.
display
.
drawQuadPart
(
self
.
display_x
+
item
.
x
+
self
.
frames
.
fx
,
self
.
display_y
+
item
.
y
+
self
.
frames
.
fy
,
self
.
icon_w
,
self
.
icon_h
,
item
.
angle
,
item
.
color
[
1
],
item
.
color
[
2
],
item
.
color
[
3
],
100
)
end
if
item
.
color
then
core
.
display
.
drawQuadPart
(
self
.
display_x
+
item
.
x
+
self
.
frames
.
fx
,
self
.
display_y
+
item
.
y
+
self
.
frames
.
fy
,
self
.
icon_w
,
self
.
icon_h
,
item
.
angle
,
item
.
color
[
1
],
item
.
color
[
2
],
item
.
color
[
3
],
100
)
end
if
self
.
cur_sel
==
item
.
i
then
core
.
display
.
drawQuad
(
self
.
display_x
+
item
.
x
+
self
.
frames
.
fx
,
self
.
display_y
+
item
.
y
+
self
.
frames
.
fy
,
self
.
icon_w
,
self
.
icon_h
,
128
,
128
,
255
,
80
)
end
if
self
.
cur_sel
==
item
.
i
then
core
.
display
.
drawQuad
(
self
.
display_x
+
item
.
x
+
self
.
frames
.
fx
,
self
.
display_y
+
item
.
y
+
self
.
frames
.
fy
,
self
.
icon_w
,
self
.
icon_h
,
128
,
128
,
255
,
80
)
end
-- frame[1]:toScreenFull(self.display_x + item.x, self.display_y + item.y, self.frames.w, self.frames.h, frame[2] * self.frames.rw, frame[3] * self.frames.rh, pagesel, pagesel, pagesel, 255)
-- frame[1]:toScreenFull(self.display_x + item.x, self.display_y + item.y, self.frames.w, self.frames.h, frame[2] * self.frames.rw, frame[3] * self.frames.rh, pagesel, pagesel, pagesel, 255)
UI
:
drawFrame
(
self
.
frames
.
base
,
self
.
display_x
+
item
.
x
,
self
.
display_y
+
item
.
y
,
frame
[
1
],
frame
[
2
],
frame
[
3
],
1
)
-- frame[1]:toScreenFull(self.display_x + item.x, self.display_y + item.y, self.frames.w, self.frames.h, frame[2] * self.frames.rw, frame[3] * self.frames.rh, pagesel, pagesel, pagesel, 255)
-- frame[1]:toScreenFull(self.display_x + item.x, self.display_y + item.y, self.frames.w, self.frames.h, frame[2] * self.frames.rw, frame[3] * self.frames.rh, pagesel, pagesel, pagesel, 255)
UI
:
drawFrame
(
self
.
frames
.
base
,
self
.
display_x
+
item
.
x
,
self
.
display_y
+
item
.
y
,
frame
[
1
],
frame
[
2
],
frame
[
3
],
1
)
if
self
.
shadow
then
if
shader
then
shader
:
use
(
true
)
shader
:
uniOutlineSize
(
0
.
7
,
0
.
7
)
shader
:
uniTextSize
(
key
.
_tex_w
,
key
.
_tex_h
)
else
key
.
_tex
:
toScreenFull
(
self
.
display_x
+
item
.
x
+
1
+
self
.
frames
.
fx
+
self
.
icon_w
-
key
.
w
,
self
.
display_y
+
item
.
y
+
1
+
self
.
icon_h
-
key
.
h
,
key
.
w
,
key
.
h
,
key
.
_tex_w
,
key
.
_tex_h
,
0
,
0
,
0
,
self
.
shadow
)
if
gtxt
then
gtxt
.
_tex
:
toScreenFull
(
self
.
display_x
+
item
.
x
+
self
.
frames
.
fy
+
2
+
(
self
.
icon_w
-
gtxt
.
fw
)
/
2
,
self
.
display_y
+
item
.
y
+
self
.
frames
.
fy
+
2
+
(
self
.
icon_h
-
gtxt
.
fh
)
/
2
,
gtxt
.
w
,
gtxt
.
h
,
gtxt
.
_tex_w
,
gtxt
.
_tex_h
,
0
,
0
,
0
,
self
.
shadow
)
end
if
self
.
shadow
then
if
shader
then
shader
:
use
(
true
)
shader
:
uniOutlineSize
(
0
.
7
,
0
.
7
)
shader
:
uniTextSize
(
key
.
_tex_w
,
key
.
_tex_h
)
else
key
.
_tex
:
toScreenFull
(
self
.
display_x
+
item
.
x
+
1
+
self
.
frames
.
fx
+
self
.
icon_w
-
key
.
w
,
self
.
display_y
+
item
.
y
+
1
+
self
.
icon_h
-
key
.
h
,
key
.
w
,
key
.
h
,
key
.
_tex_w
,
key
.
_tex_h
,
0
,
0
,
0
,
self
.
shadow
)
if
gtxt
then
gtxt
.
_tex
:
toScreenFull
(
self
.
display_x
+
item
.
x
+
self
.
frames
.
fy
+
2
+
(
self
.
icon_w
-
gtxt
.
fw
)
/
2
,
self
.
display_y
+
item
.
y
+
self
.
frames
.
fy
+
2
+
(
self
.
icon_h
-
gtxt
.
fh
)
/
2
,
gtxt
.
w
,
gtxt
.
h
,
gtxt
.
_tex_w
,
gtxt
.
_tex_h
,
0
,
0
,
0
,
self
.
shadow
)
end
end
end
end
key
.
_tex
:
toScreenFull
(
self
.
display_x
+
item
.
x
+
self
.
frames
.
fx
+
self
.
icon_w
-
key
.
w
,
self
.
display_y
+
item
.
y
+
self
.
icon_h
-
key
.
h
,
key
.
w
,
key
.
h
,
key
.
_tex_w
,
key
.
_tex_h
)
if
gtxt
then
gtxt
.
_tex
:
toScreenFull
(
self
.
display_x
+
item
.
x
+
self
.
frames
.
fx
+
(
self
.
icon_w
-
gtxt
.
fw
)
/
2
,
self
.
display_y
+
item
.
y
+
self
.
frames
.
fy
+
(
self
.
icon_h
-
gtxt
.
fh
)
/
2
,
gtxt
.
w
,
gtxt
.
h
,
gtxt
.
_tex_w
,
gtxt
.
_tex_h
)
end
key
.
_tex
:
toScreenFull
(
self
.
display_x
+
item
.
x
+
self
.
frames
.
fx
+
self
.
icon_w
-
key
.
w
,
self
.
display_y
+
item
.
y
+
self
.
icon_h
-
key
.
h
,
key
.
w
,
key
.
h
,
key
.
_tex_w
,
key
.
_tex_h
)
if
gtxt
then
gtxt
.
_tex
:
toScreenFull
(
self
.
display_x
+
item
.
x
+
self
.
frames
.
fx
+
(
self
.
icon_w
-
gtxt
.
fw
)
/
2
,
self
.
display_y
+
item
.
y
+
self
.
frames
.
fy
+
(
self
.
icon_h
-
gtxt
.
fh
)
/
2
,
gtxt
.
w
,
gtxt
.
h
,
gtxt
.
_tex_w
,
gtxt
.
_tex_h
)
end
if
self
.
shadow
and
shader
then
shader
:
use
(
false
)
end
if
self
.
shadow
and
shader
then
shader
:
use
(
false
)
end
end
end
end
...
...
@@ -326,10 +341,10 @@ function _M:onMouse(button, mx, my, click, on_over, on_click)
for
i
,
zone
in
pairs
(
self
.
clics
)
do
if
mx
>=
zone
[
1
]
and
mx
<
zone
[
1
]
+
zone
[
3
]
and
my
>=
zone
[
2
]
and
my
<
zone
[
2
]
+
zone
[
4
]
then
if
on_click
and
click
then
if
on_click
and
click
and
not
zone
.
fake
then
if
on_click
(
i
,
a
.
hotkey
[
i
])
then
click
=
false
end
end
if
button
==
"left"
then
if
button
==
"left"
and
not
zone
.
fake
then
if
click
then
a
:
activateHotkey
(
i
)
else
...
...
@@ -344,14 +359,14 @@ function _M:onMouse(button, mx, my, click, on_over, on_click)
game
.
mouse
:
startDrag
(
mx
,
my
,
s
,
{
kind
=
a
.
hotkey
[
i
][
1
],
id
=
a
.
hotkey
[
i
][
2
],
source_hotkey_slot
=
i
},
function
(
drag
,
used
)
if
not
used
then
self
.
actor
.
hotkey
[
i
]
=
nil
self
.
actor
.
changed
=
true
end
end
)
end
end
elseif
button
==
"right"
and
click
then
elseif
button
==
"right"
and
click
and
not
zone
.
fake
then
a
.
hotkey
[
i
]
=
nil
a
.
changed
=
true
else
a
.
changed
=
true
local
oldsel
=
self
.
cur_sel
self
.
cur_sel
=
i
if
on_over
and
self
.
cur_sel
~=
oldsel
then
if
on_over
and
self
.
cur_sel
~=
oldsel
and
not
zone
.
fake
then
local
text
=
""
if
a
.
hotkey
[
i
]
and
a
.
hotkey
[
i
][
1
]
==
"talent"
then
local
t
=
self
.
actor
:
getTalentFromId
(
a
.
hotkey
[
i
][
2
])
...
...
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