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
nanahira
ygopro
Commits
fd4c3855
Commit
fd4c3855
authored
Apr 20, 2020
by
mercury233
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drag cardtext
parent
392e6d9b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
0 deletions
+46
-0
gframe/client_field.cpp
gframe/client_field.cpp
+3
-0
gframe/client_field.h
gframe/client_field.h
+3
-0
gframe/event_handler.cpp
gframe/event_handler.cpp
+40
-0
No files found.
gframe/client_field.cpp
View file @
fd4c3855
...
@@ -12,6 +12,9 @@ namespace ygo {
...
@@ -12,6 +12,9 @@ namespace ygo {
ClientField
::
ClientField
()
{
ClientField
::
ClientField
()
{
panel
=
0
;
panel
=
0
;
is_dragging_cardtext
=
false
;
dragging_cardtext_start_pos
=
0
;
dragging_cardtext_start_y
=
0
;
hovered_card
=
0
;
hovered_card
=
0
;
clicked_card
=
0
;
clicked_card
=
0
;
highlighting_card
=
0
;
highlighting_card
=
0
;
...
...
gframe/client_field.h
View file @
fd4c3855
...
@@ -114,6 +114,9 @@ public:
...
@@ -114,6 +114,9 @@ public:
void
UpdateDeclarableList
();
void
UpdateDeclarableList
();
irr
::
gui
::
IGUIElement
*
panel
;
irr
::
gui
::
IGUIElement
*
panel
;
bool
is_dragging_cardtext
;
int
dragging_cardtext_start_pos
;
int
dragging_cardtext_start_y
;
std
::
vector
<
int
>
ancard
;
std
::
vector
<
int
>
ancard
;
int
hovered_controler
;
int
hovered_controler
;
int
hovered_location
;
int
hovered_location
;
...
...
gframe/event_handler.cpp
View file @
fd4c3855
...
@@ -1998,6 +1998,46 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
...
@@ -1998,6 +1998,46 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
}
}
break;
break;
}
}
case irr::EET_MOUSE_INPUT_EVENT: {
switch(event.MouseInput.Event) {
case irr::EMIE_LMOUSE_PRESSED_DOWN: {
IGUIElement* root = mainGame->env->getRootGUIElement();
position2di mousepos = position2di(event.MouseInput.X, event.MouseInput.Y);
if(root->getElementFromPoint(mousepos) == mainGame->stText) {
if(!mainGame->scrCardText->isVisible()) {
break;
}
is_dragging_cardtext = true;
dragging_cardtext_start_pos = mainGame->scrCardText->getPos();
dragging_cardtext_start_y = event.MouseInput.Y;
return true;
}
break;
}
case irr::EMIE_LMOUSE_LEFT_UP: {
is_dragging_cardtext = false;
break;
}
case irr::EMIE_MOUSE_MOVED: {
if(is_dragging_cardtext) {
if(!mainGame->scrCardText->isVisible()) {
is_dragging_cardtext = false;
break;
}
int step = mainGame->guiFont->getDimension(L"A").Height + mainGame->guiFont->getKerningHeight();
int pos = dragging_cardtext_start_pos + (dragging_cardtext_start_y - event.MouseInput.Y) / step;
int max = mainGame->scrCardText->getMax();
if(pos < 0) pos = 0;
if(pos > max) pos = max;
mainGame->scrCardText->setPos(pos);
mainGame->SetStaticText(mainGame->stText, mainGame->stText->getRelativePosition().getWidth() - 25, mainGame->guiFont, mainGame->showingtext, pos);
}
break;
}
default: break;
}
break;
}
default: break;
default: break;
}
}
return false;
return false;
...
...
nanahira
@nanahira
mentioned in commit
02121635
·
Feb 14, 2025
mentioned in commit
02121635
mentioned in commit 021216359b011bdba408206c2cb2b22b6ec1ae17
Toggle commit list
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