Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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
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
MyCard
ygopro-2pick
Commits
6dee40b8
Commit
6dee40b8
authored
Apr 19, 2018
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update OnCommonEvent, fix chat before duel
parent
efd82e8c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
67 deletions
+26
-67
gframe/event_handler.cpp
gframe/event_handler.cpp
+24
-14
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+2
-53
No files found.
gframe/event_handler.cpp
View file @
6dee40b8
...
...
@@ -956,18 +956,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
UpdateDeclarableCode
(
true
);
break
;
}
case
EDITBOX_CHAT
:
{
if
(
mainGame
->
dInfo
.
isReplay
)
break
;
const
wchar_t
*
input
=
mainGame
->
ebChatInput
->
getText
();
if
(
input
[
0
])
{
unsigned
short
msgbuf
[
256
];
int
len
=
BufferIO
::
CopyWStr
(
input
,
msgbuf
,
256
);
DuelClient
::
SendBufferToServer
(
CTOS_CHAT
,
msgbuf
,
(
len
+
1
)
*
sizeof
(
short
));
mainGame
->
ebChatInput
->
setText
(
L""
);
}
break
;
}
}
break
;
}
...
...
@@ -1758,13 +1746,17 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
s32
id
=
event
.
GUIEvent
.
Caller
->
getID
();
switch
(
event
.
GUIEvent
.
EventType
)
{
case
irr
:
:
gui
::
EGET_ELEMENT_HOVERED
:
{
if
(
event
.
GUIEvent
.
Caller
->
getType
()
==
EGUIET_EDIT_BOX
)
if
(
event
.
GUIEvent
.
Caller
->
getType
()
==
EGUIET_EDIT_BOX
)
{
mainGame
->
SetCursor
(
event
.
GUIEvent
.
Caller
->
isEnabled
()
?
ECI_IBEAM
:
ECI_NORMAL
);
return
true
;
}
break
;
}
case
irr
:
:
gui
::
EGET_ELEMENT_LEFT
:
{
if
(
event
.
GUIEvent
.
Caller
->
getType
()
==
EGUIET_EDIT_BOX
)
if
(
event
.
GUIEvent
.
Caller
->
getType
()
==
EGUIET_EDIT_BOX
)
{
mainGame
->
SetCursor
(
ECI_NORMAL
);
return
true
;
}
break
;
}
case
irr
:
:
gui
::
EGET_BUTTON_CLICKED
:
{
...
...
@@ -1844,6 +1836,24 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
}
break
;
}
case
irr
:
:
gui
::
EGET_EDITBOX_ENTER
:
{
switch
(
id
)
{
case
EDITBOX_CHAT
:
{
if
(
mainGame
->
dInfo
.
isReplay
)
break
;
const
wchar_t
*
input
=
mainGame
->
ebChatInput
->
getText
();
if
(
input
[
0
])
{
unsigned
short
msgbuf
[
256
];
int
len
=
BufferIO
::
CopyWStr
(
input
,
msgbuf
,
256
);
DuelClient
::
SendBufferToServer
(
CTOS_CHAT
,
msgbuf
,
(
len
+
1
)
*
sizeof
(
short
));
mainGame
->
ebChatInput
->
setText
(
L""
);
return
true
;
}
break
;
}
}
break
;
}
default:
break
;
}
break
;
...
...
gframe/menu_handler.cpp
View file @
6dee40b8
...
...
@@ -27,6 +27,8 @@ void UpdateDeck() {
DuelClient
::
SendBufferToServer
(
CTOS_UPDATE_DECK
,
deckbuf
,
pdeck
-
deckbuf
);
}
bool
MenuHandler
::
OnEvent
(
const
irr
::
SEvent
&
event
)
{
if
(
mainGame
->
dField
.
OnCommonEvent
(
event
))
return
false
;
switch
(
event
.
EventType
)
{
case
irr
:
:
EET_GUI_EVENT
:
{
irr
::
gui
::
IGUIElement
*
caller
=
event
.
GUIEvent
.
Caller
;
...
...
@@ -40,16 +42,6 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
break
;
}
switch
(
event
.
GUIEvent
.
EventType
)
{
case
irr
:
:
gui
::
EGET_ELEMENT_HOVERED
:
{
if
(
event
.
GUIEvent
.
Caller
->
getType
()
==
EGUIET_EDIT_BOX
)
mainGame
->
SetCursor
(
event
.
GUIEvent
.
Caller
->
isEnabled
()
?
ECI_IBEAM
:
ECI_NORMAL
);
break
;
}
case
irr
:
:
gui
::
EGET_ELEMENT_LEFT
:
{
if
(
event
.
GUIEvent
.
Caller
->
getType
()
==
EGUIET_EDIT_BOX
)
mainGame
->
SetCursor
(
ECI_NORMAL
);
break
;
}
case
irr
:
:
gui
::
EGET_BUTTON_CLICKED
:
{
if
(
id
<
110
)
soundManager
.
PlaySoundEffect
(
SOUND_MENU
);
...
...
@@ -509,49 +501,6 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
}
break
;
}
case
irr
:
:
gui
::
EGET_EDITBOX_ENTER
:
{
switch
(
id
)
{
case
EDITBOX_CHAT
:
{
if
(
mainGame
->
dInfo
.
isReplay
)
break
;
const
wchar_t
*
input
=
mainGame
->
ebChatInput
->
getText
();
if
(
input
[
0
])
{
unsigned
short
msgbuf
[
256
];
if
(
mainGame
->
dInfo
.
isStarted
)
{
if
(
mainGame
->
dInfo
.
player_type
<
7
)
{
if
(
mainGame
->
dInfo
.
isTag
&&
(
mainGame
->
dInfo
.
player_type
%
2
))
mainGame
->
AddChatMsg
((
wchar_t
*
)
input
,
2
);
else
mainGame
->
AddChatMsg
((
wchar_t
*
)
input
,
0
);
}
else
mainGame
->
AddChatMsg
((
wchar_t
*
)
input
,
10
);
}
else
mainGame
->
AddChatMsg
((
wchar_t
*
)
input
,
7
);
int
len
=
BufferIO
::
CopyWStr
(
input
,
msgbuf
,
256
);
DuelClient
::
SendBufferToServer
(
CTOS_CHAT
,
msgbuf
,
(
len
+
1
)
*
sizeof
(
short
));
mainGame
->
ebChatInput
->
setText
(
L""
);
}
break
;
}
}
break
;
}
default:
break
;
}
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
;
...
...
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