Commit a17bfa79 authored by DailyShana's avatar DailyShana Committed by mercury233

update declaring card name (#2198)

remove unnecessary typing enter key
parent 63a9cddd
...@@ -1418,7 +1418,7 @@ static bool is_declarable(T const& cd, const std::vector<int>& opcode) { ...@@ -1418,7 +1418,7 @@ static bool is_declarable(T const& cd, const std::vector<int>& opcode) {
return cd.code == CARD_MARINE_DOLPHIN || cd.code == CARD_TWINKLE_MOSS return cd.code == CARD_MARINE_DOLPHIN || cd.code == CARD_TWINKLE_MOSS
|| (!cd.alias && (cd.type & (TYPE_MONSTER + TYPE_TOKEN)) != (TYPE_MONSTER + TYPE_TOKEN)); || (!cd.alias && (cd.type & (TYPE_MONSTER + TYPE_TOKEN)) != (TYPE_MONSTER + TYPE_TOKEN));
} }
void ClientField::UpdateDeclarableCodeType(bool enter) { void ClientField::UpdateDeclarableCodeType() {
const wchar_t* pname = mainGame->ebANCard->getText(); const wchar_t* pname = mainGame->ebANCard->getText();
int trycode = BufferIO::GetVal(pname); int trycode = BufferIO::GetVal(pname);
CardString cstr; CardString cstr;
...@@ -1430,7 +1430,7 @@ void ClientField::UpdateDeclarableCodeType(bool enter) { ...@@ -1430,7 +1430,7 @@ void ClientField::UpdateDeclarableCodeType(bool enter) {
ancard.push_back(trycode); ancard.push_back(trycode);
return; return;
} }
if((pname[0] == 0 || pname[1] == 0) && !enter) { if(pname[0] == 0) {
std::vector<int> cache; std::vector<int> cache;
cache.swap(ancard); cache.swap(ancard);
int sel = mainGame->lstANCard->getSelected(); int sel = mainGame->lstANCard->getSelected();
...@@ -1465,7 +1465,7 @@ void ClientField::UpdateDeclarableCodeType(bool enter) { ...@@ -1465,7 +1465,7 @@ void ClientField::UpdateDeclarableCodeType(bool enter) {
} }
} }
} }
void ClientField::UpdateDeclarableCodeOpcode(bool enter) { void ClientField::UpdateDeclarableCodeOpcode() {
const wchar_t* pname = mainGame->ebANCard->getText(); const wchar_t* pname = mainGame->ebANCard->getText();
int trycode = BufferIO::GetVal(pname); int trycode = BufferIO::GetVal(pname);
CardString cstr; CardString cstr;
...@@ -1477,7 +1477,7 @@ void ClientField::UpdateDeclarableCodeOpcode(bool enter) { ...@@ -1477,7 +1477,7 @@ void ClientField::UpdateDeclarableCodeOpcode(bool enter) {
ancard.push_back(trycode); ancard.push_back(trycode);
return; return;
} }
if((pname[0] == 0 || pname[1] == 0) && !enter) { if(pname[0] == 0) {
std::vector<int> cache; std::vector<int> cache;
cache.swap(ancard); cache.swap(ancard);
int sel = mainGame->lstANCard->getSelected(); int sel = mainGame->lstANCard->getSelected();
...@@ -1512,10 +1512,10 @@ void ClientField::UpdateDeclarableCodeOpcode(bool enter) { ...@@ -1512,10 +1512,10 @@ void ClientField::UpdateDeclarableCodeOpcode(bool enter) {
} }
} }
} }
void ClientField::UpdateDeclarableCode(bool enter) { void ClientField::UpdateDeclarableCode() {
if(opcode.size() == 0) if(opcode.size() == 0)
UpdateDeclarableCodeType(enter); UpdateDeclarableCodeType();
else else
UpdateDeclarableCodeOpcode(enter); UpdateDeclarableCodeOpcode();
} }
} }
...@@ -112,9 +112,9 @@ public: ...@@ -112,9 +112,9 @@ public:
void check_sel_sum_t(const std::set<ClientCard*>& left, int acc); void check_sel_sum_t(const std::set<ClientCard*>& left, int acc);
bool check_sum(std::set<ClientCard*>::const_iterator index, std::set<ClientCard*>::const_iterator end, int acc, int count); bool check_sum(std::set<ClientCard*>::const_iterator index, std::set<ClientCard*>::const_iterator end, int acc, int count);
void UpdateDeclarableCodeType(bool enter); void UpdateDeclarableCodeType();
void UpdateDeclarableCodeOpcode(bool enter); void UpdateDeclarableCodeOpcode();
void UpdateDeclarableCode(bool enter); void UpdateDeclarableCode();
irr::gui::IGUIElement* panel; irr::gui::IGUIElement* panel;
std::vector<int> ancard; std::vector<int> ancard;
......
...@@ -3408,7 +3408,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -3408,7 +3408,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
mainGame->ebANCard->setText(L""); mainGame->ebANCard->setText(L"");
mainGame->wANCard->setText(textBuffer); mainGame->wANCard->setText(textBuffer);
mainGame->dField.UpdateDeclarableCode(false); mainGame->dField.UpdateDeclarableCode();
mainGame->PopupElement(mainGame->wANCard); mainGame->PopupElement(mainGame->wANCard);
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
return false; return false;
...@@ -3447,7 +3447,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -3447,7 +3447,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
mainGame->ebANCard->setText(L""); mainGame->ebANCard->setText(L"");
mainGame->wANCard->setText(textBuffer); mainGame->wANCard->setText(textBuffer);
mainGame->dField.UpdateDeclarableCode(false); mainGame->dField.UpdateDeclarableCode();
mainGame->PopupElement(mainGame->wANCard); mainGame->PopupElement(mainGame->wANCard);
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
return false; return false;
......
...@@ -959,7 +959,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -959,7 +959,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
case irr::gui::EGET_EDITBOX_CHANGED: { case irr::gui::EGET_EDITBOX_CHANGED: {
switch(id) { switch(id) {
case EDITBOX_ANCARD: { case EDITBOX_ANCARD: {
UpdateDeclarableCode(false); UpdateDeclarableCode();
break; break;
} }
} }
...@@ -968,7 +968,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -968,7 +968,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
case irr::gui::EGET_EDITBOX_ENTER: { case irr::gui::EGET_EDITBOX_ENTER: {
switch(id) { switch(id) {
case EDITBOX_ANCARD: { case EDITBOX_ANCARD: {
UpdateDeclarableCode(true); UpdateDeclarableCode();
break; break;
} }
} }
......
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