Commit c8eb0b1b authored by DailyShana's avatar DailyShana

hide chain buttons when using mouse control

because the status of these buttons can be changed by mouse click
parent fef019ac
...@@ -377,7 +377,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) { ...@@ -377,7 +377,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
case irr::EET_MOUSE_INPUT_EVENT: { case irr::EET_MOUSE_INPUT_EVENT: {
switch(event.MouseInput.Event) { switch(event.MouseInput.Event) {
case irr::EMIE_LMOUSE_PRESSED_DOWN: { case irr::EMIE_LMOUSE_PRESSED_DOWN: {
position2d<s32> mouse_pos = position2d<s32>(event.MouseInput.X, event.MouseInput.Y); irr::core::position2di mouse_pos(event.MouseInput.X, event.MouseInput.Y);
irr::gui::IGUIElement* root = mainGame->env->getRootGUIElement(); irr::gui::IGUIElement* root = mainGame->env->getRootGUIElement();
if(root->getElementFromPoint(mouse_pos) != root) if(root->getElementFromPoint(mouse_pos) != root)
break; break;
...@@ -648,7 +648,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) { ...@@ -648,7 +648,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
case irr::EMIE_MOUSE_MOVED: { case irr::EMIE_MOUSE_MOVED: {
int x = event.MouseInput.X; int x = event.MouseInput.X;
int y = event.MouseInput.Y; int y = event.MouseInput.Y;
position2d<s32> mouse_pos = position2d<s32>(x, y); irr::core::position2di mouse_pos(x, y);
irr::gui::IGUIElement* root = mainGame->env->getRootGUIElement(); irr::gui::IGUIElement* root = mainGame->env->getRootGUIElement();
if(root->getElementFromPoint(mouse_pos) != root) if(root->getElementFromPoint(mouse_pos) != root)
break; break;
......
...@@ -1875,7 +1875,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1875,7 +1875,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->btnLeaveGame->setVisible(true); mainGame->btnLeaveGame->setVisible(true);
} }
if(!mainGame->dInfo.isReplay && mainGame->dInfo.player_type < 7) { if(!mainGame->dInfo.isReplay && mainGame->dInfo.player_type < 7) {
if(!mainGame->chkHideChainButton->isChecked()) { if(mainGame->gameConf.control_mode == 0) {
mainGame->btnChainIgnore->setVisible(true); mainGame->btnChainIgnore->setVisible(true);
mainGame->btnChainAlways->setVisible(true); mainGame->btnChainAlways->setVisible(true);
mainGame->btnChainWhenAvail->setVisible(true); mainGame->btnChainWhenAvail->setVisible(true);
......
...@@ -2176,7 +2176,7 @@ void ClientField::UpdateChainButtons() { ...@@ -2176,7 +2176,7 @@ void ClientField::UpdateChainButtons() {
} }
} }
void ClientField::ShowCancelOrFinishButton(int buttonOp) { void ClientField::ShowCancelOrFinishButton(int buttonOp) {
if (!mainGame->chkHideChainButton->isChecked() && !mainGame->dInfo.isReplay) { if (!mainGame->chkHideHintButton->isChecked() && !mainGame->dInfo.isReplay) {
switch (buttonOp) { switch (buttonOp) {
case 1: case 1:
mainGame->btnCancelOrFinish->setText(dataManager.GetSysString(1295)); mainGame->btnCancelOrFinish->setText(dataManager.GetSysString(1295));
......
...@@ -241,8 +241,8 @@ bool Game::Initialize() { ...@@ -241,8 +241,8 @@ bool Game::Initialize() {
chkIgnore2->setChecked(gameConf.chkIgnore2 != 0); chkIgnore2->setChecked(gameConf.chkIgnore2 != 0);
chkHideSetname = env->addCheckBox(false, rect<s32>(20, 260, 280, 285), tabSystem, -1, dataManager.GetSysString(1354)); chkHideSetname = env->addCheckBox(false, rect<s32>(20, 260, 280, 285), tabSystem, -1, dataManager.GetSysString(1354));
chkHideSetname->setChecked(gameConf.chkHideSetname != 0); chkHideSetname->setChecked(gameConf.chkHideSetname != 0);
chkHideChainButton = env->addCheckBox(false, rect<s32>(20, 290, 280, 315), tabSystem, -1, dataManager.GetSysString(1355)); chkHideHintButton = env->addCheckBox(false, rect<s32>(20, 290, 280, 315), tabSystem, -1, dataManager.GetSysString(1355));
chkHideChainButton->setChecked(gameConf.chkHideChainButton != 0); chkHideHintButton->setChecked(gameConf.chkHideHintButton != 0);
// //
wHand = env->addWindow(rect<s32>(500, 450, 825, 605), false, L""); wHand = env->addWindow(rect<s32>(500, 450, 825, 605), false, L"");
wHand->getCloseButton()->setVisible(false); wHand->getCloseButton()->setVisible(false);
...@@ -864,7 +864,7 @@ void Game::LoadConfig() { ...@@ -864,7 +864,7 @@ void Game::LoadConfig() {
gameConf.chkIgnore1 = 0; gameConf.chkIgnore1 = 0;
gameConf.chkIgnore2 = 0; gameConf.chkIgnore2 = 0;
gameConf.chkHideSetname = 0; gameConf.chkHideSetname = 0;
gameConf.chkHideChainButton = 0; gameConf.chkHideHintButton = 0;
gameConf.control_mode = 0; gameConf.control_mode = 0;
gameConf.draw_field_spell = 1; gameConf.draw_field_spell = 1;
gameConf.separate_clear_button = 1; gameConf.separate_clear_button = 1;
...@@ -914,8 +914,8 @@ void Game::LoadConfig() { ...@@ -914,8 +914,8 @@ void Game::LoadConfig() {
gameConf.chkIgnore2 = atoi(valbuf); gameConf.chkIgnore2 = atoi(valbuf);
} else if(!strcmp(strbuf, "hide_setname")) { } else if(!strcmp(strbuf, "hide_setname")) {
gameConf.chkHideSetname = atoi(valbuf); gameConf.chkHideSetname = atoi(valbuf);
} else if(!strcmp(strbuf, "hide_chain_button")) { } else if(!strcmp(strbuf, "hide_hint_button")) {
gameConf.chkHideChainButton = atoi(valbuf); gameConf.chkHideHintButton = atoi(valbuf);
} else if(!strcmp(strbuf, "control_mode")) { } else if(!strcmp(strbuf, "control_mode")) {
gameConf.control_mode = atoi(valbuf); gameConf.control_mode = atoi(valbuf);
} else if(!strcmp(strbuf, "draw_field_spell")) { } else if(!strcmp(strbuf, "draw_field_spell")) {
...@@ -970,8 +970,8 @@ void Game::SaveConfig() { ...@@ -970,8 +970,8 @@ void Game::SaveConfig() {
fprintf(fp, "mute_opponent = %d\n", ((mainGame->chkIgnore1->isChecked()) ? 1 : 0)); fprintf(fp, "mute_opponent = %d\n", ((mainGame->chkIgnore1->isChecked()) ? 1 : 0));
fprintf(fp, "mute_spectators = %d\n", ((mainGame->chkIgnore2->isChecked()) ? 1 : 0)); fprintf(fp, "mute_spectators = %d\n", ((mainGame->chkIgnore2->isChecked()) ? 1 : 0));
fprintf(fp, "hide_setname = %d\n", ((mainGame->chkHideSetname->isChecked()) ? 1 : 0)); fprintf(fp, "hide_setname = %d\n", ((mainGame->chkHideSetname->isChecked()) ? 1 : 0));
fprintf(fp, "hide_chain_button = %d\n", ((mainGame->chkHideChainButton->isChecked()) ? 1 : 0)); fprintf(fp, "hide_hint_button = %d\n", ((mainGame->chkHideHintButton->isChecked()) ? 1 : 0));
fprintf(fp, "#control_mode = 0: Key A/S/D/R. control_mode = 1: MouseLeft/MouseRight/NULL/F9\n"); fprintf(fp, "#control_mode = 0: Key A/S/D/R Chain Buttons. control_mode = 1: MouseLeft/MouseRight/NULL/F9 Without Chain Buttons\n");
fprintf(fp, "control_mode = %d\n", gameConf.control_mode); fprintf(fp, "control_mode = %d\n", gameConf.control_mode);
fprintf(fp, "draw_field_spell = %d\n", gameConf.draw_field_spell); fprintf(fp, "draw_field_spell = %d\n", gameConf.draw_field_spell);
fprintf(fp, "separate_clear_button = %d\n", gameConf.separate_clear_button); fprintf(fp, "separate_clear_button = %d\n", gameConf.separate_clear_button);
......
...@@ -32,7 +32,7 @@ struct Config { ...@@ -32,7 +32,7 @@ struct Config {
int chkIgnore1; int chkIgnore1;
int chkIgnore2; int chkIgnore2;
int chkHideSetname; int chkHideSetname;
int chkHideChainButton; int chkHideHintButton;
int control_mode; int control_mode;
int draw_field_spell; int draw_field_spell;
int separate_clear_button; int separate_clear_button;
...@@ -193,7 +193,7 @@ public: ...@@ -193,7 +193,7 @@ public:
irr::gui::IGUICheckBox* chkAutoChain; irr::gui::IGUICheckBox* chkAutoChain;
irr::gui::IGUICheckBox* chkWaitChain; irr::gui::IGUICheckBox* chkWaitChain;
irr::gui::IGUICheckBox* chkHideSetname; irr::gui::IGUICheckBox* chkHideSetname;
irr::gui::IGUICheckBox* chkHideChainButton; irr::gui::IGUICheckBox* chkHideHintButton;
irr::gui::IGUIListBox* lstLog; irr::gui::IGUIListBox* lstLog;
irr::gui::IGUIButton* btnClearLog; irr::gui::IGUIButton* btnClearLog;
irr::gui::IGUIButton* btnSaveLog; irr::gui::IGUIButton* btnSaveLog;
......
...@@ -340,7 +340,7 @@ ...@@ -340,7 +340,7 @@
!system 1352 主要信息: !system 1352 主要信息:
!system 1353 播放起始于回合: !system 1353 播放起始于回合:
!system 1354 不显示卡片系列 !system 1354 不显示卡片系列
!system 1355 不显示询问连锁按钮 !system 1355 不显示提示按钮
!system 1360 上一步 !system 1360 上一步
!system 1370 星数↑ !system 1370 星数↑
!system 1371 攻击↑ !system 1371 攻击↑
......
...@@ -18,7 +18,8 @@ waitchain = 0 ...@@ -18,7 +18,8 @@ waitchain = 0
mute_opponent = 0 mute_opponent = 0
mute_spectators = 0 mute_spectators = 0
hide_setname = 0 hide_setname = 0
hide_chain_button = 0 hide_hint_button = 1
#control_mode = 0: Key A/S/D/R. control_mode = 1: MouseLeft/MouseRight/NULL/F9 #control_mode = 0: Key A/S/D/R Chain Buttons. control_mode = 1: MouseLeft/MouseRight/NULL/F9 Without Chain Buttons
control_mode = 0 control_mode = 0
draw_field_spell = 1 draw_field_spell = 1
separate_clear_button = 1
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