Commit 7e810ed6 authored by mercury233's avatar mercury233 Committed by root

update

parent 1a62f5b5
...@@ -580,17 +580,19 @@ bool Game::Initialize() { ...@@ -580,17 +580,19 @@ bool Game::Initialize() {
wSinglePlay->getCloseButton()->setVisible(false); wSinglePlay->getCloseButton()->setVisible(false);
wSinglePlay->setVisible(false); wSinglePlay->setVisible(false);
irr::gui::IGUITabControl* wSingle = env->addTabControl(rect<s32>(0, 20, 579, 419), wSinglePlay, true); irr::gui::IGUITabControl* wSingle = env->addTabControl(rect<s32>(0, 20, 579, 419), wSinglePlay, true);
irr::gui::IGUITab* tabBot = wSingle->addTab(dataManager.GetSysString(1380)); if(gameConf.enable_bot_mode) {
lstBotList = env->addListBox(rect<s32>(10, 10, 350, 350), tabBot, LISTBOX_BOT_LIST, true); irr::gui::IGUITab* tabBot = wSingle->addTab(dataManager.GetSysString(1380));
lstBotList->setItemHeight(18); lstBotList = env->addListBox(rect<s32>(10, 10, 350, 350), tabBot, LISTBOX_BOT_LIST, true);
btnStartBot = env->addButton(rect<s32>(459, 301, 569, 326), tabBot, BUTTON_BOT_START, dataManager.GetSysString(1211)); lstBotList->setItemHeight(18);
btnBotCancel = env->addButton(rect<s32>(459, 331, 569, 356), tabBot, BUTTON_CANCEL_SINGLEPLAY, dataManager.GetSysString(1210)); btnStartBot = env->addButton(rect<s32>(459, 301, 569, 326), tabBot, BUTTON_BOT_START, dataManager.GetSysString(1211));
env->addStaticText(dataManager.GetSysString(1382), rect<s32>(360, 10, 550, 30), false, true, tabBot); btnBotCancel = env->addButton(rect<s32>(459, 331, 569, 356), tabBot, BUTTON_CANCEL_SINGLEPLAY, dataManager.GetSysString(1210));
stBotInfo = env->addStaticText(L"", rect<s32>(360, 40, 560, 160), false, true, tabBot); env->addStaticText(dataManager.GetSysString(1382), rect<s32>(360, 10, 550, 30), false, true, tabBot);
chkBotOldRule = env->addCheckBox(false, rect<s32>(360, 170, 560, 190), tabBot, CHECKBOX_BOT_OLD_RULE, dataManager.GetSysString(1383)); stBotInfo = env->addStaticText(L"", rect<s32>(360, 40, 560, 160), false, true, tabBot);
chkBotHand = env->addCheckBox(false, rect<s32>(360, 200, 560, 220), tabBot, -1, dataManager.GetSysString(1384)); chkBotOldRule = env->addCheckBox(false, rect<s32>(360, 170, 560, 190), tabBot, CHECKBOX_BOT_OLD_RULE, dataManager.GetSysString(1383));
chkBotNoCheckDeck = env->addCheckBox(false, rect<s32>(360, 230, 560, 250), tabBot, -1, dataManager.GetSysString(1229)); chkBotHand = env->addCheckBox(false, rect<s32>(360, 200, 560, 220), tabBot, -1, dataManager.GetSysString(1384));
chkBotNoShuffleDeck = env->addCheckBox(false, rect<s32>(360, 260, 560, 280), tabBot, -1, dataManager.GetSysString(1230)); 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));
}
irr::gui::IGUITab* tabSingle = wSingle->addTab(dataManager.GetSysString(1381)); irr::gui::IGUITab* tabSingle = wSingle->addTab(dataManager.GetSysString(1381));
lstSinglePlayList = env->addListBox(rect<s32>(10, 10, 350, 350), tabSingle, LISTBOX_SINGLEPLAY_LIST, true); lstSinglePlayList = env->addListBox(rect<s32>(10, 10, 350, 350), tabSingle, LISTBOX_SINGLEPLAY_LIST, true);
lstSinglePlayList->setItemHeight(18); lstSinglePlayList->setItemHeight(18);
...@@ -1008,6 +1010,8 @@ void Game::RefershBGMDir(std::wstring path, int scene) { ...@@ -1008,6 +1010,8 @@ void Game::RefershBGMDir(std::wstring path, int scene) {
#endif #endif
} }
void Game::RefreshBot() { void Game::RefreshBot() {
if(!gameConf.enable_bot_mode)
return;
botInfo.clear(); botInfo.clear();
FILE* fp = fopen("bot.conf", "r"); FILE* fp = fopen("bot.conf", "r");
char linebuf[256]; char linebuf[256];
...@@ -1087,6 +1091,7 @@ void Game::LoadConfig() { ...@@ -1087,6 +1091,7 @@ void Game::LoadConfig() {
gameConf.music_volume = 0.5; gameConf.music_volume = 0.5;
gameConf.music_mode = 1; gameConf.music_mode = 1;
gameConf.defaultOT = 1; gameConf.defaultOT = 1;
gameConf.enable_bot_mode = 0;
while(fgets(linebuf, 256, fp)) { while(fgets(linebuf, 256, fp)) {
sscanf(linebuf, "%s = %s", strbuf, valbuf); sscanf(linebuf, "%s = %s", strbuf, valbuf);
if(!strcmp(strbuf, "antialias")) { if(!strcmp(strbuf, "antialias")) {
...@@ -1157,6 +1162,10 @@ void Game::LoadConfig() { ...@@ -1157,6 +1162,10 @@ void Game::LoadConfig() {
gameConf.music_mode = atoi(valbuf); gameConf.music_mode = atoi(valbuf);
} else if(!strcmp(strbuf, "default_ot")) { } else if(!strcmp(strbuf, "default_ot")) {
gameConf.defaultOT = atoi(valbuf); gameConf.defaultOT = atoi(valbuf);
} else if(!strcmp(strbuf, "enable_bot_mode")) {
#ifdef _WIN32
gameConf.enable_bot_mode = atoi(valbuf);
#endif
} else { } else {
// options allowing multiple words // options allowing multiple words
sscanf(linebuf, "%s = %240[^\n]", strbuf, valbuf); sscanf(linebuf, "%s = %240[^\n]", strbuf, valbuf);
...@@ -1226,6 +1235,7 @@ void Game::SaveConfig() { ...@@ -1226,6 +1235,7 @@ void Game::SaveConfig() {
fprintf(fp, "music_volume = %d\n", vol); fprintf(fp, "music_volume = %d\n", vol);
fprintf(fp, "music_mode = %d\n", ((mainGame->chkMusicMode->isChecked()) ? 1 : 0)); fprintf(fp, "music_mode = %d\n", ((mainGame->chkMusicMode->isChecked()) ? 1 : 0));
fprintf(fp, "default_ot = %d\n", gameConf.defaultOT); fprintf(fp, "default_ot = %d\n", gameConf.defaultOT);
fprintf(fp, "enable_bot_mode = %d\n", gameConf.enable_bot_mode);
fclose(fp); fclose(fp);
} }
void Game::PlaySoundEffect(int sound) { void Game::PlaySoundEffect(int sound) {
......
...@@ -46,6 +46,7 @@ struct Config { ...@@ -46,6 +46,7 @@ struct Config {
double music_volume; double music_volume;
int music_mode; int music_mode;
int defaultOT; int defaultOT;
int enable_bot_mode;
}; };
struct DuelInfo { struct DuelInfo {
......
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