Commit b4fc5160 authored by mercury233's avatar mercury233

separate settings tab

parent 9c054af4
......@@ -176,7 +176,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
break;
}
case BUTTON_LEAVE_GAME: {
if(is_modified && mainGame->gameConf.prompt_to_discard_deck_changes) {
if(is_modified && !mainGame->chkIgnoreDeckChanges->isChecked()) {
mainGame->gMutex.Lock();
mainGame->SetStaticText(mainGame->stQMessage, 310, mainGame->textFont, (wchar_t*)dataManager.GetSysString(1356));
mainGame->PopupElement(mainGame->wQuery);
......@@ -340,7 +340,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
break;
}
case COMBOBOX_DBDECKS: {
if(is_modified && mainGame->gameConf.prompt_to_discard_deck_changes) {
if(is_modified && !mainGame->chkIgnoreDeckChanges->isChecked()) {
mainGame->gMutex.Lock();
mainGame->SetStaticText(mainGame->stQMessage, 310, mainGame->textFont, (wchar_t*)dataManager.GetSysString(1356));
mainGame->PopupElement(mainGame->wQuery);
......
......@@ -214,6 +214,7 @@ bool Game::Initialize() {
btnEP->setVisible(false);
//tab
wInfos = env->addTabControl(rect<s32>(1, 275, 301, 639), 0, true);
wInfos->setTabExtraWidth(16);
wInfos->setVisible(false);
//info
irr::gui::IGUITab* tabInfo = wInfos->addTab(dataManager.GetSysString(1270));
......@@ -235,26 +236,41 @@ bool Game::Initialize() {
lstLog = env->addListBox(rect<s32>(10, 10, 290, 290), tabLog, LISTBOX_LOG, false);
lstLog->setItemHeight(18);
btnClearLog = env->addButton(rect<s32>(160, 300, 260, 325), tabLog, BUTTON_CLEAR_LOG, dataManager.GetSysString(1272));
//system
irr::gui::IGUITab* tabSystem = wInfos->addTab(dataManager.GetSysString(1273));
chkMAutoPos = env->addCheckBox(false, rect<s32>(20, 20, 280, 45), tabSystem, -1, dataManager.GetSysString(1274));
//helper
irr::gui::IGUITab* tabHelper = wInfos->addTab(dataManager.GetSysString(1298));
int posX = 20;
int posY = 20;
chkMAutoPos = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260, posY + 25), tabHelper, -1, dataManager.GetSysString(1274));
chkMAutoPos->setChecked(gameConf.chkMAutoPos != 0);
chkSTAutoPos = env->addCheckBox(false, rect<s32>(20, 50, 280, 75), tabSystem, -1, dataManager.GetSysString(1278));
posY += 30;
chkSTAutoPos = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260, posY + 25), tabHelper, -1, dataManager.GetSysString(1278));
chkSTAutoPos->setChecked(gameConf.chkSTAutoPos != 0);
chkRandomPos = env->addCheckBox(false, rect<s32>(40, 80, 300, 105), tabSystem, -1, dataManager.GetSysString(1275));
posY += 30;
chkRandomPos = env->addCheckBox(false, rect<s32>(posX + 20, posY, posX + 20 + 260, posY + 25), tabHelper, -1, dataManager.GetSysString(1275));
chkRandomPos->setChecked(gameConf.chkRandomPos != 0);
chkAutoChain = env->addCheckBox(false, rect<s32>(20, 110, 280, 135), tabSystem, -1, dataManager.GetSysString(1276));
posY += 30;
chkAutoChain = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260, posY + 25), tabHelper, -1, dataManager.GetSysString(1276));
chkAutoChain->setChecked(gameConf.chkAutoChain != 0);
chkWaitChain = env->addCheckBox(false, rect<s32>(20, 140, 280, 165), tabSystem, -1, dataManager.GetSysString(1277));
posY += 30;
chkWaitChain = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260, posY + 25), tabHelper, -1, dataManager.GetSysString(1277));
chkWaitChain->setChecked(gameConf.chkWaitChain != 0);
chkIgnore1 = env->addCheckBox(false, rect<s32>(20, 200, 280, 225), tabSystem, -1, dataManager.GetSysString(1290));
//system
irr::gui::IGUITab* tabSystem = wInfos->addTab(dataManager.GetSysString(1273));
posY = 20;
chkIgnore1 = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260, posY + 25), tabSystem, -1, dataManager.GetSysString(1290));
chkIgnore1->setChecked(gameConf.chkIgnore1 != 0);
chkIgnore2 = env->addCheckBox(false, rect<s32>(20, 230, 280, 255), tabSystem, -1, dataManager.GetSysString(1291));
posY += 30;
chkIgnore2 = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260, posY + 25), tabSystem, -1, dataManager.GetSysString(1291));
chkIgnore2->setChecked(gameConf.chkIgnore2 != 0);
chkHideSetname = env->addCheckBox(false, rect<s32>(20, 260, 280, 285), tabSystem, -1, dataManager.GetSysString(1354));
posY += 30;
chkHideSetname = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260, posY + 25), tabSystem, -1, dataManager.GetSysString(1354));
chkHideSetname->setChecked(gameConf.chkHideSetname != 0);
chkHideHintButton = env->addCheckBox(false, rect<s32>(20, 290, 280, 315), tabSystem, -1, dataManager.GetSysString(1355));
posY += 30;
chkHideHintButton = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260, posY + 25), tabSystem, -1, dataManager.GetSysString(1355));
chkHideHintButton->setChecked(gameConf.chkHideHintButton != 0);
posY += 30;
chkIgnoreDeckChanges = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260, posY + 25), tabSystem, -1, dataManager.GetSysString(1357));
chkIgnoreDeckChanges->setChecked(gameConf.chkIgnoreDeckChanges != 0);
//
wHand = env->addWindow(rect<s32>(500, 450, 825, 605), false, L"");
wHand->getCloseButton()->setVisible(false);
......@@ -911,7 +927,7 @@ void Game::LoadConfig() {
gameConf.draw_field_spell = 1;
gameConf.separate_clear_button = 1;
gameConf.auto_search_limit = -1;
gameConf.prompt_to_discard_deck_changes = 1;
gameConf.chkIgnoreDeckChanges = 0;
fseek(fp, 0, SEEK_END);
int fsize = ftell(fp);
fseek(fp, 0, SEEK_SET);
......@@ -970,8 +986,8 @@ void Game::LoadConfig() {
gameConf.separate_clear_button = atoi(valbuf);
} else if(!strcmp(strbuf, "auto_search_limit")) {
gameConf.auto_search_limit = atoi(valbuf);
} else if(!strcmp(strbuf, "prompt_to_discard_deck_changes")) {
gameConf.prompt_to_discard_deck_changes = atoi(valbuf);
} else if(!strcmp(strbuf, "ignore_deck_changes")) {
gameConf.chkIgnoreDeckChanges = atoi(valbuf);
} else {
// options allowing multiple words
sscanf(linebuf, "%s = %240[^\n]", strbuf, valbuf);
......@@ -1028,7 +1044,7 @@ void Game::SaveConfig() {
fprintf(fp, "separate_clear_button = %d\n", gameConf.separate_clear_button);
fprintf(fp, "#auto_search_limit >= 0: Start search automatically when the user enters N chars\n");
fprintf(fp, "auto_search_limit = %d\n", gameConf.auto_search_limit);
fprintf(fp, "prompt_to_discard_deck_changes = %d\n", gameConf.prompt_to_discard_deck_changes);
fprintf(fp, "ignore_deck_changes = %d\n", ((mainGame->chkIgnoreDeckChanges->isChecked()) ? 1 : 0));
fclose(fp);
}
void Game::ShowCardInfo(int code) {
......
......@@ -38,7 +38,7 @@ struct Config {
int draw_field_spell;
int separate_clear_button;
int auto_search_limit;
int prompt_to_discard_deck_changes;
int chkIgnoreDeckChanges;
};
struct DuelInfo {
......@@ -211,6 +211,8 @@ public:
irr::gui::IGUICheckBox* chkWaitChain;
irr::gui::IGUICheckBox* chkHideSetname;
irr::gui::IGUICheckBox* chkHideHintButton;
irr::gui::IGUICheckBox* chkIgnoreDeckChanges;
irr::gui::IGUICheckBox* chkAutoSearch;
irr::gui::IGUIListBox* lstLog;
irr::gui::IGUIButton* btnClearLog;
irr::gui::IGUIButton* btnSaveLog;
......
......@@ -303,6 +303,7 @@
!system 1295 取消操作
!system 1296 完成选择
!system 1297 切洗手卡
!system 1298 辅助功能
!system 1300 禁限卡表:
!system 1301 卡组列表:
!system 1302 保存
......@@ -357,6 +358,8 @@
!system 1354 不显示卡片系列
!system 1355 不显示提示按钮
!system 1356 是否要放弃对卡组的修改?
!system 1357 不提示保留对卡组的修改
!system 1358 键入关键字后自动进行搜索
!system 1360 上一步
!system 1370 星数↑
!system 1371 攻击↑
......
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