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
86832fd8
Commit
86832fd8
authored
Apr 25, 2020
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drag search result
parent
f5abf67f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
10 deletions
+36
-10
Classes/gframe/deck_con.cpp
Classes/gframe/deck_con.cpp
+35
-10
Classes/gframe/deck_con.h
Classes/gframe/deck_con.h
+1
-0
No files found.
Classes/gframe/deck_con.cpp
View file @
86832fd8
#include "config.h"
#include "config.h"
#include "deck_con.h"
#include "deck_con.h"
#include "data_manager.h"
#include "data_manager.h"
...
@@ -145,6 +146,7 @@ void DeckBuilder::Initialize() {
...
@@ -145,6 +146,7 @@ void DeckBuilder::Initialize() {
hovered_pos
=
0
;
hovered_pos
=
0
;
hovered_seq
=
-
1
;
hovered_seq
=
-
1
;
is_lastcard
=
0
;
is_lastcard
=
0
;
drag_start_pos
=
0
;
is_draging
=
false
;
is_draging
=
false
;
is_starting_dragging
=
false
;
is_starting_dragging
=
false
;
prev_deck
=
mainGame
->
cbDBDecks
->
getSelected
();
prev_deck
=
mainGame
->
cbDBDecks
->
getSelected
();
...
@@ -1077,6 +1079,10 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
...
@@ -1077,6 +1079,10 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
break
;
break
;
}
}
is_starting_dragging
=
true
;
is_starting_dragging
=
true
;
if
(
mainGame
->
scrFilter
->
isVisible
())
{
drag_start_pos
=
mainGame
->
scrFilter
->
getPos
();
break
;
}
break
;
break
;
}
}
case
irr
:
:
EMIE_LMOUSE_LEFT_UP
:
{
case
irr
:
:
EMIE_LMOUSE_LEFT_UP
:
{
...
@@ -1204,6 +1210,15 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
...
@@ -1204,6 +1210,15 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
is_starting_dragging
=
false
;
is_starting_dragging
=
false
;
}
}
mouse_pos
.
set
(
event
.
MouseInput
.
X
,
event
.
MouseInput
.
Y
);
mouse_pos
.
set
(
event
.
MouseInput
.
X
,
event
.
MouseInput
.
Y
);
int
dragpos
=
drag_start_pos
+
(
dragy
-
mouse_pos
.
Y
);
if
(
dragpos
>
0
)
{
if
(
mainGame
->
scrFilter
->
getPos
()
<
mainGame
->
scrFilter
->
getMax
())
mainGame
->
scrFilter
->
setPos
((
mainGame
->
scrFilter
->
getPos
()
+
1
));
}
else
{
if
(
mainGame
->
scrFilter
->
getPos
()
>
0
)
mainGame
->
scrFilter
->
setPos
((
mainGame
->
scrFilter
->
getPos
()
-
1
));
}
GetHoveredCard
();
GetHoveredCard
();
break
;
break
;
}
}
...
@@ -1298,16 +1313,26 @@ void DeckBuilder::GetHoveredCard() {
...
@@ -1298,16 +1313,26 @@ void DeckBuilder::GetHoveredCard() {
is_lastcard
=
1
;
is_lastcard
=
1
;
}
}
}
}
}
else
if
(
x
>=
810
*
mainGame
->
xScale
&&
x
<=
995
*
mainGame
->
xScale
&&
y
>=
165
*
mainGame
->
yScale
&&
y
<=
626
*
mainGame
->
yScale
)
{
}
else
if
(
x
>=
810
*
mainGame
->
xScale
&&
x
<=
995
*
mainGame
->
xScale
&&
y
>=
165
*
mainGame
->
yScale
&&
y
<=
626
*
mainGame
->
yScale
)
{
//搜索结果
hovered_pos
=
4
;
hovered_pos
=
4
;
hovered_seq
=
(
y
-
165
*
mainGame
->
yScale
)
/
(
66
*
mainGame
->
yScale
);
hovered_seq
=
(
y
-
165
*
mainGame
->
yScale
)
/
(
66
*
mainGame
->
yScale
);
int
pos
=
mainGame
->
scrFilter
->
getPos
()
+
hovered_seq
;
int
pos
=
mainGame
->
scrFilter
->
getPos
();
if
(
pos
>=
(
int
)
results
.
size
())
{
if
(
x
>=
860
*
mainGame
->
xScale
&&
x
<=
900
*
mainGame
->
xScale
){
hovered_seq
=
-
1
;
if
(
pos
>=
(
int
)
results
.
size
())
{
hovered_code
=
0
;
hovered_seq
=
-
1
;
}
else
{
hovered_code
=
0
;
hovered_code
=
results
[
pos
]
->
first
;
}
else
{
}
hovered_code
=
results
[
pos
]
->
first
;
}
}
if
(
x
>
900
*
mainGame
->
xScale
&&
x
<=
995
*
mainGame
->
xScale
){
if
(
pos
>=
(
int
)
results
.
size
())
{
hovered_seq
=
-
1
;
hovered_code
=
0
;
}
else
{
mainGame
->
ShowCardInfo
(
results
[
pos
]
->
first
);
}
}
}
}
if
(
is_draging
)
{
if
(
is_draging
)
{
dragx
=
x
;
dragx
=
x
;
...
...
Classes/gframe/deck_con.h
View file @
86832fd8
...
@@ -60,6 +60,7 @@ public:
...
@@ -60,6 +60,7 @@ public:
int
click_pos
;
int
click_pos
;
bool
is_draging
;
bool
is_draging
;
bool
is_starting_dragging
;
bool
is_starting_dragging
;
int
drag_start_pos
;
int
dragx
;
int
dragx
;
int
dragy
;
int
dragy
;
size_t
pre_mainc
;
size_t
pre_mainc
;
...
...
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