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
da8e4cd0
Commit
da8e4cd0
authored
Oct 27, 2018
by
mercury233
Committed by
GitHub
Oct 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add settings scrollbar (#18)
parent
60dcb295
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
82 additions
and
17 deletions
+82
-17
gframe/event_handler.cpp
gframe/event_handler.cpp
+12
-0
gframe/game.cpp
gframe/game.cpp
+59
-14
gframe/game.h
gframe/game.h
+11
-3
No files found.
gframe/event_handler.cpp
View file @
da8e4cd0
...
...
@@ -1884,6 +1884,18 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
return
true
;
break
;
}
case
SCROLL_TAB_HELPER
:
{
rect
<
s32
>
pos
=
mainGame
->
tabHelper
->
getRelativePosition
();
mainGame
->
tabHelper
->
setRelativePosition
(
recti
(
0
,
mainGame
->
scrTabHelper
->
getPos
()
*
-
1
,
pos
.
LowerRightCorner
.
X
,
pos
.
LowerRightCorner
.
Y
));
return
true
;
break
;
}
case
SCROLL_TAB_SYSTEM
:
{
rect
<
s32
>
pos
=
mainGame
->
tabSystem
->
getRelativePosition
();
mainGame
->
tabSystem
->
setRelativePosition
(
recti
(
0
,
mainGame
->
scrTabSystem
->
getPos
()
*
-
1
,
pos
.
LowerRightCorner
.
X
,
pos
.
LowerRightCorner
.
Y
));
return
true
;
break
;
}
}
break
;
}
...
...
gframe/game.cpp
View file @
da8e4cd0
...
...
@@ -249,14 +249,24 @@ bool Game::Initialize() {
scrCardText
->
setSmallStep
(
1
);
scrCardText
->
setVisible
(
false
);
//log
irr
::
gui
::
IGUITab
*
tabLog
=
wInfos
->
addTab
(
dataManager
.
GetSysString
(
1271
));
irr
::
gui
::
IGUITab
*
tabLog
=
wInfos
->
addTab
(
dataManager
.
GetSysString
(
1271
));
lstLog
=
env
->
addListBox
(
rect
<
s32
>
(
10
,
10
,
290
,
290
),
tabLog
,
LISTBOX_LOG
,
false
);
lstLog
->
setItemHeight
(
18
);
btnClearLog
=
env
->
addButton
(
rect
<
s32
>
(
160
,
300
,
260
,
325
),
tabLog
,
BUTTON_CLEAR_LOG
,
dataManager
.
GetSysString
(
1272
));
//helper
irr
::
gui
::
IGUITab
*
tabHelper
=
wInfos
->
addTab
(
dataManager
.
GetSysString
(
1298
));
int
posX
=
20
;
int
posY
=
20
;
irr
::
gui
::
IGUITab
*
_tabHelper
=
wInfos
->
addTab
(
dataManager
.
GetSysString
(
1298
));
_tabHelper
->
setRelativePosition
(
recti
(
16
,
49
,
299
,
362
));
tabHelper
=
env
->
addWindow
(
recti
(
0
,
0
,
250
,
300
),
false
,
L""
,
_tabHelper
);
tabHelper
->
setDrawTitlebar
(
false
);
tabHelper
->
getCloseButton
()
->
setVisible
(
false
);
tabHelper
->
setDrawBackground
(
false
);
tabHelper
->
setDraggable
(
false
);
scrTabHelper
=
env
->
addScrollBar
(
false
,
rect
<
s32
>
(
252
,
0
,
272
,
300
),
_tabHelper
,
SCROLL_TAB_HELPER
);
scrTabHelper
->
setLargeStep
(
1
);
scrTabHelper
->
setSmallStep
(
1
);
scrTabHelper
->
setVisible
(
false
);
int
posX
=
0
;
int
posY
=
0
;
chkMAutoPos
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabHelper
,
-
1
,
dataManager
.
GetSysString
(
1274
));
chkMAutoPos
->
setChecked
(
gameConf
.
chkMAutoPos
!=
0
);
posY
+=
30
;
...
...
@@ -274,9 +284,20 @@ bool Game::Initialize() {
posY
+=
30
;
chkQuickAnimation
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabHelper
,
CHECKBOX_QUICK_ANIMATION
,
dataManager
.
GetSysString
(
1299
));
chkQuickAnimation
->
setChecked
(
gameConf
.
quick_animation
!=
0
);
elmTabHelperLast
=
chkQuickAnimation
;
//system
irr
::
gui
::
IGUITab
*
tabSystem
=
wInfos
->
addTab
(
dataManager
.
GetSysString
(
1273
));
posY
=
20
;
irr
::
gui
::
IGUITab
*
_tabSystem
=
wInfos
->
addTab
(
dataManager
.
GetSysString
(
1273
));
_tabSystem
->
setRelativePosition
(
recti
(
16
,
49
,
299
,
362
));
tabSystem
=
env
->
addWindow
(
recti
(
0
,
0
,
250
,
300
),
false
,
L""
,
_tabSystem
);
tabSystem
->
setDrawTitlebar
(
false
);
tabSystem
->
getCloseButton
()
->
setVisible
(
false
);
tabSystem
->
setDrawBackground
(
false
);
tabSystem
->
setDraggable
(
false
);
scrTabSystem
=
env
->
addScrollBar
(
false
,
rect
<
s32
>
(
252
,
0
,
272
,
300
),
_tabSystem
,
SCROLL_TAB_SYSTEM
);
scrTabSystem
->
setLargeStep
(
1
);
scrTabSystem
->
setSmallStep
(
1
);
scrTabSystem
->
setVisible
(
false
);
posY
=
0
;
chkIgnore1
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabSystem
,
CHECKBOX_DISABLE_CHAT
,
dataManager
.
GetSysString
(
1290
));
chkIgnore1
->
setChecked
(
gameConf
.
chkIgnore1
!=
0
);
posY
+=
30
;
...
...
@@ -296,14 +317,14 @@ bool Game::Initialize() {
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
+
1
25
,
posY
,
posX
+
15
5
,
posY
+
25
),
tabSystem
,
BUTTON_WINDOW_RESIZE_S
,
dataManager
.
GetSysString
(
1283
));
btnWinResizeM
=
env
->
addButton
(
rect
<
s32
>
(
posX
+
1
60
,
posY
,
posX
+
19
0
,
posY
+
25
),
tabSystem
,
BUTTON_WINDOW_RESIZE_M
,
dataManager
.
GetSysString
(
1284
));
btnWinResizeL
=
env
->
addButton
(
rect
<
s32
>
(
posX
+
1
95
,
posY
,
posX
+
22
5
,
posY
+
25
),
tabSystem
,
BUTTON_WINDOW_RESIZE_L
,
dataManager
.
GetSysString
(
1285
));
btnWinResizeXL
=
env
->
addButton
(
rect
<
s32
>
(
posX
+
2
30
,
posY
,
posX
+
26
0
,
posY
+
25
),
tabSystem
,
BUTTON_WINDOW_RESIZE_XL
,
dataManager
.
GetSysString
(
1286
));
btnWinResizeS
=
env
->
addButton
(
rect
<
s32
>
(
posX
+
1
15
,
posY
,
posX
+
14
5
,
posY
+
25
),
tabSystem
,
BUTTON_WINDOW_RESIZE_S
,
dataManager
.
GetSysString
(
1283
));
btnWinResizeM
=
env
->
addButton
(
rect
<
s32
>
(
posX
+
1
50
,
posY
,
posX
+
18
0
,
posY
+
25
),
tabSystem
,
BUTTON_WINDOW_RESIZE_M
,
dataManager
.
GetSysString
(
1284
));
btnWinResizeL
=
env
->
addButton
(
rect
<
s32
>
(
posX
+
1
85
,
posY
,
posX
+
21
5
,
posY
+
25
),
tabSystem
,
BUTTON_WINDOW_RESIZE_L
,
dataManager
.
GetSysString
(
1285
));
btnWinResizeXL
=
env
->
addButton
(
rect
<
s32
>
(
posX
+
2
20
,
posY
,
posX
+
25
0
,
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
+
1
26
,
posY
+
4
,
posX
+
26
0
,
posY
+
21
),
tabSystem
,
SCROLL_VOLUME
);
scrSoundVolume
=
env
->
addScrollBar
(
true
,
rect
<
s32
>
(
posX
+
1
16
,
posY
+
4
,
posX
+
25
0
,
posY
+
21
),
tabSystem
,
SCROLL_VOLUME
);
scrSoundVolume
->
setMax
(
100
);
scrSoundVolume
->
setMin
(
0
);
scrSoundVolume
->
setPos
(
gameConf
.
sound_volume
*
100
);
...
...
@@ -312,7 +333,7 @@ bool Game::Initialize() {
posY
+=
30
;
chkEnableMusic
=
env
->
addCheckBox
(
gameConf
.
enable_music
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
120
,
posY
+
25
),
tabSystem
,
CHECKBOX_ENABLE_MUSIC
,
dataManager
.
GetSysString
(
1280
));
chkEnableMusic
->
setChecked
(
gameConf
.
enable_music
);
scrMusicVolume
=
env
->
addScrollBar
(
true
,
rect
<
s32
>
(
posX
+
1
26
,
posY
+
4
,
posX
+
26
0
,
posY
+
21
),
tabSystem
,
SCROLL_VOLUME
);
scrMusicVolume
=
env
->
addScrollBar
(
true
,
rect
<
s32
>
(
posX
+
1
16
,
posY
+
4
,
posX
+
25
0
,
posY
+
21
),
tabSystem
,
SCROLL_VOLUME
);
scrMusicVolume
->
setMax
(
100
);
scrMusicVolume
->
setMin
(
0
);
scrMusicVolume
->
setPos
(
gameConf
.
music_volume
*
100
);
...
...
@@ -321,6 +342,7 @@ bool Game::Initialize() {
posY
+=
30
;
chkMusicMode
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabSystem
,
-
1
,
dataManager
.
GetSysString
(
1281
));
chkMusicMode
->
setChecked
(
gameConf
.
music_mode
!=
0
);
elmTabSystemLast
=
chkMusicMode
;
//
wHand
=
env
->
addWindow
(
rect
<
s32
>
(
500
,
450
,
825
,
605
),
false
,
L""
);
wHand
->
getCloseButton
()
->
setVisible
(
false
);
...
...
@@ -1629,8 +1651,31 @@ void Game::OnResize() {
stHintMsg
->
setRelativePosition
(
ResizeWin
(
500
,
60
,
820
,
90
));
//sound / music volume bar
scrSoundVolume
->
setRelativePosition
(
recti
(
20
+
126
,
230
+
4
,
20
+
(
300
*
xScale
)
-
40
,
230
+
21
));
scrMusicVolume
->
setRelativePosition
(
recti
(
20
+
126
,
260
+
4
,
20
+
(
300
*
xScale
)
-
40
,
260
+
21
));
scrSoundVolume
->
setRelativePosition
(
recti
(
scrSoundVolume
->
getRelativePosition
().
UpperLeftCorner
.
X
,
scrSoundVolume
->
getRelativePosition
().
UpperLeftCorner
.
Y
,
20
+
(
300
*
xScale
)
-
70
,
scrSoundVolume
->
getRelativePosition
().
LowerRightCorner
.
Y
));
scrMusicVolume
->
setRelativePosition
(
recti
(
scrMusicVolume
->
getRelativePosition
().
UpperLeftCorner
.
X
,
scrMusicVolume
->
getRelativePosition
().
UpperLeftCorner
.
Y
,
20
+
(
300
*
xScale
)
-
70
,
scrMusicVolume
->
getRelativePosition
().
LowerRightCorner
.
Y
));
recti
tabHelperPos
=
recti
(
0
,
0
,
300
*
xScale
-
50
,
365
*
yScale
-
65
);
tabHelper
->
setRelativePosition
(
tabHelperPos
);
scrTabHelper
->
setRelativePosition
(
recti
(
tabHelperPos
.
LowerRightCorner
.
X
+
2
,
0
,
tabHelperPos
.
LowerRightCorner
.
X
+
22
,
tabHelperPos
.
LowerRightCorner
.
Y
));
s32
tabHelperLastY
=
elmTabHelperLast
->
getRelativePosition
().
LowerRightCorner
.
Y
;
if
(
tabHelperLastY
>
tabHelperPos
.
LowerRightCorner
.
Y
)
{
scrTabHelper
->
setMax
(
tabHelperLastY
-
tabHelperPos
.
LowerRightCorner
.
Y
+
5
);
scrTabHelper
->
setPos
(
0
);
scrTabHelper
->
setVisible
(
true
);
}
else
scrTabHelper
->
setVisible
(
false
);
recti
tabSystemPos
=
recti
(
0
,
0
,
300
*
xScale
-
50
,
365
*
yScale
-
65
);
tabSystem
->
setRelativePosition
(
tabSystemPos
);
scrTabSystem
->
setRelativePosition
(
recti
(
tabSystemPos
.
LowerRightCorner
.
X
+
2
,
0
,
tabSystemPos
.
LowerRightCorner
.
X
+
22
,
tabSystemPos
.
LowerRightCorner
.
Y
));
s32
tabSystemLastY
=
elmTabSystemLast
->
getRelativePosition
().
LowerRightCorner
.
Y
;
if
(
tabSystemLastY
>
tabSystemPos
.
LowerRightCorner
.
Y
)
{
scrTabSystem
->
setMax
(
tabSystemLastY
-
tabSystemPos
.
LowerRightCorner
.
Y
+
5
);
scrTabSystem
->
setPos
(
0
);
scrTabSystem
->
setVisible
(
true
);
}
else
scrTabSystem
->
setVisible
(
false
);
if
(
gameConf
.
resize_popup_menu
)
{
int
width
=
100
*
mainGame
->
xScale
;
...
...
gframe/game.h
View file @
da8e4cd0
...
...
@@ -262,12 +262,18 @@ public:
irr
::
gui
::
IGUIListBox
*
lstLog
;
irr
::
gui
::
IGUIButton
*
btnClearLog
;
irr
::
gui
::
IGUIButton
*
btnSaveLog
;
irr
::
gui
::
IGUIWindow
*
tabHelper
;
irr
::
gui
::
IGUIElement
*
elmTabHelperLast
;
irr
::
gui
::
IGUIScrollBar
*
scrTabHelper
;
irr
::
gui
::
IGUICheckBox
*
chkMAutoPos
;
irr
::
gui
::
IGUICheckBox
*
chkSTAutoPos
;
irr
::
gui
::
IGUICheckBox
*
chkRandomPos
;
irr
::
gui
::
IGUICheckBox
*
chkAutoChain
;
irr
::
gui
::
IGUICheckBox
*
chkWaitChain
;
irr
::
gui
::
IGUICheckBox
*
chkQuickAnimation
;
irr
::
gui
::
IGUIWindow
*
tabSystem
;
irr
::
gui
::
IGUIElement
*
elmTabSystemLast
;
irr
::
gui
::
IGUIScrollBar
*
scrTabSystem
;
irr
::
gui
::
IGUICheckBox
*
chkHideSetname
;
irr
::
gui
::
IGUICheckBox
*
chkHideHintButton
;
irr
::
gui
::
IGUICheckBox
*
chkIgnoreDeckChanges
;
...
...
@@ -659,9 +665,11 @@ extern Game* mainGame;
#define BUTTON_BOT_START 340
#define LISTBOX_BOT_LIST 341
#define CHECKBOX_BOT_OLD_RULE 342
#define LISTBOX_SINGLEPLAY_LIST 350
#define BUTTON_LOAD_SINGLEPLAY 351
#define BUTTON_CANCEL_SINGLEPLAY 352
#define LISTBOX_SINGLEPLAY_LIST 343
#define BUTTON_LOAD_SINGLEPLAY 344
#define BUTTON_CANCEL_SINGLEPLAY 345
#define SCROLL_TAB_HELPER 350
#define SCROLL_TAB_SYSTEM 351
#define CHECKBOX_AUTO_SEARCH 360
#define CHECKBOX_ENABLE_SOUND 361
#define CHECKBOX_ENABLE_MUSIC 362
...
...
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