Commit 2a0cf61c authored by VanillaSalt's avatar VanillaSalt

update deck_con

parent 08dd3309
This diff is collapsed.
......@@ -11,6 +11,9 @@ namespace ygo {
class DeckBuilder: public irr::IEventReceiver {
public:
virtual bool OnEvent(const irr::SEvent& event);
void Initialize();
void Terminate();
void GetHoveredCard();
void FilterCards();
void StartFilter();
void ClearFilter();
......@@ -18,7 +21,15 @@ public:
void SortList();
bool CardNameContains(const wchar_t *haystack, const wchar_t *needle);
bool push_main(code_pointer pointer, int seq = -1);
bool push_extra(code_pointer pointer, int seq = -1);
bool push_side(code_pointer pointer, int seq = -1);
void pop_main(int seq);
void pop_extra(int seq);
void pop_side(int seq);
bool check_limit(code_pointer pointer);
long long filter_effect;
unsigned int filter_type;
unsigned int filter_type2;
......@@ -34,6 +45,7 @@ public:
unsigned int filter_scl;
unsigned int filter_marks;
int filter_lm;
position2di mouse_pos;
int hovered_code;
int hovered_pos;
int hovered_seq;
......@@ -45,9 +57,9 @@ public:
size_t pre_extrac;
size_t pre_sidec;
code_pointer draging_pointer;
bool is_deleting;
bool is_clearing;
s32 prevID;
bool is_modified;
std::unordered_map<int, int>* filterList;
std::vector<code_pointer> results;
wchar_t result_string[8];
......
......@@ -911,6 +911,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;
fseek(fp, 0, SEEK_END);
int fsize = ftell(fp);
fseek(fp, 0, SEEK_SET);
......@@ -969,6 +970,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 {
// options allowing multiple words
sscanf(linebuf, "%s = %240[^\n]", strbuf, valbuf);
......@@ -1025,6 +1028,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);
fclose(fp);
}
void Game::ShowCardInfo(int code) {
......
......@@ -38,6 +38,7 @@ struct Config {
int draw_field_spell;
int separate_clear_button;
int auto_search_limit;
int prompt_to_discard_deck_changes;
};
struct DuelInfo {
......
......@@ -244,46 +244,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame->ebDeckname->setText(L"");
}
mainGame->HideElement(mainGame->wMainMenu);
mainGame->is_building = true;
mainGame->is_siding = false;
mainGame->wInfos->setVisible(true);
mainGame->wCardImg->setVisible(true);
mainGame->wDeckEdit->setVisible(true);
mainGame->wFilter->setVisible(true);
mainGame->wSort->setVisible(true);
mainGame->btnLeaveGame->setVisible(true);
mainGame->btnLeaveGame->setText(dataManager.GetSysString(1306));
mainGame->btnSideOK->setVisible(false);
mainGame->deckBuilder.filterList = deckManager._lfList[0].content;
mainGame->cbDBLFList->setSelected(0);
mainGame->cbCardType->setSelected(0);
mainGame->cbCardType2->setSelected(0);
mainGame->cbAttribute->setSelected(0);
mainGame->cbRace->setSelected(0);
mainGame->ebAttack->setText(L"");
mainGame->ebDefense->setText(L"");
mainGame->ebStar->setText(L"");
mainGame->ebScale->setText(L"");
mainGame->cbCardType2->setEnabled(false);
mainGame->cbAttribute->setEnabled(false);
mainGame->cbRace->setEnabled(false);
mainGame->ebAttack->setEnabled(false);
mainGame->ebDefense->setEnabled(false);
mainGame->ebStar->setEnabled(false);
mainGame->ebScale->setEnabled(false);
mainGame->deckBuilder.filter_effect = 0;
mainGame->deckBuilder.filter_marks = 0;
mainGame->deckBuilder.result_string[0] = L'0';
mainGame->deckBuilder.result_string[1] = 0;
mainGame->deckBuilder.results.clear();
mainGame->deckBuilder.is_draging = false;
mainGame->deckBuilder.is_deleting = false;
mainGame->deckBuilder.is_clearing = false;
mainGame->device->setEventReceiver(&mainGame->deckBuilder);
for(int i = 0; i < 32; ++i)
mainGame->chkCategory[i]->setChecked(false);
for(int i = 0; i < 8; i++)
mainGame->btnMark[i]->setPressed(false);
mainGame->deckBuilder.Initialize();
break;
}
}
......
......@@ -356,6 +356,7 @@
!system 1353 播放起始于回合:
!system 1354 不显示卡片系列
!system 1355 不显示提示按钮
!system 1356 是否要放弃改变?
!system 1360 上一步
!system 1370 星数↑
!system 1371 攻击↑
......
......@@ -26,3 +26,4 @@ draw_field_spell = 1
separate_clear_button = 1
#auto_search_limit >= 0: Start search automatically when the user enters N chars.
auto_search_limit = -1
prompt_to_discard_deck_changes = 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