Commit e9b63c2d authored by mercury233's avatar mercury233

update

parent 0fe74ba1
......@@ -556,6 +556,7 @@ bool Game::Initialize() {
wSinglePlay->getCloseButton()->setVisible(false);
wSinglePlay->setVisible(false);
irr::gui::IGUITabControl* wSingle = env->addTabControl(rect<s32>(0, 20, 579, 419), wSinglePlay, true);
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);
......@@ -567,6 +568,7 @@ bool Game::Initialize() {
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));
}
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);
......@@ -914,6 +916,8 @@ void Game::RefreshSingleplay() {
#endif
}
void Game::RefreshBot() {
if(!gameConf.enable_bot_mode)
return;
botInfo.clear();
FILE* fp = fopen("bot.conf", "r");
char linebuf[256];
......@@ -988,6 +992,7 @@ void Game::LoadConfig() {
gameConf.auto_search_limit = -1;
gameConf.chkIgnoreDeckChanges = 0;
gameConf.defaultOT = 1;
gameConf.enable_bot_mode = 0;
while(fgets(linebuf, 256, fp)) {
sscanf(linebuf, "%s = %s", strbuf, valbuf);
if(!strcmp(strbuf, "antialias")) {
......@@ -1048,6 +1053,10 @@ void Game::LoadConfig() {
gameConf.chkIgnoreDeckChanges = atoi(valbuf);
} else if(!strcmp(strbuf, "default_ot")) {
gameConf.defaultOT = atoi(valbuf);
} else if(!strcmp(strbuf, "enable_bot_mode")) {
#ifdef _WIN32
gameConf.enable_bot_mode = atoi(valbuf);
#endif
} else {
// options allowing multiple words
sscanf(linebuf, "%s = %240[^\n]", strbuf, valbuf);
......@@ -1107,6 +1116,7 @@ void Game::SaveConfig() {
fprintf(fp, "auto_search_limit = %d\n", gameConf.auto_search_limit);
fprintf(fp, "ignore_deck_changes = %d\n", ((mainGame->chkIgnoreDeckChanges->isChecked()) ? 1 : 0));
fprintf(fp, "default_ot = %d\n", gameConf.defaultOT);
fprintf(fp, "enable_bot_mode = %d\n", gameConf.enable_bot_mode);
fclose(fp);
}
void Game::ShowCardInfo(int code) {
......
......@@ -41,6 +41,7 @@ struct Config {
int auto_search_limit;
int chkIgnoreDeckChanges;
int defaultOT;
int enable_bot_mode;
};
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