Commit 5f8fe0d8 authored by mercury233's avatar mercury233

gu

parent 46365978
...@@ -1111,7 +1111,7 @@ void Game::ShowElement(irr::gui::IGUIElement * win, int autoframe) { ...@@ -1111,7 +1111,7 @@ void Game::ShowElement(irr::gui::IGUIElement * win, int autoframe) {
FadingUnit fu; FadingUnit fu;
fu.fadingSize = win->getRelativePosition(); fu.fadingSize = win->getRelativePosition();
for(auto fit = fadingList.begin(); fit != fadingList.end(); ++fit) for(auto fit = fadingList.begin(); fit != fadingList.end(); ++fit)
if(win == fit->guiFading && win != wOptions && win != wANNumber) // the size of wOptions is always setted by ClientField::ShowSelectOption before showing it if(win == fit->guiFading && win != wOptions && win != wANNumber && win != wPosSelect) // the size of those windows are always setted before showing them
fu.fadingSize = fit->fadingSize; fu.fadingSize = fit->fadingSize;
irr::core::position2di center = fu.fadingSize.getCenter(); irr::core::position2di center = fu.fadingSize.getCenter();
fu.fadingDiff.X = fu.fadingSize.getWidth() / 10; fu.fadingDiff.X = fu.fadingSize.getWidth() / 10;
......
...@@ -1830,7 +1830,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1830,7 +1830,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
filter <<= 1; filter <<= 1;
} }
if(count == 4) startpos = 10; if(count == 4) startpos = 10;
else if(count == 3) startpos = 82; else if(count == 3) startpos = 50;
else startpos = 50; else startpos = 50;
if(positions & 0x1) { if(positions & 0x1) {
mainGame->imageLoading.insert(std::make_pair(mainGame->btnPSAU, code)); mainGame->imageLoading.insert(std::make_pair(mainGame->btnPSAU, code));
...@@ -1854,6 +1854,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1854,6 +1854,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->btnPSDD->setVisible(true); mainGame->btnPSDD->setVisible(true);
startpos += 150; startpos += 150;
} else mainGame->btnPSDD->setVisible(false); } else mainGame->btnPSDD->setVisible(false);
recti pos = mainGame->wPosSelect->getRelativePosition();
pos.LowerRightCorner.X = pos.UpperLeftCorner.X + count * 150 * mainGame->xScale + 100 * mainGame->xScale;
mainGame->wPosSelect->setRelativePosition(pos);
mainGame->bgPosSelect->setRelativePosition(rect<s32>(0, 0, pos.getWidth(), pos.getHeight()));
mainGame->gMutex.lock(); mainGame->gMutex.lock();
mainGame->PopupElement(mainGame->wPosSelect); mainGame->PopupElement(mainGame->wPosSelect);
mainGame->gMutex.unlock(); mainGame->gMutex.unlock();
......
...@@ -716,7 +716,7 @@ bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) { ...@@ -716,7 +716,7 @@ bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) {
wPosSelect = env->addWindow(rect<s32>(470 * xScale, 180 * yScale, 860 * xScale, 360 * yScale), false, dataManager.GetSysString(561)); wPosSelect = env->addWindow(rect<s32>(470 * xScale, 180 * yScale, 860 * xScale, 360 * yScale), false, dataManager.GetSysString(561));
wPosSelect->getCloseButton()->setVisible(false); wPosSelect->getCloseButton()->setVisible(false);
wPosSelect->setVisible(false); wPosSelect->setVisible(false);
ChangeToIGUIImageWindow(wPosSelect, bgPosSelect, imageManager.tDialog_L); ChangeToIGUIImageWindow1(wPosSelect, &bgPosSelect, imageManager.tDialog_L);
btnPSAU = irr::gui::CGUIImageButton::addImageButton(env, rect<s32>(50 * xScale, 25 * yScale, 190 * xScale, 165 * yScale), wPosSelect, BUTTON_POS_AU); btnPSAU = irr::gui::CGUIImageButton::addImageButton(env, rect<s32>(50 * xScale, 25 * yScale, 190 * xScale, 165 * yScale), wPosSelect, BUTTON_POS_AU);
btnPSAU->setImageSize(core::dimension2di(CARD_IMG_WIDTH * 0.5f * yScale, CARD_IMG_HEIGHT * 0.5f * yScale)); btnPSAU->setImageSize(core::dimension2di(CARD_IMG_WIDTH * 0.5f * yScale, CARD_IMG_HEIGHT * 0.5f * yScale));
btnPSAD = irr::gui::CGUIImageButton::addImageButton(env, rect<s32>(200 * xScale, 25 * yScale, 340 * xScale, 165 * yScale), wPosSelect, BUTTON_POS_AD); btnPSAD = irr::gui::CGUIImageButton::addImageButton(env, rect<s32>(200 * xScale, 25 * yScale, 340 * xScale, 165 * yScale), wPosSelect, BUTTON_POS_AD);
...@@ -2070,7 +2070,14 @@ void Game::ChangeToIGUIImageWindow(irr::gui::IGUIWindow* window, irr::gui::IGUII ...@@ -2070,7 +2070,14 @@ void Game::ChangeToIGUIImageWindow(irr::gui::IGUIWindow* window, irr::gui::IGUII
bgwindow = env->addImage(rect<s32>(0, 0, pos.getWidth(), pos.getHeight()), window, -1, 0, true); bgwindow = env->addImage(rect<s32>(0, 0, pos.getWidth(), pos.getHeight()), window, -1, 0, true);
bgwindow->setImage(image); bgwindow->setImage(image);
bgwindow->setScaleImage(true); bgwindow->setScaleImage(true);
}
void Game::ChangeToIGUIImageWindow1(irr::gui::IGUIWindow* window, irr::gui::IGUIImage** _bgwindow, irr::video::ITexture* image) {
window->setDrawBackground(false);
recti pos = window->getRelativePosition();
*_bgwindow = env->addImage(rect<s32>(0, 0, pos.getWidth(), pos.getHeight()), window, -1, 0, true);
irr::gui::IGUIImage* bgwindow = *_bgwindow;
bgwindow->setImage(image);
bgwindow->setScaleImage(true);
} }
void Game::ChangeToIGUIImageButton(irr::gui::IGUIButton* button, irr::video::ITexture* image, irr::video::ITexture* pressedImage, irr::gui::CGUITTFont* font) { void Game::ChangeToIGUIImageButton(irr::gui::IGUIButton* button, irr::video::ITexture* image, irr::video::ITexture* pressedImage, irr::gui::CGUITTFont* font) {
button->setDrawBorder(false); button->setDrawBorder(false);
......
...@@ -184,6 +184,7 @@ public: ...@@ -184,6 +184,7 @@ public:
void CloseDuelWindow(); void CloseDuelWindow();
void OnGameClose(); void OnGameClose();
void ChangeToIGUIImageWindow(irr::gui::IGUIWindow* window, irr::gui::IGUIImage* bgwindow, irr::video::ITexture* image); void ChangeToIGUIImageWindow(irr::gui::IGUIWindow* window, irr::gui::IGUIImage* bgwindow, irr::video::ITexture* image);
void ChangeToIGUIImageWindow1(irr::gui::IGUIWindow* window, irr::gui::IGUIImage** bgwindow, irr::video::ITexture* image);
void ChangeToIGUIImageButton(irr::gui::IGUIButton* button, irr::video::ITexture* image, irr::video::ITexture* pressedImage, irr::gui::CGUITTFont* font=0); void ChangeToIGUIImageButton(irr::gui::IGUIButton* button, irr::video::ITexture* image, irr::video::ITexture* pressedImage, irr::gui::CGUITTFont* font=0);
int LocalPlayer(int player); int LocalPlayer(int player);
......
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