Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
R
rd-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
苍蓝
rd-ygopro
Commits
de985735
Commit
de985735
authored
Jun 28, 2017
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update OnCommonEvent and CHECKBOX_AUTO_SEARCH
parent
b4fc5160
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
95 additions
and
55 deletions
+95
-55
gframe/client_field.h
gframe/client_field.h
+1
-0
gframe/deck_con.cpp
gframe/deck_con.cpp
+2
-20
gframe/event_handler.cpp
gframe/event_handler.cpp
+88
-35
gframe/game.cpp
gframe/game.cpp
+3
-0
gframe/game.h
gframe/game.h
+1
-0
No files found.
gframe/client_field.h
View file @
de985735
...
...
@@ -130,6 +130,7 @@ public:
int
list_command
;
virtual
bool
OnEvent
(
const
irr
::
SEvent
&
event
);
virtual
bool
OnCommonEvent
(
const
irr
::
SEvent
&
event
);
void
GetHoverField
(
int
x
,
int
y
);
void
ShowMenu
(
int
flag
,
int
x
,
int
y
);
void
UpdateChainButtons
();
...
...
gframe/deck_con.cpp
View file @
de985735
...
...
@@ -99,6 +99,8 @@ void DeckBuilder::Terminate() {
mainGame
->
device
->
closeDevice
();
}
bool
DeckBuilder
::
OnEvent
(
const
irr
::
SEvent
&
event
)
{
if
(
mainGame
->
dField
.
OnCommonEvent
(
event
))
return
false
;
switch
(
event
.
EventType
)
{
case
irr
:
:
EET_GUI_EVENT
:
{
s32
id
=
event
.
GUIEvent
.
Caller
->
getID
();
...
...
@@ -305,14 +307,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
break
;
}
case
irr
:
:
gui
::
EGET_SCROLL_BAR_CHANGED
:
{
switch
(
id
)
{
case
SCROLL_CARDTEXT
:
{
u32
pos
=
mainGame
->
scrCardText
->
getPos
();
mainGame
->
SetStaticText
(
mainGame
->
stText
,
mainGame
->
stText
->
getRelativePosition
().
getWidth
()
-
25
,
mainGame
->
textFont
,
mainGame
->
showingtext
,
pos
);
break
;
}
break
;
}
}
case
irr
:
:
gui
::
EGET_EDITBOX_ENTER
:
{
switch
(
id
)
{
...
...
@@ -626,19 +621,6 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
break
;
}
case
irr
:
:
EET_KEY_INPUT_EVENT
:
{
switch
(
event
.
KeyInput
.
Key
)
{
case
irr
:
:
KEY_KEY_R
:
{
if
(
!
event
.
KeyInput
.
PressedDown
&&
!
mainGame
->
HasFocus
(
EGUIET_EDIT_BOX
))
mainGame
->
textFont
->
setTransparency
(
true
);
break
;
}
case
irr
:
:
KEY_ESCAPE
:
{
if
(
!
mainGame
->
HasFocus
(
EGUIET_EDIT_BOX
))
mainGame
->
device
->
minimizeWindow
();
break
;
}
default:
break
;
}
break
;
}
default:
break
;
...
...
gframe/event_handler.cpp
View file @
de985735
...
...
@@ -14,17 +14,14 @@
namespace
ygo
{
bool
ClientField
::
OnEvent
(
const
irr
::
SEvent
&
event
)
{
if
(
OnCommonEvent
(
event
))
return
false
;
switch
(
event
.
EventType
)
{
case
irr
:
:
EET_GUI_EVENT
:
{
s32
id
=
event
.
GUIEvent
.
Caller
->
getID
();
switch
(
event
.
GUIEvent
.
EventType
)
{
case
irr
:
:
gui
::
EGET_BUTTON_CLICKED
:
{
switch
(
id
)
{
case
BUTTON_CLEAR_LOG
:
{
mainGame
->
lstLog
->
clear
();
mainGame
->
logParam
.
clear
();
break
;
}
case
BUTTON_HAND1
:
case
BUTTON_HAND2
:
case
BUTTON_HAND3
:
{
...
...
@@ -896,13 +893,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
case
irr
:
:
gui
::
EGET_LISTBOX_CHANGED
:
{
switch
(
id
)
{
case
LISTBOX_LOG
:
{
int
sel
=
mainGame
->
lstLog
->
getSelected
();
if
(
sel
!=
-
1
&&
(
int
)
mainGame
->
logParam
.
size
()
>=
sel
&&
mainGame
->
logParam
[
sel
])
{
mainGame
->
ShowCardInfo
(
mainGame
->
logParam
[
sel
]);
}
break
;
}
case
LISTBOX_ANCARD
:
{
int
sel
=
mainGame
->
lstANCard
->
getSelected
();
if
(
sel
!=
-
1
)
{
...
...
@@ -913,18 +903,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
break
;
}
case
irr
:
:
gui
::
EGET_LISTBOX_SELECTED_AGAIN
:
{
switch
(
id
)
{
case
LISTBOX_LOG
:
{
int
sel
=
mainGame
->
lstLog
->
getSelected
();
if
(
sel
!=
-
1
&&
(
int
)
mainGame
->
logParam
.
size
()
>=
sel
&&
mainGame
->
logParam
[
sel
])
{
mainGame
->
wInfos
->
setActiveTab
(
0
);
}
break
;
}
}
break
;
}
case
irr
:
:
gui
::
EGET_SCROLL_BAR_CHANGED
:
{
switch
(
id
)
{
case
SCROLL_CARD_SELECT
:
{
...
...
@@ -1034,11 +1012,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
break
;
}
case
SCROLL_CARDTEXT
:
{
u32
pos
=
mainGame
->
scrCardText
->
getPos
();
mainGame
->
SetStaticText
(
mainGame
->
stText
,
mainGame
->
stText
->
getRelativePosition
().
getWidth
()
-
25
,
mainGame
->
textFont
,
mainGame
->
showingtext
,
pos
);
break
;
}
break
;
}
}
...
...
@@ -1893,12 +1866,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
break
;
}
case
irr
:
:
KEY_KEY_R
:
{
if
(
mainGame
->
gameConf
.
control_mode
==
0
&&
!
event
.
KeyInput
.
PressedDown
&&
!
mainGame
->
HasFocus
(
EGUIET_EDIT_BOX
))
mainGame
->
textFont
->
setTransparency
(
true
);
break
;
}
case
irr
:
:
KEY_F1
:
case
irr
:
:
KEY_F2
:
case
irr
:
:
KEY_F3
:
...
...
@@ -1970,15 +1937,101 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
break
;
}
default:
break
;
}
break
;
}
default:
break
;
}
return
false
;
}
bool
ClientField
::
OnCommonEvent
(
const
irr
::
SEvent
&
event
)
{
switch
(
event
.
EventType
)
{
case
irr
:
:
EET_GUI_EVENT
:
{
s32
id
=
event
.
GUIEvent
.
Caller
->
getID
();
switch
(
event
.
GUIEvent
.
EventType
)
{
case
irr
:
:
gui
::
EGET_BUTTON_CLICKED
:
{
switch
(
id
)
{
case
BUTTON_CLEAR_LOG
:
{
mainGame
->
lstLog
->
clear
();
mainGame
->
logParam
.
clear
();
return
true
;
break
;
}
}
break
;
}
case
irr
:
:
gui
::
EGET_CHECKBOX_CHANGED
:
{
switch
(
id
)
{
case
CHECKBOX_AUTO_SEARCH
:
{
mainGame
->
gameConf
.
auto_search_limit
=
mainGame
->
chkAutoSearch
->
isChecked
()
?
0
:
-
1
;
return
true
;
break
;
}
}
break
;
}
case
irr
:
:
gui
::
EGET_LISTBOX_CHANGED
:
{
switch
(
id
)
{
case
LISTBOX_LOG
:
{
int
sel
=
mainGame
->
lstLog
->
getSelected
();
if
(
sel
!=
-
1
&&
(
int
)
mainGame
->
logParam
.
size
()
>=
sel
&&
mainGame
->
logParam
[
sel
])
{
mainGame
->
ShowCardInfo
(
mainGame
->
logParam
[
sel
]);
}
return
true
;
break
;
}
}
break
;
}
case
irr
:
:
gui
::
EGET_LISTBOX_SELECTED_AGAIN
:
{
switch
(
id
)
{
case
LISTBOX_LOG
:
{
int
sel
=
mainGame
->
lstLog
->
getSelected
();
if
(
sel
!=
-
1
&&
(
int
)
mainGame
->
logParam
.
size
()
>=
sel
&&
mainGame
->
logParam
[
sel
])
{
mainGame
->
wInfos
->
setActiveTab
(
0
);
}
return
true
;
break
;
}
}
break
;
}
case
irr
:
:
gui
::
EGET_SCROLL_BAR_CHANGED
:
{
switch
(
id
)
{
case
SCROLL_CARDTEXT
:
{
u32
pos
=
mainGame
->
scrCardText
->
getPos
();
mainGame
->
SetStaticText
(
mainGame
->
stText
,
mainGame
->
stText
->
getRelativePosition
().
getWidth
()
-
25
,
mainGame
->
textFont
,
mainGame
->
showingtext
,
pos
);
return
true
;
break
;
}
}
break
;
}
default:
break
;
}
break
;
}
case
irr
:
:
EET_KEY_INPUT_EVENT
:
{
switch
(
event
.
KeyInput
.
Key
)
{
case
irr
:
:
KEY_KEY_R
:
{
if
(
mainGame
->
gameConf
.
control_mode
==
0
&&
!
event
.
KeyInput
.
PressedDown
&&
!
mainGame
->
HasFocus
(
EGUIET_EDIT_BOX
))
mainGame
->
textFont
->
setTransparency
(
true
);
return
true
;
break
;
}
case
irr
:
:
KEY_F9
:
{
if
(
mainGame
->
gameConf
.
control_mode
==
1
&&
!
event
.
KeyInput
.
PressedDown
&&
!
mainGame
->
HasFocus
(
EGUIET_EDIT_BOX
))
mainGame
->
textFont
->
setTransparency
(
true
);
return
true
;
break
;
}
case
irr
:
:
KEY_ESCAPE
:
{
if
(
!
mainGame
->
HasFocus
(
EGUIET_EDIT_BOX
))
mainGame
->
device
->
minimizeWindow
();
return
true
;
break
;
}
default:
break
;
...
...
gframe/game.cpp
View file @
de985735
...
...
@@ -271,6 +271,9 @@ bool Game::Initialize() {
posY
+=
30
;
chkIgnoreDeckChanges
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabSystem
,
-
1
,
dataManager
.
GetSysString
(
1357
));
chkIgnoreDeckChanges
->
setChecked
(
gameConf
.
chkIgnoreDeckChanges
!=
0
);
posY
+=
30
;
chkAutoSearch
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
225
,
posY
+
25
),
tabSystem
,
CHECKBOX_AUTO_SEARCH
,
dataManager
.
GetSysString
(
1358
));
chkAutoSearch
->
setChecked
(
gameConf
.
auto_search_limit
>=
0
);
//
wHand
=
env
->
addWindow
(
rect
<
s32
>
(
500
,
450
,
825
,
605
),
false
,
L""
);
wHand
->
getCloseButton
()
->
setVisible
(
false
);
...
...
gframe/game.h
View file @
de985735
...
...
@@ -551,6 +551,7 @@ extern Game* mainGame;
#define LISTBOX_SINGLEPLAY_LIST 350
#define BUTTON_LOAD_SINGLEPLAY 351
#define BUTTON_CANCEL_SINGLEPLAY 352
#define CHECKBOX_AUTO_SEARCH 360
#define COMBOBOX_SORTTYPE 370
#define BUTTON_MARKS_FILTER 380
...
...
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