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
147f455f
Commit
147f455f
authored
Jul 28, 2018
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'resize' into test
parents
0d5d8913
3614525f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
7 deletions
+62
-7
gframe/client_field.cpp
gframe/client_field.cpp
+3
-3
gframe/event_handler.cpp
gframe/event_handler.cpp
+22
-2
gframe/game.cpp
gframe/game.cpp
+23
-2
gframe/game.h
gframe/game.h
+9
-0
strings.conf
strings.conf
+5
-0
No files found.
gframe/client_field.cpp
View file @
147f455f
...
...
@@ -399,7 +399,7 @@ void ClientField::ShowSelectCard(bool buttonok, bool chain) {
else
if
(
conti_selecting
)
mainGame
->
imageLoading
.
insert
(
std
::
make_pair
(
mainGame
->
btnCardSelect
[
i
],
selectable_cards
[
i
]
->
chain_code
));
else
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
tCover
[
0
]);
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
tCover
[
0
]
,
rect
<
s32
>
(
0
,
0
,
CARD_IMG_WIDTH
,
CARD_IMG_HEIGHT
)
);
mainGame
->
btnCardSelect
[
i
]
->
setRelativePosition
(
rect
<
s32
>
(
startpos
+
i
*
125
,
55
,
startpos
+
120
+
i
*
125
,
225
));
mainGame
->
btnCardSelect
[
i
]
->
setPressed
(
false
);
mainGame
->
btnCardSelect
[
i
]
->
setVisible
(
true
);
...
...
@@ -483,7 +483,7 @@ void ClientField::ShowChainCard() {
if
(
selectable_cards
[
i
]
->
code
)
mainGame
->
imageLoading
.
insert
(
std
::
make_pair
(
mainGame
->
btnCardSelect
[
i
],
selectable_cards
[
i
]
->
code
));
else
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
tCover
[
0
]);
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
tCover
[
0
]
,
rect
<
s32
>
(
0
,
0
,
CARD_IMG_WIDTH
,
CARD_IMG_HEIGHT
)
);
mainGame
->
btnCardSelect
[
i
]
->
setRelativePosition
(
rect
<
s32
>
(
startpos
+
i
*
125
,
55
,
startpos
+
120
+
i
*
125
,
225
));
mainGame
->
btnCardSelect
[
i
]
->
setPressed
(
false
);
mainGame
->
btnCardSelect
[
i
]
->
setVisible
(
true
);
...
...
@@ -538,7 +538,7 @@ void ClientField::ShowLocationCard() {
if
(
display_cards
[
i
]
->
code
)
mainGame
->
imageLoading
.
insert
(
std
::
make_pair
(
mainGame
->
btnCardDisplay
[
i
],
display_cards
[
i
]
->
code
));
else
mainGame
->
btnCardDisplay
[
i
]
->
setImage
(
imageManager
.
tCover
[
0
]);
mainGame
->
btnCardDisplay
[
i
]
->
setImage
(
imageManager
.
tCover
[
0
]
,
rect
<
s32
>
(
0
,
0
,
CARD_IMG_WIDTH
,
CARD_IMG_HEIGHT
)
);
mainGame
->
btnCardDisplay
[
i
]
->
setRelativePosition
(
rect
<
s32
>
(
startpos
+
i
*
125
,
55
,
startpos
+
120
+
i
*
125
,
225
));
mainGame
->
btnCardDisplay
[
i
]
->
setPressed
(
false
);
mainGame
->
btnCardDisplay
[
i
]
->
setVisible
(
true
);
...
...
gframe/event_handler.cpp
View file @
147f455f
...
...
@@ -845,7 +845,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
else
if
(
conti_selecting
)
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
GetTexture
(
selectable_cards
[
i
+
pos
]
->
chain_code
));
else
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
tCover
[
0
]);
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
tCover
[
0
]
,
rect
<
s32
>
(
0
,
0
,
CARD_IMG_WIDTH
,
CARD_IMG_HEIGHT
)
);
mainGame
->
btnCardSelect
[
i
]
->
setRelativePosition
(
rect
<
s32
>
(
30
+
i
*
125
,
55
,
30
+
120
+
i
*
125
,
225
));
// text
wchar_t
formatBuffer
[
2048
];
...
...
@@ -906,7 +906,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if
(
display_cards
[
i
+
pos
]
->
code
)
mainGame
->
btnCardDisplay
[
i
]
->
setImage
(
imageManager
.
GetTexture
(
display_cards
[
i
+
pos
]
->
code
));
else
mainGame
->
btnCardDisplay
[
i
]
->
setImage
(
imageManager
.
tCover
[
0
]);
mainGame
->
btnCardDisplay
[
i
]
->
setImage
(
imageManager
.
tCover
[
0
]
,
rect
<
s32
>
(
0
,
0
,
CARD_IMG_WIDTH
,
CARD_IMG_HEIGHT
)
);
mainGame
->
btnCardDisplay
[
i
]
->
setRelativePosition
(
rect
<
s32
>
(
30
+
i
*
125
,
55
,
30
+
120
+
i
*
125
,
225
));
wchar_t
formatBuffer
[
2048
];
if
(
display_cards
[
i
+
pos
]
->
location
==
LOCATION_OVERLAY
)
{
...
...
@@ -1776,6 +1776,26 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
return
true
;
break
;
}
case
BUTTON_WINDOW_RESIZE_S
:
{
mainGame
->
SetWindowsScale
(
0.8
);
return
true
;
break
;
}
case
BUTTON_WINDOW_RESIZE_M
:
{
mainGame
->
SetWindowsScale
(
1
);
return
true
;
break
;
}
case
BUTTON_WINDOW_RESIZE_L
:
{
mainGame
->
SetWindowsScale
(
1.25
);
return
true
;
break
;
}
case
BUTTON_WINDOW_RESIZE_XL
:
{
mainGame
->
SetWindowsScale
(
1.5
);
return
true
;
break
;
}
}
break
;
}
...
...
gframe/game.cpp
View file @
147f455f
...
...
@@ -314,6 +314,12 @@ bool Game::Initialize() {
chkAutoSearch
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabSystem
,
CHECKBOX_AUTO_SEARCH
,
dataManager
.
GetSysString
(
1358
));
chkAutoSearch
->
setChecked
(
gameConf
.
auto_search_limit
>=
0
);
posY
+=
30
;
env
->
addStaticText
(
dataManager
.
GetSysString
(
1282
),
rect
<
s32
>
(
posX
+
23
,
posY
+
3
,
posX
+
120
,
posY
+
28
),
false
,
false
,
tabSystem
);
btnWinResizeS
=
env
->
addButton
(
rect
<
s32
>
(
posX
+
125
,
posY
,
posX
+
155
,
posY
+
25
),
tabSystem
,
BUTTON_WINDOW_RESIZE_S
,
dataManager
.
GetSysString
(
1283
));
btnWinResizeM
=
env
->
addButton
(
rect
<
s32
>
(
posX
+
160
,
posY
,
posX
+
190
,
posY
+
25
),
tabSystem
,
BUTTON_WINDOW_RESIZE_M
,
dataManager
.
GetSysString
(
1284
));
btnWinResizeL
=
env
->
addButton
(
rect
<
s32
>
(
posX
+
195
,
posY
,
posX
+
225
,
posY
+
25
),
tabSystem
,
BUTTON_WINDOW_RESIZE_L
,
dataManager
.
GetSysString
(
1285
));
btnWinResizeXL
=
env
->
addButton
(
rect
<
s32
>
(
posX
+
230
,
posY
,
posX
+
260
,
posY
+
25
),
tabSystem
,
BUTTON_WINDOW_RESIZE_XL
,
dataManager
.
GetSysString
(
1286
));
posY
+=
30
;
chkEnableSound
=
env
->
addCheckBox
(
gameConf
.
enable_sound
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
120
,
posY
+
25
),
tabSystem
,
-
1
,
dataManager
.
GetSysString
(
1279
));
chkEnableSound
->
setChecked
(
gameConf
.
enable_sound
);
scrSoundVolume
=
env
->
addScrollBar
(
true
,
rect
<
s32
>
(
posX
+
126
,
posY
+
4
,
posX
+
260
,
posY
+
21
),
tabSystem
,
SCROLL_VOLUME
);
...
...
@@ -1624,8 +1630,8 @@ void Game::OnResize() {
stHintMsg
->
setRelativePosition
(
ResizeWin
(
500
,
60
,
820
,
90
));
//sound / music volume bar
scrSoundVolume
->
setRelativePosition
(
recti
(
20
+
126
,
2
00
+
4
,
20
+
(
300
*
xScale
)
-
40
,
20
0
+
21
));
scrMusicVolume
->
setRelativePosition
(
recti
(
20
+
126
,
2
30
+
4
,
20
+
(
300
*
xScale
)
-
40
,
23
0
+
21
));
scrSoundVolume
->
setRelativePosition
(
recti
(
20
+
126
,
2
30
+
4
,
20
+
(
300
*
xScale
)
-
40
,
23
0
+
21
));
scrMusicVolume
->
setRelativePosition
(
recti
(
20
+
126
,
2
60
+
4
,
20
+
(
300
*
xScale
)
-
40
,
26
0
+
21
));
if
(
gameConf
.
resize_popup_menu
)
{
int
width
=
100
*
mainGame
->
xScale
;
...
...
@@ -1789,6 +1795,21 @@ void Game::SetWindowsIcon() {
SendMessageW
(
hWnd
,
WM_SETICON
,
ICON_BIG
,
(
long
)
hBigIcon
);
#endif
}
void
Game
::
SetWindowsScale
(
float
scale
)
{
#ifdef _WIN32
WINDOWPLACEMENT
plc
;
plc
.
length
=
sizeof
(
WINDOWPLACEMENT
);
if
(
GetWindowPlacement
(
hWnd
,
&
plc
)
&&
(
plc
.
showCmd
==
SW_SHOWMAXIMIZED
))
ShowWindow
(
hWnd
,
SW_RESTORE
);
RECT
rcWindow
,
rcClient
;
GetWindowRect
(
hWnd
,
&
rcWindow
);
GetClientRect
(
hWnd
,
&
rcClient
);
MoveWindow
(
hWnd
,
rcWindow
.
left
,
rcWindow
.
top
,
(
rcWindow
.
right
-
rcWindow
.
left
)
-
rcClient
.
right
+
1024
*
scale
,
(
rcWindow
.
bottom
-
rcWindow
.
top
)
-
rcClient
.
bottom
+
640
*
scale
,
true
);
#endif
}
void
Game
::
FlashWindow
()
{
#ifdef _WIN32
FLASHWINFO
fi
;
...
...
gframe/game.h
View file @
147f455f
...
...
@@ -166,6 +166,7 @@ public:
recti
ResizeFit
(
s32
x
,
s32
y
,
s32
x2
,
s32
y2
);
void
SetWindowsIcon
();
void
SetWindowsScale
(
float
scale
);
void
FlashWindow
();
void
SetCursor
(
ECURSOR_ICON
icon
);
...
...
@@ -272,6 +273,10 @@ public:
irr
::
gui
::
IGUIScrollBar
*
scrSoundVolume
;
irr
::
gui
::
IGUIScrollBar
*
scrMusicVolume
;
irr
::
gui
::
IGUICheckBox
*
chkMusicMode
;
irr
::
gui
::
IGUIButton
*
btnWinResizeS
;
irr
::
gui
::
IGUIButton
*
btnWinResizeM
;
irr
::
gui
::
IGUIButton
*
btnWinResizeL
;
irr
::
gui
::
IGUIButton
*
btnWinResizeXL
;
//main menu
irr
::
gui
::
IGUIWindow
*
wMainMenu
;
irr
::
gui
::
IGUIButton
*
btnLanMode
;
...
...
@@ -652,6 +657,10 @@ extern Game* mainGame;
#define CHECKBOX_ENABLE_MUSIC 362
#define SCROLL_VOLUME 363
#define CHECKBOX_DISABLE_CHAT 364
#define BUTTON_WINDOW_RESIZE_S 365
#define BUTTON_WINDOW_RESIZE_M 366
#define BUTTON_WINDOW_RESIZE_L 367
#define BUTTON_WINDOW_RESIZE_XL 368
#define COMBOBOX_SORTTYPE 370
#define COMBOBOX_LIMIT 371
...
...
strings.conf
View file @
147f455f
...
...
@@ -308,6 +308,11 @@
!
system
1279
开启音效
!
system
1280
开启音乐
!
system
1281
按场景切换音乐
!
system
1282
窗口大小
!
system
1283
小
!
system
1284
中
!
system
1285
大
!
system
1286
特大
!
system
1290
禁用聊天功能
!
system
1291
忽略观战者发言
!
system
1292
忽略时点
...
...
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