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

update

parent 1a62f5b5
......@@ -580,6 +580,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);
......@@ -591,6 +592,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);
......@@ -1008,6 +1010,8 @@ void Game::RefershBGMDir(std::wstring path, int scene) {
#endif
}
void Game::RefreshBot() {
if(!gameConf.enable_bot_mode)
return;
botInfo.clear();
FILE* fp = fopen("bot.conf", "r");
char linebuf[256];
......@@ -1087,6 +1091,7 @@ void Game::LoadConfig() {
gameConf.music_volume = 0.5;
gameConf.music_mode = 1;
gameConf.defaultOT = 1;
gameConf.enable_bot_mode = 0;
while(fgets(linebuf, 256, fp)) {
sscanf(linebuf, "%s = %s", strbuf, valbuf);
if(!strcmp(strbuf, "antialias")) {
......@@ -1157,6 +1162,10 @@ void Game::LoadConfig() {
gameConf.music_mode = 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);
......@@ -1226,6 +1235,7 @@ void Game::SaveConfig() {
fprintf(fp, "music_volume = %d\n", vol);
fprintf(fp, "music_mode = %d\n", ((mainGame->chkMusicMode->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::PlaySoundEffect(int sound) {
......
......@@ -46,6 +46,7 @@ struct Config {
double music_volume;
int music_mode;
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