Commit 43370617 authored by 独孤朲's avatar 独孤朲 Committed by GitHub

Merge pull request #1906 from mercury233/patch-2

update announce card dialog
parents f1a7cfe6 038930e5
...@@ -1500,11 +1500,16 @@ void ClientField::UpdateDeclarableCodeType(bool enter) { ...@@ -1500,11 +1500,16 @@ void ClientField::UpdateDeclarableCodeType(bool enter) {
auto cp = dataManager.GetCodePointer(cit->first); //verified by _strings auto cp = dataManager.GetCodePointer(cit->first); //verified by _strings
//datas.alias can be double card names or alias //datas.alias can be double card names or alias
if(is_declarable(cp->second, declarable_type)) { if(is_declarable(cp->second, declarable_type)) {
if(wcscmp(pname, cit->second.name) == 0) { //exact match
mainGame->lstANCard->insertItem(0, cit->second.name, -1);
ancard.insert(ancard.begin(), cit->first);
} else {
mainGame->lstANCard->addItem(cit->second.name); mainGame->lstANCard->addItem(cit->second.name);
ancard.push_back(cit->first); ancard.push_back(cit->first);
} }
} }
} }
}
} }
void ClientField::UpdateDeclarableCodeOpcode(bool enter) { void ClientField::UpdateDeclarableCodeOpcode(bool enter) {
const wchar_t* pname = mainGame->ebANCard->getText(); const wchar_t* pname = mainGame->ebANCard->getText();
...@@ -1527,11 +1532,16 @@ void ClientField::UpdateDeclarableCodeOpcode(bool enter) { ...@@ -1527,11 +1532,16 @@ void ClientField::UpdateDeclarableCodeOpcode(bool enter) {
auto cp = dataManager.GetCodePointer(cit->first); //verified by _strings auto cp = dataManager.GetCodePointer(cit->first); //verified by _strings
//datas.alias can be double card names or alias //datas.alias can be double card names or alias
if(is_declarable(cp->second, opcode)) { if(is_declarable(cp->second, opcode)) {
if(wcscmp(pname, cit->second.name) == 0) { //exact match
mainGame->lstANCard->insertItem(0, cit->second.name, -1);
ancard.insert(ancard.begin(), cit->first);
} else {
mainGame->lstANCard->addItem(cit->second.name); mainGame->lstANCard->addItem(cit->second.name);
ancard.push_back(cit->first); ancard.push_back(cit->first);
} }
} }
} }
}
} }
void ClientField::UpdateDeclarableCode(bool enter) { void ClientField::UpdateDeclarableCode(bool enter) {
if(opcode.size() == 0) if(opcode.size() == 0)
......
...@@ -891,6 +891,13 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -891,6 +891,13 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
} }
break; break;
} }
case LISTBOX_ANCARD: {
int sel = mainGame->lstANCard->getSelected();
if(sel != -1) {
mainGame->ShowCardInfo(ancard[sel]);
}
break;
}
} }
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