Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wyykak
ygopro
Commits
416a3123
Commit
416a3123
authored
Nov 21, 2016
by
edo9300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resizable game
parent
e41eaecb
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
439 additions
and
218 deletions
+439
-218
gframe/deck_con.cpp
gframe/deck_con.cpp
+6
-8
gframe/drawing.cpp
gframe/drawing.cpp
+203
-171
gframe/event_handler.cpp
gframe/event_handler.cpp
+16
-11
gframe/game.cpp
gframe/game.cpp
+193
-27
gframe/game.h
gframe/game.h
+21
-1
No files found.
gframe/deck_con.cpp
View file @
416a3123
...
...
@@ -646,12 +646,10 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
break
;
}
case
irr
:
:
EMIE_MOUSE_MOVED
:
{
int
x
=
event
.
MouseInput
.
X
;
int
y
=
event
.
MouseInput
.
Y
;
irr
::
core
::
position2di
mouse_pos
(
x
,
y
);
irr
::
gui
::
IGUIElement
*
root
=
mainGame
->
env
->
getRootGUIElement
();
if
(
root
->
getElementFromPoint
(
mouse_pos
)
!=
root
)
break
;
position2di
pos
=
mainGame
->
Resize
(
event
.
MouseInput
.
X
,
event
.
MouseInput
.
Y
,
true
);
position2di
mousepos
(
event
.
MouseInput
.
X
,
event
.
MouseInput
.
Y
);
s32
x
=
pos
.
X
;
s32
y
=
pos
.
Y
;
int
pre_code
=
hovered_code
;
if
(
x
>=
314
&&
x
<=
794
&&
y
>=
164
&&
y
<=
435
)
{
int
lx
=
10
,
px
,
py
=
(
y
-
164
)
/
68
;
...
...
@@ -710,8 +708,8 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
hovered_code
=
0
;
}
if
(
is_draging
)
{
dragx
=
x
;
dragy
=
y
;
dragx
=
mousepos
.
X
;
dragy
=
mousepos
.
Y
;
}
if
(
!
is_draging
&&
pre_code
!=
hovered_code
)
{
if
(
hovered_code
)
{
...
...
gframe/drawing.cpp
View file @
416a3123
This diff is collapsed.
Click to expand it.
gframe/event_handler.cpp
View file @
416a3123
...
...
@@ -1103,10 +1103,11 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
case
irr
:
:
EMIE_LMOUSE_LEFT_UP
:
{
if
(
!
mainGame
->
dInfo
.
isStarted
)
break
;
s32
x
=
event
.
MouseInput
.
X
;
s32
y
=
event
.
MouseInput
.
Y
;
hovered_location
=
0
;
irr
::
core
::
position2di
pos
(
x
,
y
);
position2di
pos
=
mainGame
->
Resize
(
event
.
MouseInput
.
X
,
event
.
MouseInput
.
Y
,
true
);
position2di
mousepos
(
event
.
MouseInput
.
X
,
event
.
MouseInput
.
Y
);
s32
x
=
pos
.
X
;
s32
y
=
pos
.
Y
;
if
(
x
<
300
)
break
;
if
(
mainGame
->
gameConf
.
control_mode
==
1
)
{
...
...
@@ -1115,7 +1116,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame
->
chain_when_avail
=
false
;
UpdateChainButtons
();
}
if
(
mainGame
->
wCmdMenu
->
isVisible
()
&&
!
mainGame
->
wCmdMenu
->
getRelativePosition
().
isPointInside
(
pos
))
if
(
mainGame
->
wCmdMenu
->
isVisible
()
&&
!
mainGame
->
wCmdMenu
->
getRelativePosition
().
isPointInside
(
mouse
pos
))
mainGame
->
wCmdMenu
->
setVisible
(
false
);
if
(
panel
&&
panel
->
isVisible
())
break
;
...
...
@@ -1630,9 +1631,10 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if
(
!
mainGame
->
dInfo
.
isStarted
)
break
;
bool
should_show_tip
=
false
;
s32
x
=
event
.
MouseInput
.
X
;
s32
y
=
event
.
MouseInput
.
Y
;
irr
::
core
::
position2di
pos
(
x
,
y
);
position2di
pos
=
mainGame
->
Resize
(
event
.
MouseInput
.
X
,
event
.
MouseInput
.
Y
,
true
);
position2di
mousepos
=
position2di
(
event
.
MouseInput
.
X
,
event
.
MouseInput
.
Y
);
s32
x
=
pos
.
X
;
s32
y
=
pos
.
Y
;
wchar_t
formatBuffer
[
2048
];
if
(
x
<
300
)
{
irr
::
gui
::
IGUIElement
*
root
=
mainGame
->
env
->
getRootGUIElement
();
...
...
@@ -1667,9 +1669,9 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if
(
deck
[
hovered_controler
].
size
())
mcard
=
deck
[
hovered_controler
].
back
();
}
else
{
if
(
irr
::
core
::
recti
(
327
,
8
,
630
,
51
).
isPointInside
(
pos
))
if
(
mainGame
->
Resize
(
327
,
8
,
630
,
51
).
isPointInside
(
mouse
pos
))
mplayer
=
0
;
else
if
(
irr
::
core
::
recti
(
689
,
8
,
991
,
51
).
isPointInside
(
pos
))
else
if
(
mainGame
->
Resize
(
689
,
8
,
991
,
51
).
isPointInside
(
mouse
pos
))
mplayer
=
1
;
}
}
...
...
@@ -1682,7 +1684,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if
(
mainGame
->
stTip
->
isVisible
())
{
should_show_tip
=
true
;
irr
::
core
::
recti
tpos
=
mainGame
->
stTip
->
getRelativePosition
();
mainGame
->
stTip
->
setRelativePosition
(
irr
::
core
::
position2di
(
x
-
tpos
.
getWidth
()
-
10
,
mcard
?
y
-
tpos
.
getHeight
()
-
10
:
y
+
10
));
mainGame
->
stTip
->
setRelativePosition
(
irr
::
core
::
position2di
(
mousepos
.
X
-
tpos
.
getWidth
()
-
10
,
mcard
?
mousepos
.
Y
-
tpos
.
getHeight
()
-
10
:
y
+
10
));
}
}
if
(
mcard
!=
hovered_card
)
{
...
...
@@ -2204,7 +2206,10 @@ void ClientField::ShowMenu(int flag, int x, int y) {
}
else
mainGame
->
btnReset
->
setVisible
(
false
);
panel
=
mainGame
->
wCmdMenu
;
mainGame
->
wCmdMenu
->
setVisible
(
true
);
mainGame
->
wCmdMenu
->
setRelativePosition
(
irr
::
core
::
recti
(
x
-
20
,
y
-
20
-
height
,
x
+
80
,
y
-
20
));
position2di
mouse
=
mainGame
->
Resize
(
x
,
y
);
x
=
mouse
.
X
;
y
=
mouse
.
Y
;
mainGame
->
wCmdMenu
->
setRelativePosition
(
irr
::
core
::
recti
(
x
-
20
,
y
-
20
-
height
,
x
+
80
,
y
-
20
));
}
void
ClientField
::
UpdateChainButtons
()
{
if
(
mainGame
->
btnChainAlways
->
isVisible
())
{
...
...
gframe/game.cpp
View file @
416a3123
This diff is collapsed.
Click to expand it.
gframe/game.h
View file @
416a3123
...
...
@@ -97,7 +97,7 @@ public:
void
HideElement
(
irr
::
gui
::
IGUIElement
*
element
,
bool
set_action
=
false
);
void
PopupElement
(
irr
::
gui
::
IGUIElement
*
element
,
int
hideframe
=
0
);
void
WaitFrameSignal
(
int
frame
);
void
DrawThumb
(
code_pointer
cp
,
position2di
pos
,
std
::
unordered_map
<
int
,
int
>*
lflist
);
void
DrawThumb
(
code_pointer
cp
,
position2di
pos
,
std
::
unordered_map
<
int
,
int
>*
lflist
,
bool
drag
=
false
);
void
DrawDeckBd
();
void
LoadConfig
();
void
SaveConfig
();
...
...
@@ -114,6 +114,13 @@ public:
return
focus
&&
focus
->
hasType
(
type
);
}
void
OnResize
();
recti
Resize
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
);
recti
Resize
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
,
s32
dx
,
s32
dy
,
s32
dx2
,
s32
dy2
);
position2di
Resize
(
s32
x
,
s32
y
,
bool
reverse
=
false
);
recti
ResizeElem
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
);
recti
ResizeWin
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
,
bool
chat
=
false
);
Mutex
gMutex
;
Mutex
gBuffer
;
Signal
frameSignal
;
...
...
@@ -159,6 +166,8 @@ public:
bool
is_building
;
bool
is_siding
;
irr
::
core
::
dimension2d
<
irr
::
u32
>
window_size
;
ClientField
dField
;
DeckBuilder
deckBuilder
;
MenuHandler
menuHandler
;
...
...
@@ -362,6 +371,17 @@ public:
irr
::
gui
::
IGUIButton
*
btnSaveDeckAs
;
irr
::
gui
::
IGUIButton
*
btnSideOK
;
irr
::
gui
::
IGUIEditBox
*
ebDeckname
;
irr
::
gui
::
IGUIStaticText
*
stBanlist
;
irr
::
gui
::
IGUIStaticText
*
stDeck
;
irr
::
gui
::
IGUIStaticText
*
stCategory
;
irr
::
gui
::
IGUIStaticText
*
stLimit
;
irr
::
gui
::
IGUIStaticText
*
stAttribute
;
irr
::
gui
::
IGUIStaticText
*
stRace
;
irr
::
gui
::
IGUIStaticText
*
stAttack
;
irr
::
gui
::
IGUIStaticText
*
stDefense
;
irr
::
gui
::
IGUIStaticText
*
stStar
;
irr
::
gui
::
IGUIStaticText
*
stSearch
;
irr
::
gui
::
IGUIStaticText
*
stScale
;
//filter
irr
::
gui
::
IGUIStaticText
*
wFilter
;
irr
::
gui
::
IGUIScrollBar
*
scrFilter
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment