Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile-Cn-Ko-En
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-Cn-Ko-En
Commits
bc8d56f6
Commit
bc8d56f6
authored
May 01, 2020
by
fallenstardust
Committed by
GitHub
May 01, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #37 from mercury233/patch-4
call getElementFromPoint only once
parents
9756b5e5
c1931168
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
19 deletions
+20
-19
Classes/gframe/event_handler.cpp
Classes/gframe/event_handler.cpp
+20
-19
No files found.
Classes/gframe/event_handler.cpp
View file @
bc8d56f6
...
...
@@ -1978,12 +1978,13 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
case
irr
:
:
EET_MOUSE_INPUT_EVENT
:
{
IGUIElement
*
root
=
mainGame
->
env
->
getRootGUIElement
();
position2di
mousepos
=
position2di
(
event
.
MouseInput
.
X
,
event
.
MouseInput
.
Y
);
irr
::
gui
::
IGUIElement
*
eventElement
=
root
->
getElementFromPoint
(
mousepos
);
u32
static
presstime
,
leftuptime
;
switch
(
event
.
MouseInput
.
Event
)
{
case
irr
:
:
EMIE_LMOUSE_PRESSED_DOWN
:
{
presstime
=
mainGame
->
device
->
getTimer
()
->
getRealTime
();
//vertical scrollbar
if
(
root
->
getElementFromPoint
(
mousepos
)
==
mainGame
->
stText
)
{
if
(
eventElement
==
mainGame
->
stText
)
{
if
(
!
mainGame
->
scrCardText
->
isVisible
())
{
break
;
}
...
...
@@ -1992,7 +1993,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
dragging_tab_start_y
=
event
.
MouseInput
.
Y
;
return
true
;
}
if
(
root
->
getElementFromPoint
(
mousepos
)
==
mainGame
->
lstLog
)
{
if
(
eventElement
==
mainGame
->
lstLog
)
{
if
(
!
mainGame
->
lstLog
->
getVerticalScrollBar
()
->
isVisible
())
{
break
;
}
...
...
@@ -2001,7 +2002,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
dragging_tab_start_y
=
event
.
MouseInput
.
Y
;
return
true
;
}
if
(
root
->
getElementFromPoint
(
mousepos
)
==
mainGame
->
lstReplayList
)
{
if
(
eventElement
==
mainGame
->
lstReplayList
)
{
if
(
!
mainGame
->
lstReplayList
->
getVerticalScrollBar
()
->
isVisible
())
{
break
;
}
...
...
@@ -2010,7 +2011,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
dragging_tab_start_y
=
event
.
MouseInput
.
Y
;
return
true
;
}
if
(
root
->
getElementFromPoint
(
mousepos
)
==
mainGame
->
lstSinglePlayList
)
{
if
(
eventElement
==
mainGame
->
lstSinglePlayList
)
{
if
(
!
mainGame
->
lstSinglePlayList
->
getVerticalScrollBar
()
->
isVisible
())
{
break
;
}
...
...
@@ -2019,7 +2020,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
dragging_tab_start_y
=
event
.
MouseInput
.
Y
;
return
true
;
}
if
(
root
->
getElementFromPoint
(
mousepos
)
==
mainGame
->
lstBotList
)
{
if
(
eventElement
==
mainGame
->
lstBotList
)
{
if
(
!
mainGame
->
lstBotList
->
getVerticalScrollBar
()
->
isVisible
())
{
break
;
}
...
...
@@ -2028,7 +2029,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
dragging_tab_start_y
=
event
.
MouseInput
.
Y
;
return
true
;
}
if
(
root
->
getElementFromPoint
(
mousepos
)
==
mainGame
->
lstDecks
)
{
if
(
eventElement
==
mainGame
->
lstDecks
)
{
if
(
!
mainGame
->
lstDecks
->
getVerticalScrollBar
()
->
isVisible
())
{
break
;
}
...
...
@@ -2037,7 +2038,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
dragging_tab_start_y
=
event
.
MouseInput
.
Y
;
return
true
;
}
if
(
root
->
getElementFromPoint
(
mousepos
)
==
mainGame
->
lstANCard
)
{
if
(
eventElement
==
mainGame
->
lstANCard
)
{
if
(
!
mainGame
->
lstANCard
->
getVerticalScrollBar
()
->
isVisible
())
{
break
;
}
...
...
@@ -2046,7 +2047,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
dragging_tab_start_y
=
event
.
MouseInput
.
Y
;
return
true
;
}
if
(
root
->
getElementFromPoint
(
mousepos
)
==
mainGame
->
tabHelper
){
if
(
eventElement
==
mainGame
->
tabHelper
){
if
(
!
mainGame
->
scrTabHelper
->
isVisible
())
{
break
;
}
...
...
@@ -2055,7 +2056,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
dragging_tab_start_y
=
event
.
MouseInput
.
Y
;
return
true
;
}
if
(
root
->
getElementFromPoint
(
mousepos
)
==
mainGame
->
tabSystem
){
if
(
eventElement
==
mainGame
->
tabSystem
){
if
(
!
mainGame
->
scrTabSystem
->
isVisible
())
{
break
;
}
...
...
@@ -2066,8 +2067,8 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
}
//horizontal scollbar
for
(
int
i
=
0
;
i
<
5
;
i
++
)
{
if
(
root
->
getElementFromPoint
(
mousepos
)
==
mainGame
->
btnCardSelect
[
i
]
||
root
->
getElementFromPoint
(
mousepos
)
==
mainGame
->
stCardPos
[
i
])
{
if
(
eventElement
==
mainGame
->
btnCardSelect
[
i
]
||
eventElement
==
mainGame
->
stCardPos
[
i
])
{
if
(
!
mainGame
->
scrCardList
->
isVisible
())
{
break
;
}
...
...
@@ -2076,8 +2077,8 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
dragging_tab_start_x
=
event
.
MouseInput
.
X
;
return
true
;
}
if
(
root
->
getElementFromPoint
(
mousepos
)
==
mainGame
->
btnCardDisplay
[
i
]
||
root
->
getElementFromPoint
(
mousepos
)
==
mainGame
->
stDisplayPos
[
i
])
{
if
(
eventElement
==
mainGame
->
btnCardDisplay
[
i
]
||
eventElement
==
mainGame
->
stDisplayPos
[
i
])
{
if
(
!
mainGame
->
scrDisplayList
->
isVisible
())
{
break
;
}
...
...
@@ -2090,12 +2091,12 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
break
;
}
case
irr
:
:
EMIE_LMOUSE_LEFT_UP
:
{
if
(
root
->
getElementFromPoint
(
mousepos
)
==
mainGame
->
stText
||
root
->
getElementFromPoint
(
mousepos
)
==
mainGame
->
wHostPrepare
||
root
->
getElementFromPoint
(
mousepos
)
==
mainGame
->
imgCard
||
root
->
getElementFromPoint
(
mousepos
)
==
mainGame
->
wReplay
||
root
->
getElementFromPoint
(
mousepos
)
==
mainGame
->
wSinglePlay
||
root
->
getElementFromPoint
(
mousepos
)
==
mainGame
->
wLanWindow
)
{
if
(
eventElement
==
mainGame
->
stText
||
eventElement
==
mainGame
->
wHostPrepare
||
eventElement
==
mainGame
->
imgCard
||
eventElement
==
mainGame
->
wReplay
||
eventElement
==
mainGame
->
wSinglePlay
||
eventElement
==
mainGame
->
wLanWindow
)
{
mainGame
->
gMutex
.
lock
();
mainGame
->
textFont
->
setTransparency
(
true
);
mainGame
->
ClearChatMsg
();
...
...
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