Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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
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
MyCard
ygopro-2pick
Commits
6277eda1
Commit
6277eda1
authored
Mar 21, 2018
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'resize' into test
parents
f3b87ec8
c0226aa0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
14 deletions
+41
-14
gframe/event_handler.cpp
gframe/event_handler.cpp
+15
-14
gframe/game.cpp
gframe/game.cpp
+25
-0
gframe/game.h
gframe/game.h
+1
-0
No files found.
gframe/event_handler.cpp
View file @
6277eda1
...
...
@@ -2045,25 +2045,26 @@ void ClientField::ShowMenu(int flag, int x, int y) {
return
;
}
int
height
=
1
;
int
offset
=
(
mainGame
->
gameConf
.
resize_popup_menu
&&
mainGame
->
yScale
>=
0.666
)
?
21
*
mainGame
->
yScale
:
14
;
if
(
flag
&
COMMAND_ACTIVATE
)
{
mainGame
->
btnActivate
->
setVisible
(
true
);
mainGame
->
btnActivate
->
setRelativePosition
(
position2di
(
1
,
height
));
height
+=
21
;
height
+=
offset
;
}
else
mainGame
->
btnActivate
->
setVisible
(
false
);
if
(
flag
&
COMMAND_SUMMON
)
{
mainGame
->
btnSummon
->
setVisible
(
true
);
mainGame
->
btnSummon
->
setRelativePosition
(
position2di
(
1
,
height
));
height
+=
21
;
height
+=
offset
;
}
else
mainGame
->
btnSummon
->
setVisible
(
false
);
if
(
flag
&
COMMAND_SPSUMMON
)
{
mainGame
->
btnSPSummon
->
setVisible
(
true
);
mainGame
->
btnSPSummon
->
setRelativePosition
(
position2di
(
1
,
height
));
height
+=
21
;
height
+=
offset
;
}
else
mainGame
->
btnSPSummon
->
setVisible
(
false
);
if
(
flag
&
COMMAND_MSET
)
{
mainGame
->
btnMSet
->
setVisible
(
true
);
mainGame
->
btnMSet
->
setRelativePosition
(
position2di
(
1
,
height
));
height
+=
21
;
height
+=
offset
;
}
else
mainGame
->
btnMSet
->
setVisible
(
false
);
if
(
flag
&
COMMAND_SSET
)
{
if
(
!
(
clicked_card
->
type
&
TYPE_MONSTER
))
...
...
@@ -2072,7 +2073,7 @@ void ClientField::ShowMenu(int flag, int x, int y) {
mainGame
->
btnSSet
->
setText
(
dataManager
.
GetSysString
(
1159
));
mainGame
->
btnSSet
->
setVisible
(
true
);
mainGame
->
btnSSet
->
setRelativePosition
(
position2di
(
1
,
height
));
height
+=
21
;
height
+=
offset
;
}
else
mainGame
->
btnSSet
->
setVisible
(
false
);
if
(
flag
&
COMMAND_REPOS
)
{
if
(
clicked_card
->
position
&
POS_FACEDOWN
)
...
...
@@ -2083,34 +2084,34 @@ void ClientField::ShowMenu(int flag, int x, int y) {
mainGame
->
btnRepos
->
setText
(
dataManager
.
GetSysString
(
1156
));
mainGame
->
btnRepos
->
setVisible
(
true
);
mainGame
->
btnRepos
->
setRelativePosition
(
position2di
(
1
,
height
));
height
+=
21
;
height
+=
offset
;
}
else
mainGame
->
btnRepos
->
setVisible
(
false
);
if
(
flag
&
COMMAND_ATTACK
)
{
mainGame
->
btnAttack
->
setVisible
(
true
);
mainGame
->
btnAttack
->
setRelativePosition
(
position2di
(
1
,
height
));
height
+=
21
;
height
+=
offset
;
}
else
mainGame
->
btnAttack
->
setVisible
(
false
);
if
(
flag
&
COMMAND_LIST
)
{
mainGame
->
btnShowList
->
setVisible
(
true
);
mainGame
->
btnShowList
->
setRelativePosition
(
position2di
(
1
,
height
));
height
+=
21
;
height
+=
offset
;
}
else
mainGame
->
btnShowList
->
setVisible
(
false
);
if
(
flag
&
COMMAND_OPERATION
)
{
mainGame
->
btnOperation
->
setVisible
(
true
);
mainGame
->
btnOperation
->
setRelativePosition
(
position2di
(
1
,
height
));
height
+=
21
;
height
+=
offset
;
}
else
mainGame
->
btnOperation
->
setVisible
(
false
);
if
(
flag
&
COMMAND_RESET
)
{
mainGame
->
btnReset
->
setVisible
(
true
);
mainGame
->
btnReset
->
setRelativePosition
(
position2di
(
1
,
height
));
height
+=
21
;
height
+=
offset
;
}
else
mainGame
->
btnReset
->
setVisible
(
false
);
panel
=
mainGame
->
wCmdMenu
;
mainGame
->
wCmdMenu
->
setVisible
(
true
);
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
));
if
(
mainGame
->
gameConf
.
resize_popup_menu
)
mainGame
->
wCmdMenu
->
setRelativePosition
(
mainGame
->
Resize
(
x
-
20
,
y
-
20
,
x
+
80
,
y
-
20
,
0
,
-
height
,
0
,
0
))
;
else
mainGame
->
wCmdMenu
->
setRelativePosition
(
mainGame
->
Resize
(
x
,
y
,
x
,
y
,
-
20
,
-
(
20
+
height
),
80
,
-
20
));
}
void
ClientField
::
UpdateChainButtons
()
{
if
(
mainGame
->
btnChainAlways
->
isVisible
())
{
...
...
gframe/game.cpp
View file @
6277eda1
...
...
@@ -1081,6 +1081,12 @@ void Game::LoadConfig() {
gameConf
.
window_maximized
=
false
;
gameConf
.
window_width
=
1024
;
gameConf
.
window_height
=
640
;
gameConf
.
resize_popup_menu
=
true
;
gameConf
.
enable_sound
=
true
;
gameConf
.
sound_volume
=
0.5
;
gameConf
.
enable_music
=
true
;
gameConf
.
music_volume
=
0.5
;
gameConf
.
music_mode
=
1
;
while
(
fgets
(
linebuf
,
256
,
fp
))
{
sscanf
(
linebuf
,
"%s = %s"
,
strbuf
,
valbuf
);
if
(
!
strcmp
(
strbuf
,
"antialias"
))
{
...
...
@@ -1149,6 +1155,8 @@ void Game::LoadConfig() {
gameConf
.
window_width
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"window_height"
))
{
gameConf
.
window_height
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"resize_popup_menu"
))
{
gameConf
.
resize_popup_menu
=
atoi
(
valbuf
)
>
0
;
}
else
if
(
!
strcmp
(
strbuf
,
"enable_sound"
))
{
gameConf
.
enable_sound
=
atoi
(
valbuf
)
>
0
;
}
else
if
(
!
strcmp
(
strbuf
,
"sound_volume"
))
{
...
...
@@ -1529,6 +1537,23 @@ void Game::OnResize() {
wReplaySave
->
setRelativePosition
(
ResizeWin
(
510
,
200
,
820
,
320
));
stHintMsg
->
setRelativePosition
(
ResizeWin
(
500
,
60
,
820
,
90
));
if
(
gameConf
.
resize_popup_menu
)
{
int
width
=
100
*
mainGame
->
xScale
;
int
height
=
(
mainGame
->
yScale
>=
0.666
)
?
21
*
mainGame
->
yScale
:
14
;
wCmdMenu
->
setRelativePosition
(
recti
(
1
,
1
,
width
+
1
,
1
));
btnActivate
->
setRelativePosition
(
recti
(
1
,
1
,
width
,
height
));
btnSummon
->
setRelativePosition
(
recti
(
1
,
1
,
width
,
height
));
btnSPSummon
->
setRelativePosition
(
recti
(
1
,
1
,
width
,
height
));
btnMSet
->
setRelativePosition
(
recti
(
1
,
1
,
width
,
height
));
btnSSet
->
setRelativePosition
(
recti
(
1
,
1
,
width
,
height
));
btnRepos
->
setRelativePosition
(
recti
(
1
,
1
,
width
,
height
));
btnAttack
->
setRelativePosition
(
recti
(
1
,
1
,
width
,
height
));
btnActivate
->
setRelativePosition
(
recti
(
1
,
1
,
width
,
height
));
btnShowList
->
setRelativePosition
(
recti
(
1
,
1
,
width
,
height
));
btnOperation
->
setRelativePosition
(
recti
(
1
,
1
,
width
,
height
));
btnReset
->
setRelativePosition
(
recti
(
1
,
1
,
width
,
height
));
}
wCardImg
->
setRelativePosition
(
Resize
(
1
,
1
,
1
+
CARD_IMG_WIDTH
+
20
,
1
+
CARD_IMG_HEIGHT
+
18
));
imgCard
->
setRelativePosition
(
Resize
(
10
,
9
,
10
+
CARD_IMG_WIDTH
,
9
+
CARD_IMG_HEIGHT
));
wInfos
->
setRelativePosition
(
Resize
(
1
,
275
,
301
,
639
));
...
...
gframe/game.h
View file @
6277eda1
...
...
@@ -45,6 +45,7 @@ struct Config {
bool
window_maximized
;
int
window_width
;
int
window_height
;
bool
resize_popup_menu
;
bool
enable_sound
;
bool
enable_music
;
double
sound_volume
;
...
...
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