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
YGOPRO-520DIY
ygopro
Commits
3b140bf4
Commit
3b140bf4
authored
Sep 12, 2016
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
f5718611
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
23 deletions
+31
-23
gframe/duelclient.cpp
gframe/duelclient.cpp
+2
-0
gframe/event_handler.cpp
gframe/event_handler.cpp
+29
-23
No files found.
gframe/duelclient.cpp
View file @
3b140bf4
...
@@ -1184,6 +1184,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1184,6 +1184,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
}
if
(
mainGame
->
dField
.
select_cancelable
)
{
if
(
mainGame
->
dField
.
select_cancelable
)
{
mainGame
->
dField
.
ShowCancelOrFinishButton
(
1
);
mainGame
->
dField
.
ShowCancelOrFinishButton
(
1
);
}
else
{
mainGame
->
dField
.
ShowCancelOrFinishButton
(
0
);
}
}
return
false
;
return
false
;
}
}
...
...
gframe/event_handler.cpp
View file @
3b140bf4
...
@@ -1615,22 +1615,23 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -1615,22 +1615,23 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
case irr::EMIE_MOUSE_MOVED: {
case irr::EMIE_MOUSE_MOVED: {
if(!mainGame->dInfo.isStarted)
if(!mainGame->dInfo.isStarted)
break;
break;
bool should_show_tip = false;
s32 x = event.MouseInput.X;
s32 x = event.MouseInput.X;
s32 y = event.MouseInput.Y;
s32 y = event.MouseInput.Y;
irr::core::position2di pos(x, y);
irr::core::position2di pos(x, y);
irr
::
gui
::
IGUIElement
*
root
=
mainGame
->
env
->
getRootGUIElement
();
wchar_t formatBuffer[2048];
if
(
root
->
getElementFromPoint
(
pos
)
==
mainGame
->
btnCancelOrFinish
)
{
if(x < 300) {
mainGame
->
stTip
->
setVisible
(
true
);
irr::gui::IGUIElement* root = mainGame->env->getRootGUIElement();
wchar_t
formatBuffer
[
2048
];
irr::gui::IGUIElement* elem = root->getElementFromPoint(pos);
myswprintf
(
formatBuffer
,
dataManager
.
GetSysString
(
1700
),
mainGame
->
btnCancelOrFinish
->
getText
());
if(elem == mainGame->btnCancelOrFinish) {
irr
::
core
::
dimension2d
<
unsigned
int
>
dtip
=
mainGame
->
textFont
->
getDimension
(
formatBuffer
)
+
irr
::
core
::
dimension2d
<
unsigned
int
>
(
10
,
10
);
should_show_tip = true;
mainGame
->
stTip
->
setRelativePosition
(
recti
(
x
-
10
-
dtip
.
Width
,
y
-
10
-
dtip
.
Height
,
x
-
10
,
y
-
10
));
myswprintf(formatBuffer, dataManager.GetSysString(1700), mainGame->btnCancelOrFinish->getText());
mainGame
->
stTip
->
setText
(
formatBuffer
);
mainGame->stTip->setText(formatBuffer);
}
else
irr::core::dimension2d<unsigned int> dtip = mainGame->textFont->getDimension(formatBuffer) + irr::core::dimension2d<unsigned int>(10, 10);
mainGame
->
stTip
->
setVisible
(
false
);
mainGame->stTip->setRelativePosition(recti(x - 10 - dtip.Width, y - 10 - dtip.Height, x - 10, y - 10));
}
} else {
hovered_location = 0;
hovered_location = 0;
if
(
x
<
300
)
break
;
ClientCard* mcard = 0;
ClientCard* mcard = 0;
int mplayer = -1;
int mplayer = -1;
if(!panel || !panel->isVisible() || !panel->getRelativePosition().isPointInside(pos)) {
if(!panel || !panel->isVisible() || !panel->getRelativePosition().isPointInside(pos)) {
...
@@ -1656,15 +1657,17 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -1656,15 +1657,17 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mplayer = 1;
mplayer = 1;
}
}
}
}
if(hovered_location == LOCATION_HAND && (mainGame->dInfo.is_shuffling || mainGame->dInfo.curMsg == MSG_SHUFFLE_HAND))
if(hovered_location == LOCATION_HAND && (mainGame->dInfo.is_shuffling || mainGame->dInfo.curMsg == MSG_SHUFFLE_HAND))
mcard = 0;
mcard = 0;
if(mcard == 0 && mplayer < 0)
if(mcard == 0 && mplayer < 0)
mainGame
->
stTip
->
setVisible
(
false
);
should_show_tip = false;
else
if
(
mcard
==
hovered_card
&&
mplayer
==
hovered_player
)
{
else if(mcard == hovered_card && mplayer == hovered_player) {
if
(
mainGame
->
stTip
->
isVisible
())
{
if(mainGame->stTip->isVisible()) {
irr
::
core
::
recti
tpos
=
mainGame
->
stTip
->
getRelativePosition
();
should_show_tip = true;
mainGame
->
stTip
->
setRelativePosition
(
irr
::
core
::
position2di
(
x
-
tpos
.
getWidth
()
-
10
,
mcard
?
y
-
tpos
.
getHeight
()
-
10
:
y
+
10
));
irr::core::recti tpos = mainGame->stTip->getRelativePosition();
}
mainGame->stTip->setRelativePosition(irr::core::position2di(x - tpos.getWidth() - 10, mcard ? y - tpos.getHeight() - 10 : y + 10));
}
}
}
if(mcard != hovered_card) {
if(mcard != hovered_card) {
if(hovered_card) {
if(hovered_card) {
...
@@ -1707,7 +1710,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -1707,7 +1710,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame->ShowCardInfo(mcard->code);
mainGame->ShowCardInfo(mcard->code);
if(mcard->location & 0xe) {
if(mcard->location & 0xe) {
std::wstring str;
std::wstring str;
wchar_t
formatBuffer
[
2048
];
myswprintf(formatBuffer, L"%ls", dataManager.GetName(mcard->code));
myswprintf(formatBuffer, L"%ls", dataManager.GetName(mcard->code));
str.append(formatBuffer);
str.append(formatBuffer);
if(mcard->type & TYPE_MONSTER) {
if(mcard->type & TYPE_MONSTER) {
...
@@ -1757,13 +1759,13 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -1757,13 +1759,13 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
myswprintf(formatBuffer, L"\n*%ls", dataManager.GetDesc(iter->first));
myswprintf(formatBuffer, L"\n*%ls", dataManager.GetDesc(iter->first));
str.append(formatBuffer);
str.append(formatBuffer);
}
}
mainGame
->
stTip
->
setVisible
(
true
)
;
should_show_tip = true
;
irr::core::dimension2d<unsigned int> dtip = mainGame->textFont->getDimension(str.c_str()) + irr::core::dimension2d<unsigned int>(10, 10);
irr::core::dimension2d<unsigned int> dtip = mainGame->textFont->getDimension(str.c_str()) + irr::core::dimension2d<unsigned int>(10, 10);
mainGame->stTip->setRelativePosition(recti(x - 10 - dtip.Width, y - 10 - dtip.Height, x - 10, y - 10));
mainGame->stTip->setRelativePosition(recti(x - 10 - dtip.Width, y - 10 - dtip.Height, x - 10, y - 10));
mainGame->stTip->setText(str.c_str());
mainGame->stTip->setText(str.c_str());
}
}
} else {
} else {
mainGame
->
stTip
->
setVisible
(
false
)
;
should_show_tip = false
;
mainGame->imgCard->setImage(imageManager.tCover[0]);
mainGame->imgCard->setImage(imageManager.tCover[0]);
mainGame->stName->setText(L"");
mainGame->stName->setText(L"");
mainGame->stInfo->setText(L"");
mainGame->stInfo->setText(L"");
...
@@ -1790,19 +1792,23 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -1790,19 +1792,23 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
player_name = mainGame->dInfo.clientname_tag;
player_name = mainGame->dInfo.clientname_tag;
}
}
std::wstring str(player_name);
std::wstring str(player_name);
wchar_t
formatBuffer
[
2048
];
const auto& player_desc_hints = mainGame->dField.player_desc_hints[mplayer];
const auto& player_desc_hints = mainGame->dField.player_desc_hints[mplayer];
for(auto iter = player_desc_hints.begin(); iter != player_desc_hints.end(); ++iter) {
for(auto iter = player_desc_hints.begin(); iter != player_desc_hints.end(); ++iter) {
myswprintf(formatBuffer, L"\n*%ls", dataManager.GetDesc(iter->first));
myswprintf(formatBuffer, L"\n*%ls", dataManager.GetDesc(iter->first));
str.append(formatBuffer);
str.append(formatBuffer);
}
}
mainGame
->
stTip
->
setVisible
(
true
)
;
should_show_tip = true
;
irr::core::dimension2d<unsigned int> dtip = mainGame->textFont->getDimension(str.c_str()) + irr::core::dimension2d<unsigned int>(10, 10);
irr::core::dimension2d<unsigned int> dtip = mainGame->textFont->getDimension(str.c_str()) + irr::core::dimension2d<unsigned int>(10, 10);
mainGame->stTip->setRelativePosition(recti(x - 10 - dtip.Width, y + 10, x - 10, y + 10 + dtip.Height));
mainGame->stTip->setRelativePosition(recti(x - 10 - dtip.Width, y + 10, x - 10, y + 10 + dtip.Height));
mainGame->stTip->setText(str.c_str());
mainGame->stTip->setText(str.c_str());
}
}
hovered_player = mplayer;
hovered_player = mplayer;
}
}
}
if(should_show_tip)
mainGame->stTip->setVisible(true);
else
mainGame->stTip->setVisible(false);
break;
break;
}
}
case irr::EMIE_MOUSE_WHEEL: {
case irr::EMIE_MOUSE_WHEEL: {
...
...
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