Commit 3435621a authored by mercury233's avatar mercury233

update auto pos

parent 8258cf65
......@@ -1304,7 +1304,9 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
select_hint = 0;
mainGame->stHintMsg->setText(textBuffer);
mainGame->stHintMsg->setVisible(true);
if (mainGame->dInfo.curMsg == MSG_SELECT_PLACE && mainGame->chkAutoPos->isChecked()) {
if (mainGame->dInfo.curMsg == MSG_SELECT_PLACE && (
(mainGame->chkMAutoPos->isChecked() && mainGame->dField.selectable_field & 0x7f007f) ||
(mainGame->chkSTAutoPos->isChecked() && !(mainGame->dField.selectable_field & 0x7f007f)))) {
unsigned int filter;
if (mainGame->dField.selectable_field & 0x7f) {
respbuf[0] = mainGame->LocalPlayer(0);
......
......@@ -249,17 +249,19 @@ bool Game::Initialize() {
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));
chkAutoPos = env->addCheckBox(false, rect<s32>(20, 20, 280, 45), tabSystem, -1, dataManager.GetSysString(1274));
chkAutoPos->setChecked(gameConf.chkAutoPos != 0);
chkRandomPos = env->addCheckBox(false, rect<s32>(40, 50, 300, 75), tabSystem, -1, dataManager.GetSysString(1275));
chkMAutoPos = env->addCheckBox(false, rect<s32>(20, 20, 280, 45), tabSystem, -1, dataManager.GetSysString(1274));
chkMAutoPos->setChecked(gameConf.chkMAutoPos != 0);
chkSTAutoPos = env->addCheckBox(false, rect<s32>(20, 50, 280, 75), tabSystem, -1, dataManager.GetSysString(1278));
chkSTAutoPos->setChecked(gameConf.chkSTAutoPos != 0);
chkRandomPos = env->addCheckBox(false, rect<s32>(40, 80, 300, 105), tabSystem, -1, dataManager.GetSysString(1275));
chkRandomPos->setChecked(gameConf.chkRandomPos != 0);
chkAutoChain = env->addCheckBox(false, rect<s32>(20, 80, 280, 105), tabSystem, -1, dataManager.GetSysString(1276));
chkAutoChain = env->addCheckBox(false, rect<s32>(20, 110, 280, 135), tabSystem, -1, dataManager.GetSysString(1276));
chkAutoChain->setChecked(gameConf.chkAutoChain != 0);
chkWaitChain = env->addCheckBox(false, rect<s32>(20, 110, 280, 135), tabSystem, -1, dataManager.GetSysString(1277));
chkWaitChain = env->addCheckBox(false, rect<s32>(20, 140, 280, 165), tabSystem, -1, dataManager.GetSysString(1277));
chkWaitChain->setChecked(gameConf.chkWaitChain != 0);
chkIgnore1 = env->addCheckBox(false, rect<s32>(20, 170, 280, 195), tabSystem, -1, dataManager.GetSysString(1290));
chkIgnore1 = env->addCheckBox(false, rect<s32>(20, 200, 280, 225), tabSystem, -1, dataManager.GetSysString(1290));
chkIgnore1->setChecked(gameConf.chkIgnore1 != 0);
chkIgnore2 = env->addCheckBox(false, rect<s32>(20, 200, 280, 225), tabSystem, -1, dataManager.GetSysString(1291));
chkIgnore2 = env->addCheckBox(false, rect<s32>(20, 230, 280, 255), 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));
chkHideSetname->setChecked(gameConf.chkHideSetname != 0);
......@@ -897,7 +899,8 @@ void Game::LoadConfig() {
gameConf.lastport[0] = 0;
gameConf.roompass[0] = 0;
//settings
gameConf.chkAutoPos = 1;
gameConf.chkMAutoPos = 0;
gameConf.chkSTAutoPos = 1;
gameConf.chkRandomPos = 0;
gameConf.chkAutoChain = 0;
gameConf.chkWaitChain = 0;
......@@ -941,8 +944,10 @@ void Game::LoadConfig() {
} else if(!strcmp(strbuf, "roompass")) {
BufferIO::DecodeUTF8(valbuf, wstr);
BufferIO::CopyWStr(wstr, gameConf.roompass, 20);
} else if(!strcmp(strbuf, "autopos")) {
gameConf.chkAutoPos = atoi(valbuf);
} else if(!strcmp(strbuf, "automonsterpos")) {
gameConf.chkMAutoPos = atoi(valbuf);
} else if(!strcmp(strbuf, "autospellpos")) {
gameConf.chkSTAutoPos = atoi(valbuf);
} else if(!strcmp(strbuf, "randompos")) {
gameConf.chkRandomPos = atoi(valbuf);
} else if(!strcmp(strbuf, "autochain")) {
......@@ -1006,7 +1011,8 @@ void Game::SaveConfig() {
BufferIO::EncodeUTF8(gameConf.lastport, linebuf);
fprintf(fp, "lastport = %s\n", linebuf);
//settings
fprintf(fp, "autopos = %d\n", ((mainGame->chkAutoPos->isChecked()) ? 1 : 0));
fprintf(fp, "automonsterpos = %d\n", ((mainGame->chkMAutoPos->isChecked()) ? 1 : 0));
fprintf(fp, "autospellpos = %d\n", ((mainGame->chkSTAutoPos->isChecked()) ? 1 : 0));
fprintf(fp, "randompos = %d\n", ((mainGame->chkRandomPos->isChecked()) ? 1 : 0));
fprintf(fp, "autochain = %d\n", ((mainGame->chkAutoChain->isChecked()) ? 1 : 0));
fprintf(fp, "waitchain = %d\n", ((mainGame->chkWaitChain->isChecked()) ? 1 : 0));
......
......@@ -25,7 +25,8 @@ struct Config {
wchar_t numfont[256];
wchar_t roompass[20];
//settings
int chkAutoPos;
int chkMAutoPos;
int chkSTAutoPos;
int chkRandomPos;
int chkAutoChain;
int chkWaitChain;
......@@ -201,7 +202,8 @@ public:
irr::gui::IGUIStaticText* stSetName;
irr::gui::IGUIStaticText* stText;
irr::gui::IGUIScrollBar* scrCardText;
irr::gui::IGUICheckBox* chkAutoPos;
irr::gui::IGUICheckBox* chkMAutoPos;
irr::gui::IGUICheckBox* chkSTAutoPos;
irr::gui::IGUICheckBox* chkRandomPos;
irr::gui::IGUICheckBox* chkAutoChain;
irr::gui::IGUICheckBox* chkWaitChain;
......
......@@ -11,7 +11,8 @@ numfont = c:/windows/fonts/arialbd.ttf
serverport = 7911
lasthost = 127.0.0.1
lastport = 7911
autopos = 1
automonsterpos = 0
autospellpos = 1
randompos = 0
autochain = 0
waitchain = 0
......
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