Commit 59b51cd2 authored by edo9300's avatar edo9300

Minor changes

parent 22cedb89
...@@ -186,7 +186,7 @@ bool Game::Initialize() { ...@@ -186,7 +186,7 @@ bool Game::Initialize() {
env->addStaticText(dataManager.GetSysString(1629), rect<s32>(10, 10 + spacing * 20, 200, 30 + spacing * 20), false, false, wCustomRules); env->addStaticText(dataManager.GetSysString(1629), rect<s32>(10, 10 + spacing * 20, 200, 30 + spacing * 20), false, false, wCustomRules);
spacing++; spacing++;
for(int i = 0; i < 6; ++i, ++spacing) for(int i = 0; i < 6; ++i, ++spacing)
chkCustomRules[i] = env->addCheckBox(false, recti(10, 10 + spacing * 20, 200, 30 + spacing * 20), wCustomRules, -1, dataManager.GetSysString(1631 + i)); chkCustomRules[i] = env->addCheckBox(false, recti(10, 10 + spacing * 20, 200, 30 + spacing * 20), wCustomRules, 390 + i, dataManager.GetSysString(1631 + i));
env->addStaticText(dataManager.GetSysString(1628), rect<s32>(10, 10 + spacing * 20, 200, 30 + spacing * 20), false, false, wCustomRules); env->addStaticText(dataManager.GetSysString(1628), rect<s32>(10, 10 + spacing * 20, 200, 30 + spacing * 20), false, false, wCustomRules);
myswprintf(strbuf, dataManager.GetSysString(1627), dataManager.GetSysString(1056)); myswprintf(strbuf, dataManager.GetSysString(1627), dataManager.GetSysString(1056));
spacing++; spacing++;
...@@ -229,13 +229,13 @@ bool Game::Initialize() { ...@@ -229,13 +229,13 @@ bool Game::Initialize() {
btnHostConfirm = env->addButton(rect<s32>(260, 355, 370, 380), wCreateHost, BUTTON_HOST_CONFIRM, dataManager.GetSysString(1211)); btnHostConfirm = env->addButton(rect<s32>(260, 355, 370, 380), wCreateHost, BUTTON_HOST_CONFIRM, dataManager.GetSysString(1211));
btnHostCancel = env->addButton(rect<s32>(260, 385, 370, 410), wCreateHost, BUTTON_HOST_CANCEL, dataManager.GetSysString(1212)); btnHostCancel = env->addButton(rect<s32>(260, 385, 370, 410), wCreateHost, BUTTON_HOST_CANCEL, dataManager.GetSysString(1212));
//host(single) //host(single)
wHostPrepare = env->addWindow(rect<s32>(270, 120, 750, 440), false, dataManager.GetSysString(1250));
wHostPrepare->getCloseButton()->setVisible(false);
wHostPrepare->setVisible(false);
wHostPrepare2 = env->addWindow(rect<s32>(750, 120, 950, 440), false, dataManager.GetSysString(1625)); wHostPrepare2 = env->addWindow(rect<s32>(750, 120, 950, 440), false, dataManager.GetSysString(1625));
wHostPrepare2->getCloseButton()->setVisible(false); wHostPrepare2->getCloseButton()->setVisible(false);
wHostPrepare2->setVisible(false); wHostPrepare2->setVisible(false);
stHostPrepRule2 = env->addStaticText(L"", rect<s32>(10, 30, 460, 350), false, true, wHostPrepare2); stHostPrepRule2 = env->addStaticText(L"", rect<s32>(10, 30, 460, 350), false, true, wHostPrepare2);
wHostPrepare = env->addWindow(rect<s32>(270, 120, 750, 440), false, dataManager.GetSysString(1250));
wHostPrepare->getCloseButton()->setVisible(false);
wHostPrepare->setVisible(false);
btnHostPrepDuelist = env->addButton(rect<s32>(10, 30, 110, 55), wHostPrepare, BUTTON_HP_DUELIST, dataManager.GetSysString(1251)); btnHostPrepDuelist = env->addButton(rect<s32>(10, 30, 110, 55), wHostPrepare, BUTTON_HP_DUELIST, dataManager.GetSysString(1251));
for(int i = 0; i < 2; ++i) { for(int i = 0; i < 2; ++i) {
stHostPrepDuelist[i] = env->addStaticText(L"", rect<s32>(40, 65 + i * 25, 240, 85 + i * 25), true, false, wHostPrepare); stHostPrepDuelist[i] = env->addStaticText(L"", rect<s32>(40, 65 + i * 25, 240, 85 + i * 25), true, false, wHostPrepare);
...@@ -652,6 +652,8 @@ bool Game::Initialize() { ...@@ -652,6 +652,8 @@ bool Game::Initialize() {
//swap //swap
btnSpectatorSwap = env->addButton(rect<s32>(205, 100, 295, 135), 0, BUTTON_REPLAY_SWAP, dataManager.GetSysString(1346)); btnSpectatorSwap = env->addButton(rect<s32>(205, 100, 295, 135), 0, BUTTON_REPLAY_SWAP, dataManager.GetSysString(1346));
btnSpectatorSwap->setVisible(false); btnSpectatorSwap->setVisible(false);
btnHandSwap = env->addButton(rect<s32>(205, 100, 295, 135), 0, BUTTON_HAND_SWAP, dataManager.GetSysString(1346));
btnHandSwap->setVisible(false);
//chain buttons //chain buttons
btnChainIgnore = env->addButton(rect<s32>(205, 100, 295, 135), 0, BUTTON_CHAIN_IGNORE, dataManager.GetSysString(1292)); btnChainIgnore = env->addButton(rect<s32>(205, 100, 295, 135), 0, BUTTON_CHAIN_IGNORE, dataManager.GetSysString(1292));
btnChainAlways = env->addButton(rect<s32>(205, 140, 295, 175), 0, BUTTON_CHAIN_ALWAYS, dataManager.GetSysString(1293)); btnChainAlways = env->addButton(rect<s32>(205, 140, 295, 175), 0, BUTTON_CHAIN_ALWAYS, dataManager.GetSysString(1293));
...@@ -1428,6 +1430,7 @@ void Game::CloseDuelWindow() { ...@@ -1428,6 +1430,7 @@ void Game::CloseDuelWindow() {
btnSideOK->setVisible(false); btnSideOK->setVisible(false);
btnLeaveGame->setVisible(false); btnLeaveGame->setVisible(false);
btnSpectatorSwap->setVisible(false); btnSpectatorSwap->setVisible(false);
btnHandSwap->setVisible(false);
btnChainIgnore->setVisible(false); btnChainIgnore->setVisible(false);
btnChainAlways->setVisible(false); btnChainAlways->setVisible(false);
btnChainWhenAvail->setVisible(false); btnChainWhenAvail->setVisible(false);
...@@ -1587,6 +1590,7 @@ void Game::OnResize() ...@@ -1587,6 +1590,7 @@ void Game::OnResize()
wCreateHost->setRelativePosition(ResizeWin(320, 100, 700, 520)); wCreateHost->setRelativePosition(ResizeWin(320, 100, 700, 520));
wHostPrepare->setRelativePosition(ResizeWin(270, 120, 750, 440)); wHostPrepare->setRelativePosition(ResizeWin(270, 120, 750, 440));
wHostPrepare2->setRelativePosition(ResizeWin(750, 120, 950, 440)); wHostPrepare2->setRelativePosition(ResizeWin(750, 120, 950, 440));
wHostPrepare3->setRelativePosition(ResizeWin(70, 120, 270, 440));
wRules->setRelativePosition(ResizeWin(630, 100, 1000, 310)); wRules->setRelativePosition(ResizeWin(630, 100, 1000, 310));
wCustomRules->setRelativePosition(ResizeWin(700, 100, 910, 410)); wCustomRules->setRelativePosition(ResizeWin(700, 100, 910, 410));
wReplay->setRelativePosition(ResizeWin(220, 100, 800, 520)); wReplay->setRelativePosition(ResizeWin(220, 100, 800, 520));
...@@ -1671,6 +1675,7 @@ void Game::OnResize() ...@@ -1671,6 +1675,7 @@ void Game::OnResize()
btnShuffle->setRelativePosition(Resize(0, 0, 50, 20)); btnShuffle->setRelativePosition(Resize(0, 0, 50, 20));
} }
btnSpectatorSwap->setRelativePosition(Resize(205, 100, 295, 135)); btnSpectatorSwap->setRelativePosition(Resize(205, 100, 295, 135));
btnHandSwap->setRelativePosition(Resize(205, 100, 295, 135));
btnChainAlways->setRelativePosition(Resize(205, 140, 295, 175)); btnChainAlways->setRelativePosition(Resize(205, 140, 295, 175));
btnChainIgnore->setRelativePosition(Resize(205, 100, 295, 135)); btnChainIgnore->setRelativePosition(Resize(205, 100, 295, 135));
btnChainWhenAvail->setRelativePosition(Resize(205, 180, 295, 215)); btnChainWhenAvail->setRelativePosition(Resize(205, 180, 295, 215));
......
...@@ -642,5 +642,12 @@ extern Game* mainGame; ...@@ -642,5 +642,12 @@ extern Game* mainGame;
#define BUTTON_MARKS_FILTER 380 #define BUTTON_MARKS_FILTER 380
#define BUTTON_MARKERS_OK 381 #define BUTTON_MARKERS_OK 381
#define CHECKBOX_OBSOLETE 390
#define CHECKBOX_DRAW 391
#define CHECKBOX_FIELD 392
#define CHECKBOX_PZONE 393
#define CHECKBOX_SEPARATE_PZONE 394
#define CHECKBOX_EMZONE 395
#define DEFAULT_DUEL_RULE 4 #define DEFAULT_DUEL_RULE 4
#endif // GAME_H #endif // GAME_H
...@@ -32,9 +32,9 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) { ...@@ -32,9 +32,9 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
case irr::EET_GUI_EVENT: { case irr::EET_GUI_EVENT: {
irr::gui::IGUIElement* caller = event.GUIEvent.Caller; irr::gui::IGUIElement* caller = event.GUIEvent.Caller;
s32 id = caller->getID(); s32 id = caller->getID();
if(mainGame->wRules->isVisible() && (id != BUTTON_RULE_OK && (id <CHECK_SEALED_DUEL || id>CHECK_DECK_MASTER_DUEL))) if(mainGame->wRules->isVisible() && (id != BUTTON_RULE_OK && (id < CHECK_SEALED_DUEL || id > CHECK_DECK_MASTER_DUEL)))
break; break;
if(mainGame->wCustomRules->isVisible() && id != BUTTON_CUSTOM_RULE_OK) if(mainGame->wCustomRules->isVisible() && id != BUTTON_CUSTOM_RULE_OK && (id < CHECKBOX_OBSOLETE || id > CHECKBOX_EMZONE))
break; break;
switch(event.GUIEvent.EventType) { switch(event.GUIEvent.EventType) {
case irr::gui::EGET_ELEMENT_HOVERED: { case irr::gui::EGET_ELEMENT_HOVERED: {
...@@ -156,17 +156,14 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) { ...@@ -156,17 +156,14 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
} }
} }
uint32 filter = 0x100; uint32 filter = 0x100;
for (int i = 0; i < 6; ++i, filter <<= 1) for (int i = 0; i < 6; ++i, filter <<= 1) {
if (mainGame->duel_param & filter) mainGame->chkCustomRules[i]->setChecked(mainGame->duel_param & filter);
mainGame->chkCustomRules[i]->setChecked(true); if(i == 3)
else mainGame->chkCustomRules[4]->setEnabled(mainGame->duel_param & filter);
mainGame->chkCustomRules[i]->setChecked(false); }
uint32 limits[] = { TYPE_FUSION, TYPE_SYNCHRO, TYPE_XYZ, TYPE_PENDULUM, TYPE_LINK }; uint32 limits[] = { TYPE_FUSION, TYPE_SYNCHRO, TYPE_XYZ, TYPE_PENDULUM, TYPE_LINK };
for (int i = 0; i < 5; ++i, filter <<= 1) for (int i = 0; i < 5; ++i, filter <<= 1)
if (mainGame->forbiddentypes & limits[i]) mainGame->chkTypeLimit[i]->setChecked(mainGame->forbiddentypes & limits[i]);
mainGame->chkTypeLimit[i]->setChecked(true);
else
mainGame->chkTypeLimit[i]->setChecked(false);
mainGame->PopupElement(mainGame->wCustomRules); mainGame->PopupElement(mainGame->wCustomRules);
break; break;
} }
...@@ -511,6 +508,14 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) { ...@@ -511,6 +508,14 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
} }
break; break;
} }
case CHECKBOX_PZONE: {
if(static_cast<irr::gui::IGUICheckBox*>(caller)->isChecked())
mainGame->chkCustomRules[4]->setEnabled(true);
else {
mainGame->chkCustomRules[4]->setChecked(false);
mainGame->chkCustomRules[4]->setEnabled(false);
}
}
} }
break; break;
} }
...@@ -570,12 +575,6 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) { ...@@ -570,12 +575,6 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
break; break;
} }
} }
uint32 filter = 0x100;
for (int i = 0; i < 6; ++i, filter <<= 1)
if (mainGame->duel_param & filter)
mainGame->chkCustomRules[i]->setChecked(true);
else
mainGame->chkCustomRules[i]->setChecked(false);
} }
} }
} }
......
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