Commit ff099fd7 authored by fallenstardust's avatar fallenstardust

整理

parent 3b730444
......@@ -235,36 +235,6 @@ bool Game::Initialize() {
btnJoinHost = env->addButton(rect<s32>(460 * xScale, 380 * yScale, 590 * xScale, 420 * yScale), wLanWindow, BUTTON_JOIN_HOST, dataManager.GetSysString(1223));
btnJoinCancel = env->addButton(rect<s32>(460 * xScale, 430 * yScale, 590 * xScale, 470 * yScale), wLanWindow, BUTTON_JOIN_CANCEL, dataManager.GetSysString(1212));
btnCreateHost = env->addButton(rect<s32>(460 * xScale, 25 * yScale, 590 * xScale, 65 * yScale), wLanWindow, BUTTON_CREATE_HOST, dataManager.GetSysString(1224));
#else
wMainMenu = env->addWindow(rect<s32>(370 * xScale, 200 * yScale, 650 * xScale, 415 * yScale), false, strbuf);
wMainMenu->getCloseButton()->setVisible(false);
btnLanMode = env->addButton(rect<s32>(10 * xScale, 30 * yScale, 270 * xScale, 60 * yScale), wMainMenu, BUTTON_LAN_MODE, dataManager.GetSysString(1200));
btnSingleMode = env->addButton(rect<s32>(10 * xScale, 65 * yScale, 270 * xScale, 95 * yScale), wMainMenu, BUTTON_SINGLE_MODE, dataManager.GetSysString(1201));
btnReplayMode = env->addButton(rect<s32>(10 * xScale, 100 * yScale, 270 * xScale, 130 * yScale), wMainMenu, BUTTON_REPLAY_MODE, dataManager.GetSysString(1202));
// btnTestMode = env->addButton(rect<s32>(10, 135, 270, 165), wMainMenu, BUTTON_TEST_MODE, dataManager.GetSysString(1203));
btnDeckEdit = env->addButton(rect<s32>(10 * xScale, 135 * yScale, 270 * xScale, 165 * yScale), wMainMenu, BUTTON_DECK_EDIT, dataManager.GetSysString(1204));
btnModeExit = env->addButton(rect<s32>(10 * xScale, 170 * yScale, 270 * xScale, 200 * yScale), wMainMenu, BUTTON_MODE_EXIT, dataManager.GetSysString(1210));
//lan mode
wLanWindow = env->addWindow(rect<s32>(220 * xScale, 100 * yScale, 800 * xScale, 520 * yScale), false, dataManager.GetSysString(1200));
wLanWindow->getCloseButton()->setVisible(false);
wLanWindow->setVisible(false);
env->addStaticText(dataManager.GetSysString(1220), rect<s32>(10 * xScale, 30 * yScale, 220 * xScale, 50 * yScale), false, false, wLanWindow);
ebNickName = env->addEditBox(gameConf.nickname, rect<s32>(110 * xScale, 25 * yScale, 450 * xScale, 50 * yScale), true, wLanWindow);
ebNickName->setTextAlignment(irr::gui::EGUIA_UPPERLEFT, irr::gui::EGUIA_CENTER);
lstHostList = env->addListBox(rect<s32>(10 * xScale, 60 * yScale, 570 * xScale, 320 * yScale), wLanWindow, LISTBOX_LAN_HOST, true);
lstHostList->setItemHeight(18 * yScale);
btnLanRefresh = env->addButton(rect<s32>(240 * xScale, 325 * yScale, 340 * xScale, 350 * yScale), wLanWindow, BUTTON_LAN_REFRESH, dataManager.GetSysString(1217));
env->addStaticText(dataManager.GetSysString(1221), rect<s32>(10 * xScale, 360 * yScale, 220 * xScale, 380 * yScale), false, false, wLanWindow);
ebJoinHost = env->addEditBox(gameConf.lasthost, rect<s32>(110 * xScale, 355 * yScale, 350 * xScale, 380 * yScale), true, wLanWindow);
ebJoinHost->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
ebJoinPort = env->addEditBox(gameConf.lastport, rect<s32>(360 * xScale, 355 * yScale, 420 * xScale, 380 * yScale), true, wLanWindow);
ebJoinPort->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
env->addStaticText(dataManager.GetSysString(1222), rect<s32>(10 * xScale, 390 * yScale, 220 * xScale, 410 * yScale), false, false, wLanWindow);
ebJoinPass = env->addEditBox(gameConf.roompass, rect<s32>(110 * xScale, 385 * yScale, 420 * xScale, 410 * yScale), true, wLanWindow);
ebJoinPass->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
btnJoinHost = env->addButton(rect<s32>(460 * xScale, 355 * yScale, 570 * xScale, 380 * yScale), wLanWindow, BUTTON_JOIN_HOST, dataManager.GetSysString(1223));
btnJoinCancel = env->addButton(rect<s32>(460 * xScale, 385 * yScale, 570 * xScale, 410 * yScale), wLanWindow, BUTTON_JOIN_CANCEL, dataManager.GetSysString(1212));
btnCreateHost = env->addButton(rect<s32>(460 * xScale, 25 * yScale, 570 * xScale, 50 * yScale), wLanWindow, BUTTON_CREATE_HOST, dataManager.GetSysString(1224));
#endif
//create host
wCreateHost = env->addWindow(rect<s32>(320 * xScale, 100 * yScale, 700 * xScale, 520 * yScale), false, dataManager.GetSysString(1224));
......@@ -273,8 +243,6 @@ bool Game::Initialize() {
env->addStaticText(dataManager.GetSysString(1226), rect<s32>(20 * xScale, 30 * yScale, 220 * xScale, 50 * yScale), false, false, wCreateHost);
#ifdef _IRR_ANDROID_PLATFORM_
cbLFlist = CAndroidGUIComboBox::addAndroidComboBox(env, rect<s32>(140 * xScale, 25 * yScale, 300 * xScale, 50 * yScale), wCreateHost);
#else
cbLFlist = env->addComboBox(rect<s32>(140 * xScale, 25 * yScale, 300 * xScale, 50 * yScale), wCreateHost);
#endif
std::vector<LFList>::iterator iter;
for (iter = deckManager._lfList.begin(); iter != deckManager._lfList.end(); iter++) {
......@@ -283,8 +251,6 @@ bool Game::Initialize() {
env->addStaticText(dataManager.GetSysString(1225), rect<s32>(20 * xScale, 60 * yScale, 220 * xScale, 80 * yScale), false, false, wCreateHost);
#ifdef _IRR_ANDROID_PLATFORM_
cbRule = CAndroidGUIComboBox::addAndroidComboBox(env, rect<s32>(140 * xScale, 55 * yScale, 300 * xScale, 80 * yScale), wCreateHost);
#else
cbRule = env->addComboBox(rect<s32>(140 * xScale, 55 * yScale, 300 * xScale, 80 * yScale), wCreateHost);
#endif
cbRule->addItem(dataManager.GetSysString(1240));
cbRule->addItem(dataManager.GetSysString(1241));
......@@ -294,8 +260,6 @@ bool Game::Initialize() {
env->addStaticText(dataManager.GetSysString(1227), rect<s32>(20 * xScale, 90 * yScale, 220 * xScale, 110 * yScale), false, false, wCreateHost);
#ifdef _IRR_ANDROID_PLATFORM_
cbMatchMode = CAndroidGUIComboBox::addAndroidComboBox(env, rect<s32>(140 * xScale, 85 * yScale, 300 * xScale, 110 * yScale), wCreateHost);
#else
cbMatchMode = env->addComboBox(rect<s32>(140 * xScale, 85 * yScale, 300 * xScale, 110 * yScale), wCreateHost);
#endif
cbMatchMode->addItem(dataManager.GetSysString(1244));
cbMatchMode->addItem(dataManager.GetSysString(1245));
......@@ -304,8 +268,6 @@ bool Game::Initialize() {
myswprintf(strbuf, L"%d", 180);
#ifdef _IRR_ANDROID_PLATFORM_
ebTimeLimit = CAndroidGUIEditBox::addAndroidEditBox(strbuf, true, env, rect<s32>(140 * xScale, 115 * yScale, 220 * xScale, 140 * yScale), wCreateHost);
#else
ebTimeLimit = env->addEditBox(strbuf, rect<s32>(140 * xScale, 115 * yScale, 220 * xScale, 140 * yScale), true, wCreateHost);
#endif
ebTimeLimit->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
env->addStaticText(dataManager.GetSysString(1228), rect<s32>(20 * xScale, 150 * yScale, 320 * xScale, 170 * yScale), false, false, wCreateHost);
......@@ -322,38 +284,28 @@ bool Game::Initialize() {
myswprintf(strbuf, L"%d", 8000);
#ifdef _IRR_ANDROID_PLATFORM_
ebStartLP = CAndroidGUIEditBox::addAndroidEditBox(strbuf, true, env, rect<s32>(140 * xScale, 235 * yScale, 220 * xScale, 260 * yScale), wCreateHost);
#else
ebStartLP = env->addEditBox(strbuf, rect<s32>(140 * xScale, 235 * yScale, 220 * xScale, 260 * yScale), true, wCreateHost);
#endif
ebStartLP->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
env->addStaticText(dataManager.GetSysString(1232), rect<s32>(20 * xScale, 270 * yScale, 320 * xScale, 290 * yScale), false, false, wCreateHost);
myswprintf(strbuf, L"%d", 5);
#ifdef _IRR_ANDROID_PLATFORM_
ebStartHand = CAndroidGUIEditBox::addAndroidEditBox(strbuf, true, env, rect<s32>(140 * xScale, 265 * yScale, 220 * xScale, 290 * yScale), wCreateHost);
#else
ebStartHand = env->addEditBox(strbuf, rect<s32>(140 * xScale, 265 * yScale, 220 * xScale, 290 * yScale), true, wCreateHost);
#endif
ebStartHand->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
env->addStaticText(dataManager.GetSysString(1233), rect<s32>(20 * xScale, 300 * yScale, 320 * xScale, 320 * yScale), false, false, wCreateHost);
myswprintf(strbuf, L"%d", 1);
#ifdef _IRR_ANDROID_PLATFORM_
ebDrawCount = CAndroidGUIEditBox::addAndroidEditBox(strbuf, true, env, rect<s32>(140 * xScale, 295 * yScale, 220 * xScale, 320 * yScale), wCreateHost);
#else
ebDrawCount = env->addEditBox(strbuf, rect<s32>(140 * xScale, 295 * yScale, 220 * xScale, 320 * yScale), true, wCreateHost);
#endif
ebDrawCount->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
env->addStaticText(dataManager.GetSysString(1234), rect<s32>(10 * xScale, 360 * yScale, 220 * xScale, 380 * yScale), false, false, wCreateHost);
#ifdef _IRR_ANDROID_PLATFORM_
ebServerName = CAndroidGUIEditBox::addAndroidEditBox(gameConf.gamename, true, env, rect<s32>(110 * xScale, 355 * yScale, 250 * xScale, 380 * yScale), wCreateHost);
#else
ebServerName = env->addEditBox(gameConf.gamename, rect<s32>(110 * xScale, 355 * yScale, 250 * xScale, 380 * yScale), true, wCreateHost);
#endif
ebServerName->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
env->addStaticText(dataManager.GetSysString(1235), rect<s32>(10 * xScale, 390 * yScale, 220 * xScale, 410 * yScale), false, false, wCreateHost);
#ifdef _IRR_ANDROID_PLATFORM_
ebServerPass = CAndroidGUIEditBox::addAndroidEditBox(L"", true, env, rect<s32>(110 * xScale, 385 * yScale, 250 * xScale, 410 * yScale), wCreateHost);
#else
ebServerPass = env->addEditBox(L"", rect<s32>(110 * xScale, 385 * yScale, 250 * xScale, 410 * yScale), true, wCreateHost);
#endif
ebServerPass->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
btnHostConfirm = env->addButton(rect<s32>(260 * xScale, 355 * yScale, 370 * xScale, 380 * yScale), wCreateHost, BUTTON_HOST_CONFIRM, dataManager.GetSysString(1211));
......@@ -423,35 +375,6 @@ bool Game::Initialize() {
btnHostPrepCancel = env->addButton(
rect<s32>(400 * xScale, 380 * yScale, 510 * xScale, 405 * yScale),
wHostPrepare, BUTTON_HP_CANCEL, dataManager.GetSysString(1210));
#else
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));
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);
btnHostPrepKick[i] = env->addButton(rect<s32>(10, 65 + i * 25, 30, 85 + i * 25), wHostPrepare, BUTTON_HP_KICK, L"X");
chkHostPrepReady[i] = env->addCheckBox(false, rect<s32>(250, 65 + i * 25, 270, 85 + i * 25), wHostPrepare, CHECKBOX_HP_READY, L"");
chkHostPrepReady[i]->setEnabled(false);
}
for(int i = 2; i < 4; ++i) {
stHostPrepDuelist[i] = env->addStaticText(L"", rect<s32>(40, 75 + i * 25, 240, 95 + i * 25), true, false, wHostPrepare);
btnHostPrepKick[i] = env->addButton(rect<s32>(10, 75 + i * 25, 30, 95 + i * 25), wHostPrepare, BUTTON_HP_KICK, L"X");
chkHostPrepReady[i] = env->addCheckBox(false, rect<s32>(250, 75 + i * 25, 270, 95 + i * 25), wHostPrepare, CHECKBOX_HP_READY, L"");
chkHostPrepReady[i]->setEnabled(false);
}
btnHostPrepOB = env->addButton(rect<s32>(10, 180, 110, 205), wHostPrepare, BUTTON_HP_OBSERVER, dataManager.GetSysString(1252));
myswprintf(dataManager.strBuffer, L"%ls%d", dataManager.GetSysString(1253), 0);
stHostPrepOB = env->addStaticText(dataManager.strBuffer, rect<s32>(10, 210, 270, 230), false, false, wHostPrepare);
stHostPrepRule = env->addStaticText(L"", rect<s32>(280, 30, 460, 230), false, true, wHostPrepare);
env->addStaticText(dataManager.GetSysString(1254), rect<s32>(10, 235, 110, 255), false, false, wHostPrepare);
cbDeckSelect = env->addComboBox(rect<s32>(120, 230, 270, 255), wHostPrepare);
cbDeckSelect->setMaxSelectionRows(10);
btnHostPrepReady = env->addButton(rect<s32>(170, 180, 270, 205), wHostPrepare, BUTTON_HP_READY, dataManager.GetSysString(1218));
btnHostPrepNotReady = env->addButton(rect<s32>(170, 180, 270, 205), wHostPrepare, BUTTON_HP_NOTREADY, dataManager.GetSysString(1219));
btnHostPrepNotReady->setVisible(false);
btnHostPrepStart = env->addButton(rect<s32>(230, 280, 340, 305), wHostPrepare, BUTTON_HP_START, dataManager.GetSysString(1215));
btnHostPrepCancel = env->addButton(rect<s32>(350, 280, 460, 305), wHostPrepare, BUTTON_HP_CANCEL, dataManager.GetSysString(1210));
#endif
//img
......@@ -476,20 +399,6 @@ bool Game::Initialize() {
btnM2->setVisible(false);
btnEP = env->addButton(rect<s32>(320 * xScale, 0 * yScale, 370 * xScale, 30 * yScale), wPhase, BUTTON_EP, L"\xff25\xff30");
btnEP->setVisible(false);
#else
//phase
wPhase = env->addStaticText(L"", rect<s32>(480, 310, 855, 330));
wPhase->setVisible(false);
btnPhaseStatus = env->addButton(rect<s32>(0, 0, 50, 20), wPhase, BUTTON_PHASE, L"");
btnPhaseStatus->setIsPushButton(true);
btnPhaseStatus->setPressed(true);
btnPhaseStatus->setVisible(false);
btnBP = env->addButton(rect<s32>(160, 0, 210, 20), wPhase, BUTTON_BP, L"\xff22\xff30");
btnBP->setVisible(false);
btnM2 = env->addButton(rect<s32>(160, 0, 210, 20), wPhase, BUTTON_M2, L"\xff2d\xff12");
btnM2->setVisible(false);
btnEP = env->addButton(rect<s32>(320, 0, 370, 20), wPhase, BUTTON_EP, L"\xff25\xff30");
btnEP->setVisible(false);
#endif
//tab
wInfos = env->addTabControl(rect<s32>(1 * xScale, 275 * yScale, 301 * xScale, 639 * yScale), 0, true);
......@@ -509,8 +418,6 @@ bool Game::Initialize() {
stText = env->addStaticText(L"", rect<s32>(15 * xScale, 106 * yScale, 287 * xScale, 324 * yScale), false, true, tabInfo, -1, false);
#ifdef _IRR_ANDROID_PLATFORM_
scrCardText = env->addScrollBar(false, rect<s32>(425 * xScale, 106 * yScale, 495 * xScale, 580 * yScale), tabInfo, SCROLL_CARDTEXT);
#else
scrCardText = env->addScrollBar(false, rect<s32>(267 * xScale, 106 * yScale, 287 * xScale, 324 * yScale), tabInfo, SCROLL_CARDTEXT);
#endif
scrCardText->setLargeStep(1);
scrCardText->setSmallStep(1);
......@@ -519,8 +426,6 @@ bool Game::Initialize() {
irr::gui::IGUITab* tabLog = wInfos->addTab(dataManager.GetSysString(1271));
#ifdef _IRR_ANDROID_PLATFORM_
lstLog = CAndroidGUIListBox::addAndroidGUIListBox(env, rect<s32>(10 * xScale, 10 * yScale, 290 * xScale, 290 * yScale), tabLog, LISTBOX_LOG, false, 40 * xScale);
#else
lstLog = env->addListBox(rect<s32>(10 * xScale, 10 * yScale, 290 * xScale, 290 * yScale), tabLog, LISTBOX_LOG, false);
#endif
lstLog->setItemHeight(22 * yScale);
btnClearLog = env->addButton(rect<s32>(160 * xScale, 300 * yScale, 260 * xScale, 325 * yScale), tabLog, BUTTON_CLEAR_LOG, dataManager.GetSysString(1272));
......@@ -658,9 +563,6 @@ bool Game::Initialize() {
}
scrDisplayList = env->addScrollBar(true, rect<s32>(30 * xScale, 235 * yScale, 650 * xScale, 255 * yScale), wCardDisplay, SCROLL_CARD_DISPLAY);
btnDisplayOK = env->addButton(rect<s32>(300 * xScale, 265 * yScale, 380 * xScale, 290 * yScale), wCardDisplay, BUTTON_CARD_DISP_OK, dataManager.GetSysString(1211));
#else
scrCardList = env->addScrollBar(true, rect<s32>(30 * xScale, 235 * yScale, 650 * xScale, 255 * yScale), wCardSelect, SCROLL_CARD_SELECT);
btnSelectOK = env->addButton(rect<s32>(300 * xScale, 265 * yScale, 380 * xScale, 290 * yScale), wCardSelect, BUTTON_CARD_SEL_OK, dataManager.GetSysString(1211));
#endif
//announce number
wANNumber = env->addWindow(rect<s32>(550 * xScale, 200 * yScale, 780 * xScale, 295 * yScale), false, L"");
......@@ -668,8 +570,6 @@ bool Game::Initialize() {
wANNumber->setVisible(false);
#ifdef _IRR_ANDROID_PLATFORM_
cbANNumber = CAndroidGUIComboBox::addAndroidComboBox(env, rect<s32>(40 * xScale, 30 * yScale, 190 * xScale, 50 * yScale), wANNumber, -1);
#else
cbANNumber = env->addComboBox(rect<s32>(40 * xScale, 30 * yScale, 190 * xScale, 50 * yScale), wANNumber, -1);
#endif
cbANNumber->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
btnANNumberOK = env->addButton(rect<s32>(80 * xScale, 60 * yScale, 150 * xScale, 85 * yScale), wANNumber, BUTTON_ANNUMBER_OK, dataManager.GetSysString(1211));
......@@ -680,9 +580,6 @@ bool Game::Initialize() {
#ifdef _IRR_ANDROID_PLATFORM_
ebANCard = CAndroidGUIEditBox::addAndroidEditBox(L"", true, env, rect<s32>(20 * xScale, 25 * yScale, 380 * xScale, 55 * yScale), wANCard, EDITBOX_ANCARD);
lstANCard = CAndroidGUIListBox::addAndroidGUIListBox(env, rect<s32>(20 * xScale, 55 * yScale, 380 * xScale, 260 * yScale), wANCard, LISTBOX_ANCARD, true, 40 * xScale);
#else
ebANCard = env->addEditBox(L"", rect<s32>(20, 25, 190, 45), true, wANCard, EDITBOX_ANCARD);
lstANCard = env->addListBox(rect<s32>(20, 50, 190, 160), wANCard, LISTBOX_ANCARD, true);
#endif
ebANCard->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
//dont merge
......@@ -726,17 +623,6 @@ bool Game::Initialize() {
btnShowList = env->addButton(rect<s32>(1 * xScale, 289 * yScale, 99 * xScale, 329 * yScale), wCmdMenu, BUTTON_CMD_SHOWLIST, dataManager.GetSysString(1158));
btnOperation = env->addButton(rect<s32>(1 * xScale, 169 * yScale, 100 * xScale, 209 * yScale), wCmdMenu, BUTTON_CMD_ACTIVATE, dataManager.GetSysString(1161));
btnReset = env->addButton(rect<s32>(1 * xScale, 190 * yScale , 99 * xScale, 210 * yScale), wCmdMenu, BUTTON_CMD_RESET, dataManager.GetSysString(1162));
#else
btnActivate = env->addButton(rect<s32>(1, 1, 99, 21), wCmdMenu, BUTTON_CMD_ACTIVATE, dataManager.GetSysString(1150));
btnSummon = env->addButton(rect<s32>(1, 22, 99, 42), wCmdMenu, BUTTON_CMD_SUMMON, dataManager.GetSysString(1151));
btnSPSummon = env->addButton(rect<s32>(1, 43, 99, 63), wCmdMenu, BUTTON_CMD_SPSUMMON, dataManager.GetSysString(1152));
btnMSet = env->addButton(rect<s32>(1, 64, 99, 84), wCmdMenu, BUTTON_CMD_MSET, dataManager.GetSysString(1153));
btnSSet = env->addButton(rect<s32>(1, 85, 99, 105), wCmdMenu, BUTTON_CMD_SSET, dataManager.GetSysString(1153));
btnRepos = env->addButton(rect<s32>(1, 106, 99, 126), wCmdMenu, BUTTON_CMD_REPOS, dataManager.GetSysString(1154));
btnAttack = env->addButton(rect<s32>(1, 127, 99, 147), wCmdMenu, BUTTON_CMD_ATTACK, dataManager.GetSysString(1157));
btnShowList = env->addButton(rect<s32>(1, 148, 99, 168), wCmdMenu, BUTTON_CMD_SHOWLIST, dataManager.GetSysString(1158));
btnOperation = env->addButton(rect<s32>(1, 169, 99, 189), wCmdMenu, BUTTON_CMD_ACTIVATE, dataManager.GetSysString(1161));
btnReset = env->addButton(rect<s32>(1, 190, 99, 210), wCmdMenu, BUTTON_CMD_RESET, dataManager.GetSysString(1162));
#endif
//deck edit
wDeckEdit = env->addStaticText(L"", rect<s32>(309 * xScale, 8 * yScale, 605 * xScale, 130 * yScale), true, false, 0, -1, true);
......@@ -758,8 +644,6 @@ bool Game::Initialize() {
btnSaveDeck = env->addButton(rect<s32>(225 * xScale, 35 * yScale, 290 * xScale, 60 * yScale), wDeckEdit, BUTTON_SAVE_DECK, dataManager.GetSysString(1302));
#ifdef _IRR_ANDROID_PLATFORM_
ebDeckname = CAndroidGUIEditBox::addAndroidEditBox(L"", true, env, rect<s32>(80 * xScale, 65 * yScale, 220 * xScale, 90 * yScale), wDeckEdit, -1);
#else
ebDeckname = env->addEditBox(L"", rect<s32>(80 * xScale, 65 * yScale, 220 * xScale, 90 * yScale), true, wDeckEdit, -1);
#endif
ebDeckname->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
btnSaveDeckAs = env->addButton(rect<s32>(225 * xScale, 65 * yScale, 290 * xScale, 90 * yScale), wDeckEdit, BUTTON_SAVE_DECK_AS, dataManager.GetSysString(1303));
......@@ -798,29 +682,19 @@ bool Game::Initialize() {
cbSortType->addItem(dataManager.GetSysString(i));
wSort->setVisible(false);
//filters
#ifdef _IRR_ANDROID_PLATFORM_
wFilter = env->addStaticText(L"", rect<s32>(610 * xScale, 8 * yScale, 1020 * xScale, 130 * yScale), true, false, 0, -1, true);
wFilter->setVisible(false);
env->addStaticText(dataManager.GetSysString(1311), rect<s32>(10 * xScale, 5 * yScale, 70 * xScale, 25 * yScale), false, false, wFilter);
#ifdef _IRR_ANDROID_PLATFORM_
cbCardType = CAndroidGUIComboBox::addAndroidComboBox(env, rect<s32>(60 * xScale, 3 * yScale, 120 * xScale, 23 * yScale), wFilter, COMBOBOX_MAINTYPE);
#else
cbCardType = env->addComboBox(rect<s32>(60 * xScale, 3 * yScale, 120 * xScale, 23 * yScale), wFilter, COMBOBOX_MAINTYPE);
#endif
cbCardType->addItem(dataManager.GetSysString(1310));
cbCardType->addItem(dataManager.GetSysString(1312));
cbCardType->addItem(dataManager.GetSysString(1313));
cbCardType->addItem(dataManager.GetSysString(1314));
#ifdef _IRR_ANDROID_PLATFORM_
cbCardType2 = CAndroidGUIComboBox::addAndroidComboBox(env, rect<s32>(125 * xScale, 3 * yScale, 200 * xScale, 23 * yScale), wFilter, COMBOBOX_SECONDTYPE);
#else
cbCardType2 = env->addComboBox(rect<s32>(125 * xScale, 3 * yScale, 200 * xScale, 23 * yScale), wFilter, COMBOBOX_SECONDTYPE);
#endif
cbCardType2->addItem(dataManager.GetSysString(1310), 0);
env->addStaticText(dataManager.GetSysString(1315), rect<s32>(205 * xScale, 5 * yScale, 280 * xScale, 25 * yScale), false, false, wFilter);
#ifdef _IRR_ANDROID_PLATFORM_
cbLimit = CAndroidGUIComboBox::addAndroidComboBox(env, rect<s32>(260 * xScale, 3 * yScale, 390 * xScale, 23 * yScale), wFilter, COMBOBOX_LIMIT);
#else
cbLimit = env->addComboBox(rect<s32>(260 * xScale, 3 * yScale, 390 * xScale, 23 * yScale), wFilter, COMBOBOX_LIMIT);
#endif
cbLimit->addItem(dataManager.GetSysString(1310));
cbLimit->addItem(dataManager.GetSysString(1316));
......@@ -872,8 +746,6 @@ bool Game::Initialize() {
env->addStaticText(dataManager.GetSysString(1336), rect<s32>(101 * xScale, (62 + 100 / 6) * yScale, 150 * xScale, (82 + 100 / 6) * yScale), false, false, wFilter);
#ifdef _IRR_ANDROID_PLATFORM_
ebScale = CAndroidGUIEditBox::addAndroidEditBox(L"", true, env, rect<s32>(150 * xScale, (60 + 100 / 6) * yScale, 190 * xScale, (80 + 100 / 6) * yScale), wFilter);
#else
ebScale = env->addEditBox(L"", rect<s32>(150, 60 + 100 / 6, 190, 80 + 100 / 6), true, wFilter);
#endif
ebScale->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
env->addStaticText(dataManager.GetSysString(1325), rect<s32>(205 * xScale, (62 + 100 / 6) * yScale, 280 * xScale, (82 + 100 / 6) * yScale), false, false, wFilter);
......@@ -946,9 +818,9 @@ bool Game::Initialize() {
wSinglePlay->getCloseButton()->setVisible(false);
wSinglePlay->setVisible(false);
irr::gui::IGUITabControl* wSingle = env->addTabControl(rect<s32>(0 * xScale, 20 * yScale, 579 * xScale, 419 * yScale), wSinglePlay, true);
wSingle->setTabHeight(35 * yScale);
wSingle->setTabHeight(40 * yScale);
//TEST BOT MODE
// if(gameConf.enable_bot_mode) {
if(gameConf.enable_bot_mode) {
irr::gui::IGUITab* tabBot = wSingle->addTab(dataManager.GetSysString(1380));
lstBotList = CAndroidGUIListBox::addAndroidGUIListBox(env, rect<s32>(10 * xScale, 10 * yScale, 350 * xScale, 350 * yScale), tabBot, LISTBOX_BOT_LIST, true, 40 * xScale);
lstBotList->setItemHeight(25 * yScale);
......@@ -960,13 +832,13 @@ bool Game::Initialize() {
chkBotHand = env->addCheckBox(false, rect<s32>(360 * xScale, 170 * yScale, 560 * xScale, 190 * yScale), tabBot, -1, dataManager.GetSysString(1384));
chkBotNoCheckDeck = env->addCheckBox(false, rect<s32>(360 * xScale, 200 * yScale, 560 * xScale, 220 * yScale), tabBot, -1, dataManager.GetSysString(1229));
chkBotNoShuffleDeck = env->addCheckBox(false, rect<s32>(360 * xScale, 230 * yScale, 560 * xScale, 250 * yScale), tabBot, -1, dataManager.GetSysString(1230));
/* } else { // avoid null pointer
} else { // avoid null pointer
btnStartBot = env->addButton(rect<s32>(0, 0, 0, 0), wSinglePlay);
btnBotCancel = env->addButton(rect<s32>(0, 0, 0, 0), wSinglePlay);
btnStartBot->setVisible(false);
btnBotCancel->setVisible(false);
}*/
}
//SINGLE MODE
irr::gui::IGUITab* tabSingle = wSingle->addTab(dataManager.GetSysString(1381));
lstSinglePlayList = CAndroidGUIListBox::addAndroidGUIListBox(env, rect<s32>(10 * xScale, 10 * yScale, 350 * xScale, 350 * yScale), tabSingle, LISTBOX_SINGLEPLAY_LIST, true, 40 * xScale);
lstSinglePlayList->setItemHeight(25 * yScale);
......@@ -998,105 +870,14 @@ bool Game::Initialize() {
wChat->setDraggable(false);
wChat->setDrawTitlebar(false);
wChat->setVisible(false);
ebChatInput = CAndroidGUIEditBox::addAndroidEditBox(L"", true, env, rect<s32>(3 * xScale, 2 * yScale, 710 * xScale, 22 * yScale), wChat, EDITBOX_CHAT);
//swap
btnSpectatorSwap = env->addButton(rect<s32>(205 * xScale, 100 * yScale, 305 * xScale, 135 * yScale), 0, BUTTON_REPLAY_SWAP, dataManager.GetSysString(1346));
btnSpectatorSwap->setVisible(false);
//chain buttons
btnChainIgnore = env->addButton(rect<s32>(205 * xScale, 100 * yScale, 305 * xScale, 135 * yScale), 0, BUTTON_CHAIN_IGNORE, dataManager.GetSysString(1292));
btnChainAlways = env->addButton(rect<s32>(205 * xScale, 140 * yScale, 305 * xScale, 175 * yScale), 0, BUTTON_CHAIN_ALWAYS, dataManager.GetSysString(1293));
btnChainWhenAvail = env->addButton(rect<s32>(205 * xScale, 180 * yScale, 305 * xScale, 215 * yScale), 0, BUTTON_CHAIN_WHENAVAIL, dataManager.GetSysString(1294));
btnChainIgnore->setIsPushButton(true);
btnChainAlways->setIsPushButton(true);
btnChainWhenAvail->setIsPushButton(true);
btnChainIgnore->setVisible(false);
btnChainAlways->setVisible(false);
btnChainWhenAvail->setVisible(false);
//shuffle
btnShuffle = env->addButton(rect<s32>(205 * xScale, 220 * yScale, 305 * xScale, 255 * yScale), 0, BUTTON_CMD_SHUFFLE, dataManager.GetSysString(1297));
btnShuffle->setVisible(false);
//cancel or finish
btnCancelOrFinish = env->addButton(rect<s32>(205 * xScale, 220 * yScale, 305 * xScale, 275 * yScale), 0, BUTTON_CANCEL_OR_FINISH, dataManager.GetSysString(1295));
btnCancelOrFinish->setVisible(false);
#else
//replay window
wReplay = env->addWindow(rect<s32>(220, 100, 800, 520), false, dataManager.GetSysString(1202));
wReplay->getCloseButton()->setVisible(false);
wReplay->setVisible(false);
lstReplayList = env->addListBox(rect<s32>(10, 30, 350, 400), wReplay, LISTBOX_REPLAY_LIST, true);
lstReplayList->setItemHeight(18);
btnLoadReplay = env->addButton(rect<s32>(470, 355, 570, 380), wReplay, BUTTON_LOAD_REPLAY, dataManager.GetSysString(1348));
btnDeleteReplay = env->addButton(rect<s32>(360, 355, 460, 380), wReplay, BUTTON_DELETE_REPLAY, dataManager.GetSysString(1361));
btnRenameReplay = env->addButton(rect<s32>(360, 385, 460, 410), wReplay, BUTTON_RENAME_REPLAY, dataManager.GetSysString(1362));
btnReplayCancel = env->addButton(rect<s32>(470, 385, 570, 410), wReplay, BUTTON_CANCEL_REPLAY, dataManager.GetSysString(1347));
env->addStaticText(dataManager.GetSysString(1349), rect<s32>(360, 30, 570, 50), false, true, wReplay);
stReplayInfo = env->addStaticText(L"", rect<s32>(360, 60, 570, 350), false, true, wReplay);
env->addStaticText(dataManager.GetSysString(1353), rect<s32>(360, 275, 570, 295), false, true, wReplay);
ebRepStartTurn = env->addEditBox(L"", rect<s32>(360, 300, 460, 320), true, wReplay, -1);
ebRepStartTurn->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
//single play window
wSinglePlay = env->addWindow(rect<s32>(220, 100, 800, 520), false, dataManager.GetSysString(1201));
wSinglePlay->getCloseButton()->setVisible(false);
wSinglePlay->setVisible(false);
irr::gui::IGUITabControl* wSingle = env->addTabControl(rect<s32>(0, 20, 579, 419), wSinglePlay, true);
//TEST BOT MODE
if(gameConf.enable_bot_mode) {
irr::gui::IGUITab* tabBot = wSingle->addTab(dataManager.GetSysString(1380));
lstBotList = env->addListBox(rect<s32>(10, 10, 350, 350), tabBot, LISTBOX_BOT_LIST, true);
lstBotList->setItemHeight(18);
btnStartBot = env->addButton(rect<s32>(459, 301, 569, 326), tabBot, BUTTON_BOT_START, dataManager.GetSysString(1211));
btnBotCancel = env->addButton(rect<s32>(459, 331, 569, 356), tabBot, BUTTON_CANCEL_SINGLEPLAY, dataManager.GetSysString(1210));
env->addStaticText(dataManager.GetSysString(1382), rect<s32>(360, 10, 550, 30), false, true, tabBot);
stBotInfo = env->addStaticText(L"", rect<s32>(360, 40, 560, 160), false, true, tabBot);
chkBotOldRule = env->addCheckBox(false, rect<s32>(360, 170, 560, 190), tabBot, CHECKBOX_BOT_OLD_RULE, dataManager.GetSysString(1383));
chkBotHand = env->addCheckBox(false, rect<s32>(360, 200, 560, 220), tabBot, -1, dataManager.GetSysString(1384));
chkBotNoCheckDeck = env->addCheckBox(false, rect<s32>(360, 230, 560, 250), tabBot, -1, dataManager.GetSysString(1229));
chkBotNoShuffleDeck = env->addCheckBox(false, rect<s32>(360, 260, 560, 280), tabBot, -1, dataManager.GetSysString(1230));
} else { // avoid null pointer
btnStartBot = env->addButton(rect<s32>(0, 0, 0, 0), wSinglePlay);
btnBotCancel = env->addButton(rect<s32>(0, 0, 0, 0), wSinglePlay);
btnStartBot->setVisible(false);
btnBotCancel->setVisible(false);
}
irr::gui::IGUITab* tabSingle = wSingle->addTab(dataManager.GetSysString(1381));
lstSinglePlayList = env->addListBox(rect<s32>(10, 10, 350, 350), tabSingle, LISTBOX_SINGLEPLAY_LIST, true);
lstSinglePlayList->setItemHeight(18);
btnLoadSinglePlay = env->addButton(rect<s32>(459, 301, 569, 326), tabSingle, BUTTON_LOAD_SINGLEPLAY, dataManager.GetSysString(1211));
btnSinglePlayCancel = env->addButton(rect<s32>(459, 331, 569, 356), tabSingle, BUTTON_CANCEL_SINGLEPLAY, dataManager.GetSysString(1210));
env->addStaticText(dataManager.GetSysString(1352), rect<s32>(360, 10, 550, 30), false, true, tabSingle);
stSinglePlayInfo = env->addStaticText(L"", rect<s32>(360, 40, 550, 280), false, true, tabSingle);
//replay save
wReplaySave = env->addWindow(rect<s32>(510, 200, 820, 320), false, dataManager.GetSysString(1340));
wReplaySave->getCloseButton()->setVisible(false);
wReplaySave->setVisible(false);
env->addStaticText(dataManager.GetSysString(1342), rect<s32>(20, 25, 290, 45), false, false, wReplaySave);
ebRSName = env->addEditBox(L"", rect<s32>(20, 50, 290, 70), true, wReplaySave, -1);
ebRSName->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
btnRSYes = env->addButton(rect<s32>(70, 80, 140, 105), wReplaySave, BUTTON_REPLAY_SAVE, dataManager.GetSysString(1341));
btnRSNo = env->addButton(rect<s32>(170, 80, 240, 105), wReplaySave, BUTTON_REPLAY_CANCEL, dataManager.GetSysString(1212));
//replay control
wReplayControl = env->addStaticText(L"", rect<s32>(205, 118, 295, 273), true, false, 0, -1, true);
wReplayControl->setVisible(false);
btnReplayStart = env->addButton(rect<s32>(5, 5, 85, 25), wReplayControl, BUTTON_REPLAY_START, dataManager.GetSysString(1343));
btnReplayPause = env->addButton(rect<s32>(5, 30, 85, 50), wReplayControl, BUTTON_REPLAY_PAUSE, dataManager.GetSysString(1344));
btnReplayStep = env->addButton(rect<s32>(5, 55, 85, 75), wReplayControl, BUTTON_REPLAY_STEP, dataManager.GetSysString(1345));
btnReplayUndo = env->addButton(rect<s32>(5, 80, 85, 100), wReplayControl, BUTTON_REPLAY_UNDO, dataManager.GetSysString(1360));
btnReplaySwap = env->addButton(rect<s32>(5, 105, 85, 125), wReplayControl, BUTTON_REPLAY_SWAP, dataManager.GetSysString(1346));
btnReplayExit = env->addButton(rect<s32>(5, 130, 85, 150), wReplayControl, BUTTON_REPLAY_EXIT, dataManager.GetSysString(1347));
//chat
wChat = env->addWindow(rect<s32>(305, 615, 1020, 640), false, L"");
wChat->getCloseButton()->setVisible(false);
wChat->setDraggable(false);
wChat->setDrawTitlebar(false);
wChat->setVisible(false);
ebChatInput = env->addEditBox(L"", rect<s32>(3, 2, 710, 22), true, wChat, EDITBOX_CHAT);
//swap
btnSpectatorSwap = env->addButton(rect<s32>(205, 100, 295, 135), 0, BUTTON_REPLAY_SWAP, dataManager.GetSysString(1346));
btnSpectatorSwap->setVisible(false);
//chain buttons
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));
btnChainWhenAvail = env->addButton(rect<s32>(205, 180, 295, 215), 0, BUTTON_CHAIN_WHENAVAIL, dataManager.GetSysString(1294));
btnChainIgnore = env->addButton(rect<s32>(205 * xScale, 100 * yScale, 305 * xScale, 135 * yScale), 0, BUTTON_CHAIN_IGNORE, dataManager.GetSysString(1292));
btnChainAlways = env->addButton(rect<s32>(205 * xScale, 140 * yScale, 305 * xScale, 175 * yScale), 0, BUTTON_CHAIN_ALWAYS, dataManager.GetSysString(1293));
btnChainWhenAvail = env->addButton(rect<s32>(205 * xScale, 180 * yScale, 305 * xScale, 215 * yScale), 0, BUTTON_CHAIN_WHENAVAIL, dataManager.GetSysString(1294));
btnChainIgnore->setIsPushButton(true);
btnChainAlways->setIsPushButton(true);
btnChainWhenAvail->setIsPushButton(true);
......@@ -1104,19 +885,13 @@ bool Game::Initialize() {
btnChainAlways->setVisible(false);
btnChainWhenAvail->setVisible(false);
//shuffle
btnShuffle = env->addButton(rect<s32>(205, 230, 295, 265), 0, BUTTON_CMD_SHUFFLE, dataManager.GetSysString(1297));
btnShuffle = env->addButton(rect<s32>(205 * xScale, 220 * yScale, 305 * xScale, 255 * yScale), 0, BUTTON_CMD_SHUFFLE, dataManager.GetSysString(1297));
btnShuffle->setVisible(false);
//cancel or finish
btnCancelOrFinish = env->addButton(rect<s32>(205, 230, 295, 265), 0, BUTTON_CANCEL_OR_FINISH, dataManager.GetSysString(1295));
btnCancelOrFinish = env->addButton(rect<s32>(205 * xScale, 220 * yScale, 305 * xScale, 275 * yScale), 0, BUTTON_CANCEL_OR_FINISH, dataManager.GetSysString(1295));
btnCancelOrFinish->setVisible(false);
//leave/surrender/exit
#endif
#ifdef _IRR_ANDROID_PLATFORM_
ebChatInput = CAndroidGUIEditBox::addAndroidEditBox(L"", true, env, rect<s32>(3 * xScale, 2 * yScale, 710 * xScale, 22 * yScale), wChat, EDITBOX_CHAT);
#else
ebChatInput = env->addEditBox(L"", rect<s32>(3, 2, 710, 22), true, wChat, EDITBOX_CHAT);
#endif
//
//leave/surrender/exit
btnLeaveGame = env->addButton(rect<s32>(205 * xScale, 1 * yScale, 305 * xScale, 80 * yScale), 0, BUTTON_LEAVE_GAME, L"");
btnLeaveGame->setVisible(false);
//tip
......@@ -1262,9 +1037,6 @@ void Game::MainLoop() {
driver->draw2DImage(imageManager.tBackGround_deck, recti(0 * xScale, 0 * yScale, 1280 * xScale, 720 * yScale), recti(0, 0, imageManager.tBackGround->getOriginalSize().Width, imageManager.tBackGround->getOriginalSize().Height));
}
driver->enableMaterial2D(false);
#else
if(imageManager.tBackGround)
driver->draw2DImage(imageManager.tBackGround, recti(0 * xScale, 0 * yScale, 1280 * xScale, 720 * yScale), recti(0, 0, imageManager.tBackGround->getOriginalSize().Width, imageManager.tBackGround->getOriginalSize().Height));
#endif
gMutex.Lock();
if(dInfo.isStarted) {
......
......@@ -64,15 +64,11 @@ int ReplayMode::ReplayThread(void* param) {
mainGame->dInfo.tag_player[0] = false;
mainGame->dInfo.tag_player[1] = false;
if(mainGame->dInfo.isSingleMode) {
#ifdef _IRR_ANDROID_PLATFORM_
set_script_reader((script_reader)SingleMode::ScriptReaderEx);
#endif
set_script_reader((script_reader)SingleMode::ScriptReaderEx);
set_card_reader((card_reader)DataManager::CardReader);
set_message_handler((message_handler)MessageHandler);
} else {
#ifdef _IRR_ANDROID_PLATFORM_
set_script_reader((script_reader)ScriptReaderEx);
#endif
set_script_reader((script_reader)ScriptReaderEx);
set_card_reader((card_reader)DataManager::CardReader);
set_message_handler((message_handler)MessageHandler);
}
......
......@@ -406,9 +406,7 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
}
time_limit[0] = host_info.time_limit;
time_limit[1] = host_info.time_limit;
#ifdef _IRR_ANDROID_PLATFORM_
set_script_reader((script_reader)ScriptReaderEx);
#endif
set_card_reader((card_reader)DataManager::CardReader);
set_message_handler((message_handler)SingleDuel::MessageHandler);
rnd.reset(seed);
......
......@@ -38,9 +38,7 @@ int SingleMode::SinglePlayThread(void* param) {
mtrandom rnd;
time_t seed = time(0);
rnd.reset(seed);
#ifdef _IRR_ANDROID_PLATFORM_
set_script_reader((script_reader)ScriptReaderEx);
#endif
set_card_reader((card_reader)DataManager::CardReader);
set_message_handler((message_handler)MessageHandler);
pduel = create_duel(rnd.rand());
......
......@@ -243,7 +243,7 @@ uint32 card::get_infos(byte* buf, int32 query_flag, int32 use_cache) {
#else
*(uint32*)(buf + 4) = query_flag;
#endif
return (byte*)p - buf;
return (uint32)((byte*)p - buf);
}
uint32 card::get_info_location() {
if(overlay_target) {
......
......@@ -269,7 +269,7 @@ int32 field::select_card(uint16 step, uint8 playerid, uint8 cancelable, uint8 mi
byte c[64] = {};
uint8 m = core.select_cards.size();
for(int32 i = 0; i < returns.bvalue[0]; ++i) {
uint8 v = returns.bvalue[i + 1];
int8 v = returns.bvalue[i + 1];
if(v < 0 || v >= m || v >= 63 || c[v]) {
pduel->write_buffer8(MSG_RETRY);
return FALSE;
......@@ -747,12 +747,12 @@ int32 field::sort_card(int16 step, uint8 playerid, uint8 is_chain) {
}
return FALSE;
} else {
if(returns.ivalue[0] == -1)
if(returns.bvalue[0] == -1)
return TRUE;
byte c[64] = {};
uint8 m = core.select_cards.size();
for(uint8 i = 0; i < m; ++i) {
uint8 v = returns.bvalue[i];
int8 v = returns.bvalue[i];
if(v < 0 || v >= m || c[v]) {
pduel->write_buffer8(MSG_RETRY);
return FALSE;
......
......@@ -674,9 +674,8 @@ int32 field::process() {
it->step++;
} else {
group* pgroup = pduel->new_group();
card* pcard;
for(int32 i = 0; i < returns.bvalue[0]; ++i) {
pcard = core.select_cards[returns.bvalue[i + 1]];
card* pcard = core.select_cards[returns.bvalue[i + 1]];
pgroup->container.insert(pcard);
}
pduel->lua->add_param(pgroup, PARAM_TYPE_GROUP);
......@@ -719,9 +718,8 @@ int32 field::process() {
it->step++;
} else {
group* pgroup = pduel->new_group();
card* pcard;
for(int32 i = 0; i < returns.bvalue[0]; ++i) {
pcard = core.select_cards[returns.bvalue[i + 1]];
card* pcard = core.select_cards[returns.bvalue[i + 1]];
pgroup->container.insert(pcard);
}
pduel->lua->add_param(pgroup, PARAM_TYPE_GROUP);
......@@ -735,9 +733,8 @@ int32 field::process() {
it->step++;
} else {
group* pgroup = pduel->new_group();
card* pcard;
for(int32 i = 0; i < returns.bvalue[0]; ++i) {
pcard = core.select_cards[returns.bvalue[i + 1]];
card* pcard = core.select_cards[returns.bvalue[i + 1]];
pgroup->container.insert(pcard);
}
pduel->lua->add_param(pgroup, PARAM_TYPE_GROUP);
......@@ -852,11 +849,11 @@ int32 field::process() {
int32 playerid = it->arg1;
int32 count = it->arg3;
int32 dfflag = 0;
uint8 p, l, s, pa = 0;
uint8 pa = 0;
for(int32 i = 0; i < count; ++i) {
p = returns.bvalue[pa];
l = returns.bvalue[pa + 1];
s = returns.bvalue[pa + 2];
uint8 p = returns.bvalue[pa];
uint8 l = returns.bvalue[pa + 1];
uint8 s = returns.bvalue[pa + 2];
dfflag |= 0x1u << (s + (p == playerid ? 0 : 16) + (l == LOCATION_MZONE ? 0 : 8));
pa += 3;
}
......@@ -1007,9 +1004,8 @@ int32 field::process() {
it->step++;
} else if(it->step == 1) {
card_set cset;
card* pcard;
for(int32 i = 0; i < returns.bvalue[0]; ++i) {
pcard = core.select_cards[returns.bvalue[i + 1]];
card* pcard = core.select_cards[returns.bvalue[i + 1]];
cset.insert(pcard);
}
if(cset.size())
......@@ -1050,7 +1046,7 @@ int32 field::process() {
for(i = 0; i < count; ++i)
player[target_player].list_main.pop_back();
for(i = 0; i < count; ++i)
tc[(int32)returns.bvalue[i]] = core.select_cards[i];
tc[(uint8)returns.bvalue[i]] = core.select_cards[i];
for(i = 0; i < count; ++i) {
player[target_player].list_main.push_back(tc[count - i - 1]);
tc[count - i - 1]->current.sequence = player[target_player].list_main.size() - 1;
......@@ -3095,7 +3091,8 @@ int32 field::process_battle_command(uint16 step) {
return FALSE;
}
case 9: {
if(is_player_affected_by_effect(infos.turn_player, EFFECT_SKIP_BP) || core.attack_rollback) {
if(is_player_affected_by_effect(infos.turn_player, EFFECT_SKIP_BP)
|| core.attacker->is_status(STATUS_ATTACK_CANCELED) || core.attack_rollback) {
core.units.begin()->step = 10;
return FALSE;
}
......@@ -3126,17 +3123,12 @@ int32 field::process_battle_command(uint16 step) {
core.attacker->set_status(STATUS_ATTACK_CANCELED, TRUE);
}
if(is_player_affected_by_effect(infos.turn_player, EFFECT_SKIP_BP)
|| !core.attacker->is_capable_attack() || core.attacker->is_status(STATUS_ATTACK_CANCELED)
|| core.attacker->current.controler != core.attacker->attack_controler
|| core.attacker->fieldid_r != core.pre_field[0]) {
|| core.attacker->is_status(STATUS_ATTACK_CANCELED)) {
core.units.begin()->step = 12;
return FALSE;
}
uint8 rollback = core.attack_rollback;
if(!confirm_attack_target())
rollback = TRUE;
// go to damage step
if(!rollback) {
if(!core.attack_rollback) {
core.attacker->announce_count++;
core.attacker->announced_cards.addcard(core.attack_target);
attack_all_target_check();
......@@ -5327,8 +5319,14 @@ int32 field::adjust_step(uint16 step) {
card* attacker = core.attacker;
if(!attacker)
return FALSE;
if(attacker->is_affected_by_effect(EFFECT_CANNOT_ATTACK))
if(attacker->is_status(STATUS_ATTACK_CANCELED))
return FALSE;
if(!core.attacker->is_capable_attack()
|| core.attacker->current.controler != core.attacker->attack_controler
|| core.attacker->fieldid_r != core.pre_field[0]) {
attacker->set_status(STATUS_ATTACK_CANCELED, TRUE);
return FALSE;
}
if(core.attack_rollback)
return FALSE;
std::set<uint16> fidset;
......@@ -5336,7 +5334,7 @@ int32 field::adjust_step(uint16 step) {
if(pcard)
fidset.insert(pcard->fieldid_r);
}
if(fidset != core.opp_mzone)
if(fidset != core.opp_mzone || !confirm_attack_target())
core.attack_rollback = TRUE;
return 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