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
REIKAI
ygopro
Commits
80794910
Commit
80794910
authored
Aug 14, 2018
by
edo9300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated select option quick to allow more than 5 choices
parent
341744e1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
28 deletions
+36
-28
gframe/client_field.cpp
gframe/client_field.cpp
+15
-7
gframe/event_handler.cpp
gframe/event_handler.cpp
+15
-21
gframe/game.cpp
gframe/game.cpp
+4
-0
gframe/game.h
gframe/game.h
+2
-0
No files found.
gframe/client_field.cpp
View file @
80794910
...
@@ -599,26 +599,34 @@ void ClientField::ShowSelectOption(int select_hint) {
...
@@ -599,26 +599,34 @@ 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
;
//
(count <= 5);
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
)
{
irr
::
core
::
dimension2d
<
unsigned
int
>
dtxt
=
mainGame
->
guiFont
->
getDimension
(
option
);
if
(
dtxt
.
Width
>
310
)
{
quickmode
=
false
;
quickmode
=
false
;
break
;
break
;
}
}
}
for
(
int
i
=
0
;
(
i
<
count
)
&&
quickmode
;
i
++
)
{
const
wchar_t
*
option
=
dataManager
.
GetDesc
(
select_options
[
i
]);
mainGame
->
btnOption
[
i
]
->
setText
(
option
);
mainGame
->
btnOption
[
i
]
->
setText
(
option
);
}
}
recti
pos
=
mainGame
->
wOptions
->
getRelativePosition
();
if
(
count
>
5
&&
quickmode
)
pos
.
LowerRightCorner
.
X
=
pos
.
UpperLeftCorner
.
X
+
375
;
else
pos
.
LowerRightCorner
.
X
=
pos
.
UpperLeftCorner
.
X
+
350
;
if
(
quickmode
)
{
if
(
quickmode
)
{
mainGame
->
scrOption
->
setVisible
(
count
>
5
);
mainGame
->
scrOption
->
setPos
(
0
);
mainGame
->
scrOption
->
setMax
(
count
-
5
);
mainGame
->
stOptions
->
setVisible
(
false
);
mainGame
->
stOptions
->
setVisible
(
false
);
mainGame
->
btnOptionp
->
setVisible
(
false
);
mainGame
->
btnOptionp
->
setVisible
(
false
);
mainGame
->
btnOptionn
->
setVisible
(
false
);
mainGame
->
btnOptionn
->
setVisible
(
false
);
mainGame
->
btnOptionOK
->
setVisible
(
false
);
mainGame
->
btnOptionOK
->
setVisible
(
false
);
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
();
int
newheight
=
30
+
40
*
((
count
>
5
)
?
5
:
count
);
int
newheight
=
30
+
40
*
count
;
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
.
Y
=
pos
.
UpperLeftCorner
.
Y
+
newheight
;
pos
.
LowerRightCorner
.
Y
=
pos
.
UpperLeftCorner
.
Y
+
newheight
;
...
...
gframe/event_handler.cpp
View file @
80794910
...
@@ -266,28 +266,13 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -266,28 +266,13 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame
->
SetStaticText
(
mainGame
->
stOptions
,
310
,
mainGame
->
textFont
,
(
wchar_t
*
)
dataManager
.
GetDesc
(
select_options
[
selected_option
]));
mainGame
->
SetStaticText
(
mainGame
->
stOptions
,
310
,
mainGame
->
textFont
,
(
wchar_t
*
)
dataManager
.
GetDesc
(
select_options
[
selected_option
]));
break
;
break
;
}
}
case
BUTTON_OPTION_0
:
{
case
BUTTON_OPTION_0
:
selected_option
=
0
;
case
BUTTON_OPTION_1
:
SetResponseSelectedOption
();
case
BUTTON_OPTION_2
:
break
;
case
BUTTON_OPTION_3
:
}
case
BUTTON_OPTION_1
:
{
selected_option
=
1
;
SetResponseSelectedOption
();
break
;
}
case
BUTTON_OPTION_2
:
{
selected_option
=
2
;
SetResponseSelectedOption
();
break
;
}
case
BUTTON_OPTION_3
:
{
selected_option
=
3
;
SetResponseSelectedOption
();
break
;
}
case
BUTTON_OPTION_4
:
{
case
BUTTON_OPTION_4
:
{
selected_option
=
4
;
int
step
=
mainGame
->
scrOption
->
isVisible
()
?
mainGame
->
scrOption
->
getPos
()
:
0
;
selected_option
=
id
-
BUTTON_OPTION_0
+
step
;
SetResponseSelectedOption
();
SetResponseSelectedOption
();
break
;
break
;
}
}
...
@@ -823,6 +808,15 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -823,6 +808,15 @@ 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
)
{
...
...
gframe/game.cpp
View file @
80794910
...
@@ -395,6 +395,10 @@ bool Game::Initialize() {
...
@@ -395,6 +395,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
,
30
+
40
*
i
,
340
,
60
+
40
*
i
),
wOptions
,
BUTTON_OPTION_0
+
i
,
L""
);
btnOption
[
i
]
=
env
->
addButton
(
rect
<
s32
>
(
10
,
30
+
40
*
i
,
340
,
60
+
40
*
i
),
wOptions
,
BUTTON_OPTION_0
+
i
,
L""
);
}
}
scrOption
=
env
->
addScrollBar
(
false
,
rect
<
s32
>
(
350
,
30
,
365
,
220
),
wOptions
,
SCROLL_OPTION_SELECT
);
scrOption
->
setLargeStep
(
1
);
scrOption
->
setSmallStep
(
1
);
mainGame
->
scrOption
->
setMin
(
0
);
//pos select
//pos select
wPosSelect
=
env
->
addWindow
(
rect
<
s32
>
(
340
,
200
,
935
,
410
),
false
,
dataManager
.
GetSysString
(
561
));
wPosSelect
=
env
->
addWindow
(
rect
<
s32
>
(
340
,
200
,
935
,
410
),
false
,
dataManager
.
GetSysString
(
561
));
wPosSelect
->
getCloseButton
()
->
setVisible
(
false
);
wPosSelect
->
getCloseButton
()
->
setVisible
(
false
);
...
...
gframe/game.h
View file @
80794910
...
@@ -362,6 +362,7 @@ public:
...
@@ -362,6 +362,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
;
...
@@ -588,6 +589,7 @@ extern Game* mainGame;
...
@@ -588,6 +589,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