Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
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
fallenstardust
YGOMobile
Commits
1da07da0
Commit
1da07da0
authored
Apr 20, 2019
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add option scroll bar
parent
02051ea4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
34 deletions
+41
-34
Classes/gframe/client_field.cpp
Classes/gframe/client_field.cpp
+14
-8
Classes/gframe/deck_con.cpp
Classes/gframe/deck_con.cpp
+6
-0
Classes/gframe/event_handler.cpp
Classes/gframe/event_handler.cpp
+15
-26
Classes/gframe/game.cpp
Classes/gframe/game.cpp
+4
-0
Classes/gframe/game.h
Classes/gframe/game.h
+2
-0
No files found.
Classes/gframe/client_field.cpp
View file @
1da07da0
...
@@ -405,7 +405,7 @@ void ClientField::ShowSelectCard(bool buttonok, bool chain) {
...
@@ -405,7 +405,7 @@ void ClientField::ShowSelectCard(bool buttonok, bool chain) {
else
if
(
conti_selecting
)
else
if
(
conti_selecting
)
mainGame
->
imageLoading
.
insert
(
std
::
make_pair
(
mainGame
->
btnCardSelect
[
i
],
selectable_cards
[
i
]
->
chain_code
));
mainGame
->
imageLoading
.
insert
(
std
::
make_pair
(
mainGame
->
btnCardSelect
[
i
],
selectable_cards
[
i
]
->
chain_code
));
else
else
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
tCover
[
selectable_cards
[
i
]
->
controler
]);
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
tCover
[
selectable_cards
[
i
]
->
controler
+
2
]);
mainGame
->
btnCardSelect
[
i
]
->
setRelativePosition
(
rect
<
s32
>
((
startpos
+
i
*
125
)
*
mainGame
->
xScale
,
55
*
mainGame
->
yScale
,
(
startpos
+
120
+
i
*
125
)
*
mainGame
->
xScale
,
225
*
mainGame
->
yScale
));
mainGame
->
btnCardSelect
[
i
]
->
setRelativePosition
(
rect
<
s32
>
((
startpos
+
i
*
125
)
*
mainGame
->
xScale
,
55
*
mainGame
->
yScale
,
(
startpos
+
120
+
i
*
125
)
*
mainGame
->
xScale
,
225
*
mainGame
->
yScale
));
mainGame
->
btnCardSelect
[
i
]
->
setPressed
(
false
);
mainGame
->
btnCardSelect
[
i
]
->
setPressed
(
false
);
mainGame
->
btnCardSelect
[
i
]
->
setVisible
(
true
);
mainGame
->
btnCardSelect
[
i
]
->
setVisible
(
true
);
...
@@ -600,18 +600,23 @@ void ClientField::ShowSelectOption(int select_hint) {
...
@@ -600,18 +600,23 @@ void ClientField::ShowSelectOption(int select_hint) {
selected_option
=
0
;
selected_option
=
0
;
wchar_t
textBuffer
[
256
];
wchar_t
textBuffer
[
256
];
int
count
=
select_options
.
size
();
int
count
=
select_options
.
size
();
bool
quickmode
=
(
count
<=
5
)
;
bool
quickmode
=
true
;
mainGame
->
gMutex
.
Lock
();
mainGame
->
gMutex
.
Lock
();
for
(
int
i
=
0
;
(
i
<
count
)
&&
quickmode
;
i
++
)
{
for
(
auto
option
:
select_options
)
{
const
wchar_t
*
option
=
dataManager
.
GetDesc
(
select_options
[
i
]);
if
(
mainGame
->
guiFont
->
getDimension
(
dataManager
.
GetDesc
(
option
)).
Width
>
310
*
mainGame
->
xScale
)
{
irr
::
core
::
dimension2d
<
unsigned
int
>
dtxt
=
mainGame
->
guiFont
->
getDimension
(
option
);
if
(
dtxt
.
Width
>
310
*
mainGame
->
xScale
)
{
quickmode
=
false
;
quickmode
=
false
;
break
;
break
;
}
}
}
for
(
int
i
=
0
;
(
i
<
count
)
&&
(
i
<
5
)
&&
quickmode
;
i
++
)
{
const
wchar_t
*
option
=
dataManager
.
GetDesc
(
select_options
[
i
]);
mainGame
->
btnOption
[
i
]
->
setText
(
option
);
mainGame
->
btnOption
[
i
]
->
setText
(
option
);
}
}
if
(
quickmode
)
{
if
(
quickmode
)
{
bool
scrollbar
=
count
>
5
;
mainGame
->
scrOption
->
setVisible
(
scrollbar
);
mainGame
->
scrOption
->
setPos
(
0
);
mainGame
->
scrOption
->
setMax
(
scrollbar
?
(
count
-
5
)
:
1
);
mainGame
->
stOptions
->
setVisible
(
false
);
mainGame
->
stOptions
->
setVisible
(
false
);
mainGame
->
btnOptionp
->
setVisible
(
false
);
mainGame
->
btnOptionp
->
setVisible
(
false
);
mainGame
->
btnOptionn
->
setVisible
(
false
);
mainGame
->
btnOptionn
->
setVisible
(
false
);
...
@@ -619,9 +624,10 @@ void ClientField::ShowSelectOption(int select_hint) {
...
@@ -619,9 +624,10 @@ void ClientField::ShowSelectOption(int select_hint) {
for
(
int
i
=
0
;
i
<
5
;
i
++
)
for
(
int
i
=
0
;
i
<
5
;
i
++
)
mainGame
->
btnOption
[
i
]
->
setVisible
(
i
<
count
);
mainGame
->
btnOption
[
i
]
->
setVisible
(
i
<
count
);
recti
pos
=
mainGame
->
wOptions
->
getRelativePosition
();
recti
pos
=
mainGame
->
wOptions
->
getRelativePosition
();
int
newheight
=
(
30
+
60
*
count
)
*
mainGame
->
yScale
;
int
newheight
=
30
+
40
*
(
scrollbar
?
5
:
count
)
*
mainGame
->
yScale
;
int
oldheight
=
pos
.
LowerRightCorner
.
Y
-
pos
.
UpperLeftCorner
.
Y
;
int
oldheight
=
pos
.
LowerRightCorner
.
Y
-
pos
.
UpperLeftCorner
.
Y
;
pos
.
UpperLeftCorner
.
Y
=
pos
.
UpperLeftCorner
.
Y
+
(
oldheight
-
newheight
)
/
2
;
pos
.
UpperLeftCorner
.
Y
=
pos
.
UpperLeftCorner
.
Y
+
(
oldheight
-
newheight
)
/
2
;
pos
.
LowerRightCorner
.
X
=
pos
.
UpperLeftCorner
.
X
+
(
scrollbar
?
375
:
350
);
pos
.
LowerRightCorner
.
Y
=
pos
.
UpperLeftCorner
.
Y
+
newheight
;
pos
.
LowerRightCorner
.
Y
=
pos
.
UpperLeftCorner
.
Y
+
newheight
;
mainGame
->
wOptions
->
setRelativePosition
(
pos
);
mainGame
->
wOptions
->
setRelativePosition
(
pos
);
}
else
{
}
else
{
...
@@ -634,7 +640,7 @@ void ClientField::ShowSelectOption(int select_hint) {
...
@@ -634,7 +640,7 @@ void ClientField::ShowSelectOption(int select_hint) {
for
(
int
i
=
0
;
i
<
5
;
i
++
)
for
(
int
i
=
0
;
i
<
5
;
i
++
)
mainGame
->
btnOption
[
i
]
->
setVisible
(
false
);
mainGame
->
btnOption
[
i
]
->
setVisible
(
false
);
recti
pos
=
mainGame
->
wOptions
->
getRelativePosition
();
recti
pos
=
mainGame
->
wOptions
->
getRelativePosition
();
pos
.
LowerRightCorner
.
Y
=
((
pos
.
UpperLeftCorner
.
Y
/
mainGame
->
yScale
)
+
180
)
*
mainGame
->
yScale
;
pos
.
LowerRightCorner
.
Y
=
pos
.
UpperLeftCorner
.
Y
+
140
*
mainGame
->
yScale
;
mainGame
->
wOptions
->
setRelativePosition
(
pos
);
mainGame
->
wOptions
->
setRelativePosition
(
pos
);
}
}
if
(
select_hint
)
if
(
select_hint
)
...
...
Classes/gframe/deck_con.cpp
View file @
1da07da0
...
@@ -398,6 +398,12 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
...
@@ -398,6 +398,12 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
break
;
break
;
}
}
case
irr
:
:
gui
::
EGET_SCROLL_BAR_CHANGED
:
{
case
irr
:
:
gui
::
EGET_SCROLL_BAR_CHANGED
:
{
switch
(
id
)
{
case
SCROLL_FILTER
:
{
GetHoveredCard
();
break
;
}
}
break
;
break
;
}
}
case
irr
:
:
gui
::
EGET_EDITBOX_ENTER
:
{
case
irr
:
:
gui
::
EGET_EDITBOX_ENTER
:
{
...
...
Classes/gframe/event_handler.cpp
View file @
1da07da0
...
@@ -300,33 +300,14 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -300,33 +300,14 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame
->
SetStaticText
(
mainGame
->
stOptions
,
310
*
mainGame
->
xScale
,
mainGame
->
textFont
,
dataManager
.
GetDesc
(
select_options
[
selected_option
]));
mainGame
->
SetStaticText
(
mainGame
->
stOptions
,
310
*
mainGame
->
xScale
,
mainGame
->
textFont
,
dataManager
.
GetDesc
(
select_options
[
selected_option
]));
break
;
break
;
}
}
case
BUTTON_OPTION_0
:
{
case
BUTTON_OPTION_0
:
mainGame
->
soundEffectPlayer
->
doPressButton
();
case
BUTTON_OPTION_1
:
selected_option
=
0
;
case
BUTTON_OPTION_2
:
SetResponseSelectedOption
();
case
BUTTON_OPTION_3
:
break
;
}
case
BUTTON_OPTION_1
:
{
mainGame
->
soundEffectPlayer
->
doPressButton
();
selected_option
=
1
;
SetResponseSelectedOption
();
break
;
}
case
BUTTON_OPTION_2
:
{
mainGame
->
soundEffectPlayer
->
doPressButton
();
selected_option
=
2
;
SetResponseSelectedOption
();
break
;
}
case
BUTTON_OPTION_3
:
{
mainGame
->
soundEffectPlayer
->
doPressButton
();
selected_option
=
3
;
SetResponseSelectedOption
();
break
;
}
case
BUTTON_OPTION_4
:
{
case
BUTTON_OPTION_4
:
{
mainGame
->
soundEffectPlayer
->
doPressButton
();
mainGame
->
soundEffectPlayer
->
doPressButton
();
selected_option
=
4
;
int
step
=
mainGame
->
scrOption
->
isVisible
()
?
mainGame
->
scrOption
->
getPos
()
:
0
;
selected_option
=
id
-
BUTTON_OPTION_0
+
step
;
SetResponseSelectedOption
();
SetResponseSelectedOption
();
break
;
break
;
}
}
...
@@ -859,6 +840,14 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -859,6 +840,14 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
}
case
irr
:
:
gui
::
EGET_SCROLL_BAR_CHANGED
:
{
case
irr
:
:
gui
::
EGET_SCROLL_BAR_CHANGED
:
{
switch
(
id
)
{
switch
(
id
)
{
case
SCROLL_OPTION_SELECT
:
{
int
step
=
mainGame
->
scrOption
->
isVisible
()
?
mainGame
->
scrOption
->
getPos
()
:
0
;
for
(
int
i
=
0
;
i
<
5
;
i
++
)
{
const
wchar_t
*
option
=
dataManager
.
GetDesc
(
select_options
[
i
+
step
]);
mainGame
->
btnOption
[
i
]
->
setText
(
option
);
}
break
;
}
case
SCROLL_CARD_SELECT
:
{
case
SCROLL_CARD_SELECT
:
{
int
pos
=
mainGame
->
scrCardList
->
getPos
()
/
10
;
int
pos
=
mainGame
->
scrCardList
->
getPos
()
/
10
;
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
...
@@ -870,7 +859,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -870,7 +859,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
else
if
(
conti_selecting
)
else
if
(
conti_selecting
)
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
GetTexture
(
selectable_cards
[
i
+
pos
]
->
chain_code
));
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
GetTexture
(
selectable_cards
[
i
+
pos
]
->
chain_code
));
else
else
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
tCover
[
selectable_cards
[
i
+
pos
]
->
controler
]);
mainGame
->
btnCardSelect
[
i
]
->
setImage
(
imageManager
.
tCover
[
selectable_cards
[
i
+
pos
]
->
controler
+
2
]);
mainGame
->
btnCardSelect
[
i
]
->
setRelativePosition
(
rect
<
s32
>
((
30
+
i
*
125
)
*
mainGame
->
xScale
,
55
*
mainGame
->
xScale
,
(
30
+
120
+
i
*
125
)
*
mainGame
->
xScale
,
225
*
mainGame
->
yScale
));
mainGame
->
btnCardSelect
[
i
]
->
setRelativePosition
(
rect
<
s32
>
((
30
+
i
*
125
)
*
mainGame
->
xScale
,
55
*
mainGame
->
xScale
,
(
30
+
120
+
i
*
125
)
*
mainGame
->
xScale
,
225
*
mainGame
->
yScale
));
// text
// text
wchar_t
formatBuffer
[
2048
];
wchar_t
formatBuffer
[
2048
];
...
...
Classes/gframe/game.cpp
View file @
1da07da0
...
@@ -568,6 +568,10 @@ bool Game::Initialize() {
...
@@ -568,6 +568,10 @@ bool Game::Initialize() {
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
btnOption
[
i
]
=
env
->
addButton
(
rect
<
s32
>
(
10
*
xScale
,
(
30
+
60
*
i
)
*
yScale
,
380
*
xScale
,
(
80
+
60
*
i
)
*
yScale
),
wOptions
,
BUTTON_OPTION_0
+
i
,
L""
);
btnOption
[
i
]
=
env
->
addButton
(
rect
<
s32
>
(
10
*
xScale
,
(
30
+
60
*
i
)
*
yScale
,
380
*
xScale
,
(
80
+
60
*
i
)
*
yScale
),
wOptions
,
BUTTON_OPTION_0
+
i
,
L""
);
}
}
scrOption
=
env
->
addScrollBar
(
false
,
rect
<
s32
>
(
350
*
xScale
,
30
*
yScale
,
365
*
xScale
,
220
*
yScale
),
wOptions
,
SCROLL_OPTION_SELECT
);
scrOption
->
setLargeStep
(
1
);
scrOption
->
setSmallStep
(
1
);
scrOption
->
setMin
(
0
);
#endif
#endif
//pos selectimgCard->setScaleImage(true);
//pos selectimgCard->setScaleImage(true);
wPosSelect
=
env
->
addWindow
(
rect
<
s32
>
(
340
*
xScale
,
200
*
yScale
,
935
*
xScale
,
410
*
yScale
),
false
,
dataManager
.
GetSysString
(
561
));
wPosSelect
=
env
->
addWindow
(
rect
<
s32
>
(
340
*
xScale
,
200
*
yScale
,
935
*
xScale
,
410
*
yScale
),
false
,
dataManager
.
GetSysString
(
561
));
...
...
Classes/gframe/game.h
View file @
1da07da0
...
@@ -361,6 +361,7 @@ public:
...
@@ -361,6 +361,7 @@ public:
irr
::
gui
::
IGUIButton
*
btnOptionn
;
irr
::
gui
::
IGUIButton
*
btnOptionn
;
irr
::
gui
::
IGUIButton
*
btnOptionOK
;
irr
::
gui
::
IGUIButton
*
btnOptionOK
;
irr
::
gui
::
IGUIButton
*
btnOption
[
5
];
irr
::
gui
::
IGUIButton
*
btnOption
[
5
];
irr
::
gui
::
IGUIScrollBar
*
scrOption
;
//pos selection
//pos selection
irr
::
gui
::
IGUIWindow
*
wPosSelect
;
irr
::
gui
::
IGUIWindow
*
wPosSelect
;
irr
::
gui
::
CGUIImageButton
*
btnPSAU
;
irr
::
gui
::
CGUIImageButton
*
btnPSAU
;
...
@@ -577,6 +578,7 @@ extern Game* mainGame;
...
@@ -577,6 +578,7 @@ extern Game* mainGame;
#define BUTTON_OPTION_2 225
#define BUTTON_OPTION_2 225
#define BUTTON_OPTION_3 226
#define BUTTON_OPTION_3 226
#define BUTTON_OPTION_4 227
#define BUTTON_OPTION_4 227
#define SCROLL_OPTION_SELECT 228
#define BUTTON_CARD_0 230
#define BUTTON_CARD_0 230
#define BUTTON_CARD_1 231
#define BUTTON_CARD_1 231
#define BUTTON_CARD_2 232
#define BUTTON_CARD_2 232
...
...
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