Commit a7e75b1e authored by salix5's avatar salix5

add F4, F8

parent dfb6b72e
......@@ -351,9 +351,12 @@ void ClientField::ClearChainSelect() {
}
// needs to be synchronized with EGET_SCROLL_BAR_CHANGED
void ClientField::ShowSelectCard(bool buttonok, bool chain) {
if(selectable_cards.size() <= 5) {
int startpos = 30 + 125 * (5 - selectable_cards.size()) / 2;
for(size_t i = 0; i < selectable_cards.size(); ++i) {
int startpos;
if(selectable_cards.size() <= 5)
startpos = 30 + 125 * (5 - selectable_cards.size()) / 2;
else
startpos = 30;
for(size_t i = 0; i < min(selectable_cards.size(), 5); ++i) {
if(selectable_cards[i]->code)
mainGame->imageLoading.insert(std::make_pair(mainGame->btnCardSelect[i], selectable_cards[i]->code));
else if(chain)
......@@ -366,10 +369,11 @@ void ClientField::ShowSelectCard(bool buttonok, bool chain) {
if(mainGame->dInfo.curMsg != MSG_SORT_CHAIN && mainGame->dInfo.curMsg != MSG_SORT_CARD) {
if(chain && selectable_cards[i]->is_conti)
myswprintf(formatBuffer, L"%ls", DataManager::unknown_string);
else if(selectable_cards[i]->location == LOCATION_OVERLAY)
else if(selectable_cards[i]->location == LOCATION_OVERLAY) {
myswprintf(formatBuffer, L"%ls[%d](%d)",
dataManager.FormatLocation(selectable_cards[i]->overlayTarget->location, selectable_cards[i]->overlayTarget->sequence),
selectable_cards[i]->overlayTarget->sequence + 1, selectable_cards[i]->sequence + 1);
}
else
myswprintf(formatBuffer, L"%ls[%d]", dataManager.FormatLocation(selectable_cards[i]->location, selectable_cards[i]->sequence),
selectable_cards[i]->sequence + 1);
......@@ -387,47 +391,15 @@ void ClientField::ShowSelectCard(bool buttonok, bool chain) {
}
mainGame->stCardPos[i]->setRelativePosition(rect<s32>(startpos + i * 125, 30, startpos + 120 + i * 125, 50));
}
if(selectable_cards.size() <= 5) {
for(int i = selectable_cards.size(); i < 5; ++i) {
mainGame->btnCardSelect[i]->setVisible(false);
mainGame->stCardPos[i]->setVisible(false);
}
mainGame->scrCardList->setPos(0);
mainGame->scrCardList->setVisible(false);
} else {
for(int i = 0; i < 5; ++i) {
if(selectable_cards[i]->code)
mainGame->imageLoading.insert(std::make_pair(mainGame->btnCardSelect[i], selectable_cards[i]->code));
else if(chain)
mainGame->imageLoading.insert(std::make_pair(mainGame->btnCardSelect[i], selectable_cards[i]->chain_code));
else
mainGame->btnCardSelect[i]->setImage(imageManager.tCover);
mainGame->btnCardSelect[i]->setRelativePosition(rect<s32>(30 + i * 125, 55, 30 + 120 + i * 125, 225));
mainGame->btnCardSelect[i]->setPressed(false);
mainGame->btnCardSelect[i]->setVisible(true);
if(mainGame->dInfo.curMsg != MSG_SORT_CHAIN && mainGame->dInfo.curMsg != MSG_SORT_CARD) {
if(chain && selectable_cards[i]->is_conti)
myswprintf(formatBuffer, L"%ls", DataManager::unknown_string);
else if(selectable_cards[i]->location == LOCATION_OVERLAY)
myswprintf(formatBuffer, L"%ls[%d](%d)",
dataManager.FormatLocation(selectable_cards[i]->overlayTarget->location, selectable_cards[i]->overlayTarget->sequence),
selectable_cards[i]->overlayTarget->sequence + 1, selectable_cards[i]->sequence + 1);
else
myswprintf(formatBuffer, L"%ls[%d]", dataManager.FormatLocation(selectable_cards[i]->location, selectable_cards[i]->sequence),
selectable_cards[i]->sequence + 1);
mainGame->stCardPos[i]->setText(formatBuffer);
mainGame->stCardPos[i]->setVisible(true);
if(selectable_cards[i]->controler)
mainGame->stCardPos[i]->setBackgroundColor(0xffd0d0d0);
else mainGame->stCardPos[i]->setBackgroundColor(0xffffffff);
} else {
if(sort_list[i]) {
myswprintf(formatBuffer, L"%d", sort_list[i]);
mainGame->stCardPos[i]->setText(formatBuffer);
} else mainGame->stCardPos[i]->setText(L"");
mainGame->stCardPos[i]->setBackgroundColor(0xffffffff);
}
mainGame->stCardPos[i]->setRelativePosition(rect<s32>(30 + i * 125, 30, 150 + i * 125, 50));
}
else {
mainGame->scrCardList->setVisible(true);
mainGame->scrCardList->setMin(0);
mainGame->scrCardList->setMax((selectable_cards.size() - 5) * 10 + 9);
......@@ -439,9 +411,12 @@ void ClientField::ShowSelectCard(bool buttonok, bool chain) {
mainGame->PopupElement(mainGame->wCardSelect);
}
void ClientField::ShowChainCard() {
if(selectable_cards.size() <= 5) {
int startpos = 30 + 125 * (5 - selectable_cards.size()) / 2;
for(size_t i = 0; i < selectable_cards.size(); ++i) {
int startpos;
if(selectable_cards.size() <= 5)
startpos = 30 + 125 * (5 - selectable_cards.size()) / 2;
else
startpos = 30;
for(size_t i = 0; i < min(selectable_cards.size(), 5); ++i) {
if(selectable_cards[i]->code)
mainGame->imageLoading.insert(std::make_pair(mainGame->btnCardSelect[i], selectable_cards[i]->code));
else
......@@ -458,30 +433,15 @@ void ClientField::ShowChainCard() {
else mainGame->stCardPos[i]->setBackgroundColor(0xffffffff);
mainGame->stCardPos[i]->setRelativePosition(rect<s32>(startpos + i * 125, 30, startpos + 120 + i * 125, 50));
}
if(selectable_cards.size() <= 5) {
for(int i = selectable_cards.size(); i < 5; ++i) {
mainGame->btnCardSelect[i]->setVisible(false);
mainGame->stCardPos[i]->setVisible(false);
}
mainGame->scrCardList->setPos(0);
mainGame->scrCardList->setVisible(false);
} else {
for(int i = 0; i < 5; ++i) {
if(selectable_cards[i]->code)
mainGame->imageLoading.insert(std::make_pair(mainGame->btnCardSelect[i], selectable_cards[i]->code));
else
mainGame->btnCardSelect[i]->setImage(imageManager.tCover);
mainGame->btnCardSelect[i]->setRelativePosition(rect<s32>(30 + i * 125, 55, 30 + 120 + i * 125, 225));
mainGame->btnCardSelect[i]->setPressed(false);
mainGame->btnCardSelect[i]->setVisible(true);
myswprintf(formatBuffer, L"%ls[%d]", dataManager.FormatLocation(selectable_cards[i]->location, selectable_cards[i]->sequence),
selectable_cards[i]->sequence + 1);
mainGame->stCardPos[i]->setText(formatBuffer);
mainGame->stCardPos[i]->setVisible(true);
if(selectable_cards[i]->controler)
mainGame->stCardPos[i]->setBackgroundColor(0xffd0d0d0);
else mainGame->stCardPos[i]->setBackgroundColor(0xffffffff);
mainGame->stCardPos[i]->setRelativePosition(rect<s32>(30 + i * 125, 30, 150 + i * 125, 50));
}
else {
mainGame->scrCardList->setVisible(true);
mainGame->scrCardList->setMin(0);
mainGame->scrCardList->setMax((selectable_cards.size() - 5) * 10 + 9);
......@@ -493,9 +453,12 @@ void ClientField::ShowChainCard() {
mainGame->PopupElement(mainGame->wCardSelect);
}
void ClientField::ShowLocationCard() {
if(display_cards.size() <= 5) {
int startpos = 30 + 125 * (5 - display_cards.size()) / 2;
for(size_t i = 0; i < display_cards.size(); ++i) {
int startpos;
if(display_cards.size() <= 5)
startpos = 30 + 125 * (5 - display_cards.size()) / 2;
else
startpos = 30;
for(size_t i = 0; i < min(display_cards.size(), 5); ++i) {
if(display_cards[i]->code)
mainGame->imageLoading.insert(std::make_pair(mainGame->btnCardDisplay[i], display_cards[i]->code));
else
......@@ -512,30 +475,15 @@ void ClientField::ShowLocationCard() {
else mainGame->stDisplayPos[i]->setBackgroundColor(0xffffffff);
mainGame->stDisplayPos[i]->setRelativePosition(rect<s32>(startpos + i * 125, 30, startpos + 120 + i * 125, 50));
}
if(display_cards.size() <= 5) {
for(int i = display_cards.size(); i < 5; ++i) {
mainGame->btnCardDisplay[i]->setVisible(false);
mainGame->stDisplayPos[i]->setVisible(false);
}
mainGame->scrDisplayList->setPos(0);
mainGame->scrDisplayList->setVisible(false);
} else {
for(int i = 0; i < 5; ++i) {
if(display_cards[i]->code)
mainGame->imageLoading.insert(std::make_pair(mainGame->btnCardDisplay[i], display_cards[i]->code));
else
mainGame->btnCardDisplay[i]->setImage(imageManager.tCover);
mainGame->btnCardDisplay[i]->setRelativePosition(rect<s32>(30 + i * 125, 55, 30 + 120 + i * 125, 225));
mainGame->btnCardDisplay[i]->setPressed(false);
mainGame->btnCardDisplay[i]->setVisible(true);
myswprintf(formatBuffer, L"%ls[%d]", dataManager.FormatLocation(display_cards[i]->location, display_cards[i]->sequence),
display_cards[i]->sequence + 1);
mainGame->stDisplayPos[i]->setText(formatBuffer);
mainGame->stDisplayPos[i]->setVisible(true);
if(display_cards[i]->controler)
mainGame->stDisplayPos[i]->setBackgroundColor(0xffd0d0d0);
else mainGame->stDisplayPos[i]->setBackgroundColor(0xffffffff);
mainGame->stDisplayPos[i]->setRelativePosition(rect<s32>(30 + i * 125, 30, 150 + i * 125, 50));
}
else {
mainGame->scrDisplayList->setVisible(true);
mainGame->scrDisplayList->setMin(0);
mainGame->scrDisplayList->setMax((display_cards.size() - 5) * 10 + 9);
......
......@@ -741,10 +741,11 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
} else {
if(selectable_cards[i + pos]->is_conti)
myswprintf(formatBuffer, L"%ls", DataManager::unknown_string);
else if(selectable_cards[i + pos]->location == LOCATION_OVERLAY)
else if(selectable_cards[i + pos]->location == LOCATION_OVERLAY) {
myswprintf(formatBuffer, L"%ls[%d](%d)",
dataManager.FormatLocation(selectable_cards[i + pos]->overlayTarget->location, selectable_cards[i + pos]->overlayTarget->sequence),
selectable_cards[i + pos]->overlayTarget->sequence + 1, selectable_cards[i + pos]->sequence + 1);
}
else
myswprintf(formatBuffer, L"%ls[%d]", dataManager.FormatLocation(selectable_cards[i + pos]->location, selectable_cards[i + pos]->sequence),
selectable_cards[i + pos]->sequence + 1);
......@@ -1613,9 +1614,11 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
case irr::KEY_F1:
case irr::KEY_F2:
case irr::KEY_F3:
case irr::KEY_F4:
case irr::KEY_F5:
case irr::KEY_F6:
case irr::KEY_F7: {
case irr::KEY_F7:
case irr::KEY_F8: {
if(!event.KeyInput.PressedDown && !mainGame->dInfo.isReplay && mainGame->dInfo.player_type != 7 && mainGame->dInfo.isStarted
&& !mainGame->wCardDisplay->isVisible() && !mainGame->HasFocus(EGUIET_EDIT_BOX)) {
int loc_id = 0;
......@@ -1636,6 +1639,15 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
for(int32 i = (int32)extra[0].size() - 1; i >= 0 ; --i)
display_cards.push_back(extra[0][i]);
break;
case irr::KEY_F4:
loc_id = 1007;
for(int32 i = 0; i <= 4 ; ++i) {
if(mzone[0][i] && mzone[0][i]->overlayed.size()) {
for(int32 j = 0; j <= (int32)mzone[0][i]->overlayed.size() - 1 ; ++j)
display_cards.push_back(mzone[0][i]->overlayed[j]);
}
}
break;
case irr::KEY_F5:
loc_id = 1004;
for(int32 i = (int32)grave[1].size() - 1; i >= 0 ; --i)
......@@ -1651,6 +1663,15 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
for(int32 i = (int32)extra[1].size() - 1; i >= 0 ; --i)
display_cards.push_back(extra[1][i]);
break;
case irr::KEY_F8:
loc_id = 1007;
for(int32 i = 0; i <= 4 ; ++i) {
if(mzone[1][i] && mzone[1][i]->overlayed.size()) {
for(int32 j = 0; j <= (int32)mzone[1][i]->overlayed.size() - 1 ; ++j)
display_cards.push_back(mzone[1][i]->overlayed[j]);
}
}
break;
}
if(display_cards.size()) {
myswprintf(formatBuffer, L"%ls(%d)", dataManager.GetSysString(loc_id), display_cards.size());
......
Subproject commit c96a56694a4f51f6ec5e0b85442b6026a9739c2d
Subproject commit 99e817b3d4a38900f855028aac792fcf0e3a2861
Subproject commit ecc9ccf118b4d8caab700445a8912d8ba0911bba
Subproject commit 7eac1f376e3364021806d6f252c7f0bc02f169ed
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