Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Fluorohydride/ygopro
Browse files Browse the repository at this point in the history
  • Loading branch information
mercury233 committed Jun 17, 2019
2 parents beaf490 + 284bc47 commit f326ccb
Show file tree
Hide file tree
Showing 6 changed files with 227 additions and 52 deletions.
4 changes: 2 additions & 2 deletions gframe/data_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ const wchar_t* DataManager::GetSetName(int code) {
}
unsigned int DataManager::GetSetCode(const wchar_t* setname) {
for(auto csit = _setnameStrings.begin(); csit != _setnameStrings.end(); ++csit) {
auto xpos = csit->second.find_first_of(L'|');//setname|extra info
if(csit->second.compare(0, xpos, setname) == 0)
auto xpos = csit->second.find_first_of(L'|');//setname|another setname or extra info
if(csit->second.compare(0, xpos, setname) == 0 || csit->second.compare(xpos + 1, csit->second.length(), setname) == 0)
return csit->first;
}
return 0;
Expand Down
10 changes: 5 additions & 5 deletions gframe/duelclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -683,8 +683,11 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->btnChainWhenAvail->setVisible(false);
mainGame->btnCancelOrFinish->setVisible(false);
mainGame->btnShuffle->setVisible(false);
time_t nowtime = time(NULL);
tm* localedtime = localtime(&nowtime);
char* prep = pdata;
Replay new_replay;
memcpy(&new_replay.pheader, prep, sizeof(ReplayHeader));
time_t starttime = new_replay.pheader.seed;
tm* localedtime = localtime(&starttime);
wchar_t timetext[40];
wcsftime(timetext, 40, L"%Y-%m-%d %H-%M-%S", localedtime);
mainGame->ebRSName->setText(timetext);
Expand All @@ -705,9 +708,6 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->WaitFrameSignal(30);
}
if(mainGame->actionParam || !is_host) {
char* prep = pdata;
Replay new_replay;
memcpy(&new_replay.pheader, prep, sizeof(ReplayHeader));
prep += sizeof(ReplayHeader);
memcpy(new_replay.comp_data, prep, len - sizeof(ReplayHeader) - 1);
new_replay.comp_size = len - sizeof(ReplayHeader) - 1;
Expand Down
2 changes: 2 additions & 0 deletions gframe/event_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
case BUTTON_CARD_4: {
if(mainGame->dInfo.isReplay)
break;
mainGame->stCardListTip->setVisible(false);
switch(mainGame->dInfo.curMsg) {
case MSG_SELECT_IDLECMD:
case MSG_SELECT_BATTLECMD:
Expand Down Expand Up @@ -759,6 +760,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break;
}
case BUTTON_CARD_SEL_OK: {
mainGame->stCardListTip->setVisible(false);
if(mainGame->dInfo.isReplay) {
mainGame->HideElement(mainGame->wCardSelect);
break;
Expand Down
10 changes: 5 additions & 5 deletions gframe/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,13 +459,13 @@ bool Game::Initialize() {
cbANNumber->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
btnANNumberOK = env->addButton(rect<s32>(80, 60, 150, 85), wANNumber, BUTTON_ANNUMBER_OK, dataManager.GetSysString(1211));
//announce card
wANCard = env->addWindow(rect<s32>(560, 170, 770, 370), false, L"");
wANCard = env->addWindow(rect<s32>(510, 120, 820, 420), false, L"");
wANCard->getCloseButton()->setVisible(false);
wANCard->setVisible(false);
ebANCard = env->addEditBox(L"", rect<s32>(20, 25, 190, 45), true, wANCard, EDITBOX_ANCARD);
ebANCard = env->addEditBox(L"", rect<s32>(20, 25, 290, 45), true, wANCard, EDITBOX_ANCARD);
ebANCard->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
lstANCard = env->addListBox(rect<s32>(20, 50, 190, 160), wANCard, LISTBOX_ANCARD, true);
btnANCardOK = env->addButton(rect<s32>(60, 165, 150, 190), wANCard, BUTTON_ANCARD_OK, dataManager.GetSysString(1211));
lstANCard = env->addListBox(rect<s32>(20, 50, 290, 265), wANCard, LISTBOX_ANCARD, true);
btnANCardOK = env->addButton(rect<s32>(110, 270, 200, 295), wANCard, BUTTON_ANCARD_OK, dataManager.GetSysString(1211));
//announce attribute
wANAttribute = env->addWindow(rect<s32>(500, 200, 830, 285), false, dataManager.GetSysString(562));
wANAttribute->getCloseButton()->setVisible(false);
Expand Down Expand Up @@ -1609,7 +1609,7 @@ void Game::OnResize() {
wPosSelect->setRelativePosition(ResizeWin(340, 200, 935, 410));
wCardSelect->setRelativePosition(ResizeWin(320, 100, 1000, 400));
wANNumber->setRelativePosition(ResizeWin(550, 200, 780, 295));
wANCard->setRelativePosition(ResizeWin(560, 170, 770, 370));
wANCard->setRelativePosition(ResizeWin(510, 120, 820, 420));
wANAttribute->setRelativePosition(ResizeWin(500, 200, 830, 285));
wANRace->setRelativePosition(ResizeWin(480, 200, 850, 410));
wReplaySave->setRelativePosition(ResizeWin(510, 200, 820, 320));
Expand Down
Loading

0 comments on commit f326ccb

Please sign in to comment.