Commit 3608c86d authored by fallenstardust's avatar fallenstardust

0x1346

parent 2919bdcc
...@@ -2240,33 +2240,38 @@ void ClientField::SetShowMark(ClientCard* pcard, bool enable) { ...@@ -2240,33 +2240,38 @@ void ClientField::SetShowMark(ClientCard* pcard, bool enable) {
} }
} }
void ClientField::ShowCardInfoInList(ClientCard* pcard, irr::gui::IGUIElement* element, irr::gui::IGUIElement* parent) { void ClientField::ShowCardInfoInList(ClientCard* pcard, irr::gui::IGUIElement* element, irr::gui::IGUIElement* parent) {
std::wstring str(L""); std::wstring str(L"");
if(pcard->code) { if(pcard->code) {
str.append(dataManager.GetName(pcard->code)); str.append(dataManager.GetName(pcard->code));
} }
for(size_t i = 0; i < chains.size(); ++i) { for(size_t i = 0; i < chains.size(); ++i) {
wchar_t formatBuffer[2048]; wchar_t formatBuffer[2048];
auto chit = chains[i]; auto chit = chains[i];
if(pcard == chit.chain_card) { if(pcard == chit.chain_card) {
myswprintf(formatBuffer, dataManager.GetSysString(216), i + 1); myswprintf(formatBuffer, dataManager.GetSysString(216), i + 1);
str.append(L"\n").append(formatBuffer); str.append(L"\n").append(formatBuffer);
} }
if(chit.target.find(pcard) != chit.target.end()) { if(chit.target.find(pcard) != chit.target.end()) {
myswprintf(formatBuffer, dataManager.GetSysString(217), i + 1, dataManager.GetName(chit.chain_card->code)); myswprintf(formatBuffer, dataManager.GetSysString(217), i + 1, dataManager.GetName(chit.chain_card->code));
str.append(L"\n").append(formatBuffer); str.append(L"\n").append(formatBuffer);
} }
} }
if(str.length() > 0) { if(str.length() > 0) {
parent->addChild(mainGame->stCardListTip); parent->addChild(mainGame->stCardListTip);
irr::core::rect<s32> ePos = element->getRelativePosition(); irr::core::rect<s32> ePos = element->getRelativePosition();
s32 x = (ePos.UpperLeftCorner.X + ePos.LowerRightCorner.X) / 2; s32 x = (ePos.UpperLeftCorner.X + ePos.LowerRightCorner.X) / 2;
s32 y = ePos.LowerRightCorner.Y; s32 y = ePos.LowerRightCorner.Y;
mainGame->SetStaticText(mainGame->stCardListTip, 160, mainGame->guiFont, str.c_str()); mainGame->SetStaticText(mainGame->stCardListTip, 320 * mainGame->xScale, mainGame->guiFont, str.c_str());
irr::core::dimension2d<unsigned int> dTip = mainGame->guiFont->getDimension(mainGame->stCardListTip->getText()) + irr::core::dimension2d<unsigned int>(10, 10); irr::core::dimension2d<unsigned int> dTip = mainGame->guiFont->getDimension(mainGame->stCardListTip->getText()) + irr::core::dimension2d<unsigned int>(10, 10);
mainGame->stCardListTip->setRelativePosition(recti((x - dTip.Width / 2) * mainGame->xScale, y - 10 * mainGame->yScale, (x + dTip.Width / 2) * mainGame->xScale, y - 10 + dTip.Height)); s32 w = dTip.Width / 2;
mainGame->stCardListTip->setVisible(true); if(x - w < 10)
} x = w + 10;
} if(x + w > 670)
x = 670 - w;
mainGame->stCardListTip->setRelativePosition(recti(x - dTip.Width / 2, y - 10, x + dTip.Width / 2, y - 10 + dTip.Height));
mainGame->stCardListTip->setVisible(true);
}
}
void ClientField::SetResponseSelectedCards() const { void ClientField::SetResponseSelectedCards() const {
unsigned char respbuf[64]; unsigned char respbuf[64];
respbuf[0] = selected_cards.size(); respbuf[0] = selected_cards.size();
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include <COGLESDriver.h> #include <COGLESDriver.h>
#endif #endif
const unsigned short PRO_VERSION = 0x1345; const unsigned short PRO_VERSION = 0x1346;
namespace ygo { namespace ygo {
...@@ -901,7 +901,7 @@ bool Game::Initialize() { ...@@ -901,7 +901,7 @@ bool Game::Initialize() {
btnLeaveGame = env->addButton(rect<s32>(205 * xScale, 1 * yScale, 305 * xScale, 80 * yScale), 0, BUTTON_LEAVE_GAME, L""); btnLeaveGame = env->addButton(rect<s32>(205 * xScale, 1 * yScale, 305 * xScale, 80 * yScale), 0, BUTTON_LEAVE_GAME, L"");
btnLeaveGame->setVisible(false); btnLeaveGame->setVisible(false);
//tip //tip
stTip = env->addStaticText(L"", rect<s32>(0 * xScale, 0 * yScale, 150 * xScale, 150 * yScale), false, true, 0, -1, true); stTip = env->addStaticText(L"", rect<s32>(0, 0, 150 * xScale, 150 * yScale), false, true, 0, -1, true);
stTip->setBackgroundColor(0xc011113d); stTip->setBackgroundColor(0xc011113d);
stTip->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER); stTip->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
stTip->setVisible(false); stTip->setVisible(false);
......
...@@ -8,7 +8,7 @@ android { ...@@ -8,7 +8,7 @@ android {
applicationId "cn.garymb.ygomobile" applicationId "cn.garymb.ygomobile"
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 26 targetSdkVersion 26
versionCode 330701022 versionCode 330701024
versionName "3.3.7" versionName "3.3.7"
flavorDimensions "versionCode" flavorDimensions "versionCode"
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment