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
nanahira
ygopro
Commits
0687e441
Commit
0687e441
authored
Mar 20, 2018
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remember window size
parent
1b117f0e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletion
+29
-1
gframe/game.cpp
gframe/game.cpp
+26
-1
gframe/game.h
gframe/game.h
+3
-0
No files found.
gframe/game.cpp
View file @
0687e441
...
...
@@ -29,7 +29,7 @@ bool Game::Initialize() {
params
.
DriverType
=
irr
::
video
::
EDT_DIRECT3D9
;
else
params
.
DriverType
=
irr
::
video
::
EDT_OPENGL
;
params
.
WindowSize
=
irr
::
core
::
dimension2d
<
u32
>
(
1024
,
640
);
params
.
WindowSize
=
irr
::
core
::
dimension2d
<
u32
>
(
gameConf
.
window_width
,
gameConf
.
window_height
);
device
=
irr
::
createDeviceEx
(
params
);
if
(
!
device
)
return
false
;
...
...
@@ -70,6 +70,8 @@ bool Game::Initialize() {
smgr
=
device
->
getSceneManager
();
device
->
setWindowCaption
(
L"YGOPro"
);
device
->
setResizable
(
true
);
if
(
gameConf
.
window_maximized
)
device
->
maximizeWindow
();
#ifdef _WIN32
irr
::
video
::
SExposedVideoData
exposedData
=
driver
->
getExposedVideoData
();
if
(
gameConf
.
use_d3d
)
...
...
@@ -1009,6 +1011,9 @@ void Game::LoadConfig() {
gameConf
.
chkIgnoreDeckChanges
=
0
;
gameConf
.
defaultOT
=
1
;
gameConf
.
enable_bot_mode
=
0
;
gameConf
.
window_maximized
=
false
;
gameConf
.
window_width
=
1024
;
gameConf
.
window_height
=
640
;
while
(
fgets
(
linebuf
,
256
,
fp
))
{
sscanf
(
linebuf
,
"%s = %s"
,
strbuf
,
valbuf
);
if
(
!
strcmp
(
strbuf
,
"antialias"
))
{
...
...
@@ -1071,6 +1076,12 @@ void Game::LoadConfig() {
gameConf
.
defaultOT
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"enable_bot_mode"
))
{
gameConf
.
enable_bot_mode
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"window_maximized"
))
{
gameConf
.
window_maximized
=
atoi
(
valbuf
)
>
0
;
}
else
if
(
!
strcmp
(
strbuf
,
"window_width"
))
{
gameConf
.
window_width
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"window_height"
))
{
gameConf
.
window_height
=
atoi
(
valbuf
);
}
else
{
// options allowing multiple words
sscanf
(
linebuf
,
"%s = %240[^
\n
]"
,
strbuf
,
valbuf
);
...
...
@@ -1131,6 +1142,9 @@ void Game::SaveConfig() {
fprintf
(
fp
,
"ignore_deck_changes = %d
\n
"
,
(
chkIgnoreDeckChanges
->
isChecked
()
?
1
:
0
));
fprintf
(
fp
,
"default_ot = %d
\n
"
,
gameConf
.
defaultOT
);
fprintf
(
fp
,
"enable_bot_mode = %d
\n
"
,
gameConf
.
enable_bot_mode
);
fprintf
(
fp
,
"window_maximized = %d
\n
"
,
(
gameConf
.
window_maximized
?
1
:
0
));
fprintf
(
fp
,
"window_width = %d
\n
"
,
gameConf
.
window_width
);
fprintf
(
fp
,
"window_height = %d
\n
"
,
gameConf
.
window_height
);
fclose
(
fp
);
}
void
Game
::
ShowCardInfo
(
int
code
)
{
...
...
@@ -1329,6 +1343,17 @@ const wchar_t* Game::LocalName(int local_player) {
return
local_player
==
0
?
dInfo
.
hostname
:
dInfo
.
clientname
;
}
void
Game
::
OnResize
()
{
#ifdef _WIN32
WINDOWPLACEMENT
plc
;
plc
.
length
=
sizeof
(
WINDOWPLACEMENT
);
if
(
GetWindowPlacement
(
hWnd
,
&
plc
))
gameConf
.
window_maximized
=
(
plc
.
showCmd
==
SW_SHOWMAXIMIZED
);
#endif // _WIN32
if
(
!
gameConf
.
window_maximized
)
{
gameConf
.
window_width
=
window_size
.
Width
;
gameConf
.
window_height
=
window_size
.
Height
;
}
wMainMenu
->
setRelativePosition
(
ResizeWin
(
370
,
200
,
650
,
415
));
wDeckEdit
->
setRelativePosition
(
Resize
(
309
,
8
,
605
,
130
));
cbDBLFList
->
setRelativePosition
(
Resize
(
80
,
5
,
220
,
30
));
...
...
gframe/game.h
View file @
0687e441
...
...
@@ -42,6 +42,9 @@ struct Config {
int
chkIgnoreDeckChanges
;
int
defaultOT
;
int
enable_bot_mode
;
bool
window_maximized
;
int
window_width
;
int
window_height
;
};
struct
DuelInfo
{
...
...
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