Commit 6b998431 authored by mercury233's avatar mercury233

Merge branch 'master' of https://github.com/Fluorohydride/ygopro into server

parents c504129a bf1ea010
......@@ -1526,21 +1526,8 @@ void ClientField::UpdateDeclarableList() {
return;
}
if(pname[0] == 0) {
std::vector<int> cache;
cache.swap(ancard);
int sel = mainGame->lstANCard->getSelected();
int selcode = (sel == -1) ? 0 : cache[sel];
mainGame->lstANCard->clear();
for(const auto& trycode : cache) {
if(dataManager.GetString(trycode, &cstr) && dataManager.GetData(trycode, &cd) && is_declarable(cd, declare_opcodes)) {
ancard.push_back(trycode);
mainGame->lstANCard->addItem(cstr.name.c_str());
if(trycode == selcode)
mainGame->lstANCard->setSelected(cstr.name.c_str());
}
}
if(!ancard.empty())
return;
trycode = (sel == -1) ? 0 : ancard[sel];
}
mainGame->lstANCard->clear();
ancard.clear();
......@@ -1549,7 +1536,7 @@ void ClientField::UpdateDeclarableList() {
auto cp = dataManager.GetCodePointer(cit->first); //verified by _strings
//datas.alias can be double card names or alias
if(is_declarable(cp->second, declare_opcodes)) {
if(pname == cit->second.name) { //exact match
if(pname == cit->second.name || trycode == cit->first) { //exact match or last used
mainGame->lstANCard->insertItem(0, cit->second.name.c_str(), -1);
ancard.insert(ancard.begin(), cit->first);
} else {
......
......@@ -227,10 +227,10 @@ const wchar_t* DataManager::GetText(int code) {
return csit->second.text.c_str();
return unknown_string;
}
const wchar_t* DataManager::GetDesc(int strCode) {
if((unsigned int)strCode < 10000u)
const wchar_t* DataManager::GetDesc(unsigned int strCode) {
if(strCode < 10000u)
return GetSysString(strCode);
unsigned int code = strCode >> 4;
unsigned int code = (strCode >> 4) & 0x0fffffff;
unsigned int offset = strCode & 0xf;
auto csit = _strings.find(code);
if(csit == _strings.end())
......
......@@ -29,7 +29,7 @@ public:
bool GetString(int code, CardString* pStr);
const wchar_t* GetName(int code);
const wchar_t* GetText(int code);
const wchar_t* GetDesc(int strCode);
const wchar_t* GetDesc(unsigned int strCode);
const wchar_t* GetSysString(int code);
const wchar_t* GetVictoryString(int code);
const wchar_t* GetCounterName(int code);
......
......@@ -846,7 +846,8 @@ bool Game::Initialize() {
btnLoadSinglePlay = env->addButton(rect<s32>(459, 301, 569, 326), tabSingle, BUTTON_LOAD_SINGLEPLAY, dataManager.GetSysString(1211));
btnSinglePlayCancel = env->addButton(rect<s32>(459, 331, 569, 356), tabSingle, BUTTON_CANCEL_SINGLEPLAY, dataManager.GetSysString(1210));
env->addStaticText(dataManager.GetSysString(1352), rect<s32>(360, 10, 550, 30), false, true, tabSingle);
stSinglePlayInfo = env->addStaticText(L"", rect<s32>(360, 40, 560, 280), false, true, tabSingle);
stSinglePlayInfo = env->addStaticText(L"", rect<s32>(360, 40, 560, 160), false, true, tabSingle);
chkSinglePlayReturnDeckTop = env->addCheckBox(false, rect<s32>(360, 260, 560, 280), tabSingle, -1, dataManager.GetSysString(1238));
//replay save
wReplaySave = env->addWindow(rect<s32>(510, 200, 820, 320), false, dataManager.GetSysString(1340));
wReplaySave->getCloseButton()->setVisible(false);
......
......@@ -398,6 +398,7 @@ public:
irr::gui::IGUICheckBox* chkBotNoShuffleDeck;
irr::gui::IGUIListBox* lstSinglePlayList;
irr::gui::IGUIStaticText* stSinglePlayInfo;
irr::gui::IGUICheckBox* chkSinglePlayReturnDeckTop;
irr::gui::IGUIButton* btnLoadSinglePlay;
irr::gui::IGUIButton* btnSinglePlayCancel;
//hand
......
......@@ -32,7 +32,7 @@ int SingleMode::SinglePlayThread() {
const int start_lp = 8000;
const int start_hand = 5;
const int draw_count = 1;
const int opt = 0;
int opt = 0;
std::random_device rd;
unsigned int seed = rd();
mt19937 rnd(seed);
......@@ -50,6 +50,8 @@ int SingleMode::SinglePlayThread() {
mainGame->dInfo.clientname[0] = 0;
mainGame->dInfo.player_type = 0;
mainGame->dInfo.turn = 0;
if(mainGame->chkSinglePlayReturnDeckTop->isChecked())
opt |= DUEL_RETURN_DECK_TOP;
char filename[256];
size_t slen = 0;
if(open_file) {
......
Subproject commit 29bce529c456f5837bbe1a0e44954e7a7b3657e4
Subproject commit ee34f69cf3d3826fb74b87c1d16af497076296a8
Subproject commit 01c0e6c7881523752ca17e3dd16911dbe65877ec
Subproject commit 95dd7c80a00549265f7f6891705484cb37fc0871
......@@ -301,6 +301,7 @@
!system 1235 主机密码:
!system 1236 规则:
!system 1237 每回合时间:
!system 1238 不洗切时回卡组改为回顶端
!system 1244 单局模式
!system 1245 比赛模式
!system 1246 TAG
......@@ -638,6 +639,8 @@
!counter 0x105c 燃烧指示物
!counter 0x5d 指示物(机巧传-神使记纪图)
!counter 0x5e 皇之键指示物
!counter 0x5f 拼图指示物
!counter 0x60 指示物(北极天熊辐射)
#setnames, using tab for comment
!setname 0x1 正义盟军 AOJ
!setname 0x2 次世代 ジェネクス
......@@ -1118,3 +1121,5 @@
!setname 0x170 甲虫骑兵 Beetrooper
!setname 0x171 朋克 P.U.N.K.
!setname 0x172 救祓少女 エクソシスター
!setname 0x173 恐啡肽狂龙 ダイノルフィア
!setname 0x174 恶魔娘 悪魔嬢
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