Commit fe4cdd46 authored by DailyShana's avatar DailyShana

cross platform

parent baf08001
...@@ -352,11 +352,15 @@ void ClientField::ClearChainSelect() { ...@@ -352,11 +352,15 @@ void ClientField::ClearChainSelect() {
// needs to be synchronized with EGET_SCROLL_BAR_CHANGED // needs to be synchronized with EGET_SCROLL_BAR_CHANGED
void ClientField::ShowSelectCard(bool buttonok, bool chain) { void ClientField::ShowSelectCard(bool buttonok, bool chain) {
int startpos; int startpos;
if(selectable_cards.size() <= 5) size_t ct;
if(selectable_cards.size() <= 5) {
startpos = 30 + 125 * (5 - selectable_cards.size()) / 2; startpos = 30 + 125 * (5 - selectable_cards.size()) / 2;
else ct = selectable_cards.size();
} else {
startpos = 30; startpos = 30;
for(size_t i = 0; i < min(selectable_cards.size(), 5); ++i) { ct = 5;
}
for(size_t i = 0; i < ct; ++i) {
mainGame->stCardPos[i]->enableOverrideColor(false); mainGame->stCardPos[i]->enableOverrideColor(false);
if(selectable_cards[i]->code) if(selectable_cards[i]->code)
mainGame->imageLoading.insert(std::make_pair(mainGame->btnCardSelect[i], selectable_cards[i]->code)); mainGame->imageLoading.insert(std::make_pair(mainGame->btnCardSelect[i], selectable_cards[i]->code));
...@@ -421,11 +425,15 @@ void ClientField::ShowSelectCard(bool buttonok, bool chain) { ...@@ -421,11 +425,15 @@ void ClientField::ShowSelectCard(bool buttonok, bool chain) {
} }
void ClientField::ShowChainCard() { void ClientField::ShowChainCard() {
int startpos; int startpos;
if(selectable_cards.size() <= 5) size_t ct;
if(selectable_cards.size() <= 5) {
startpos = 30 + 125 * (5 - selectable_cards.size()) / 2; startpos = 30 + 125 * (5 - selectable_cards.size()) / 2;
else ct = selectable_cards.size();
} else {
startpos = 30; startpos = 30;
for(size_t i = 0; i < min(selectable_cards.size(), 5); ++i) { ct = 5;
}
for(size_t i = 0; i < ct; ++i) {
if(selectable_cards[i]->code) if(selectable_cards[i]->code)
mainGame->imageLoading.insert(std::make_pair(mainGame->btnCardSelect[i], selectable_cards[i]->code)); mainGame->imageLoading.insert(std::make_pair(mainGame->btnCardSelect[i], selectable_cards[i]->code));
else else
...@@ -472,11 +480,15 @@ void ClientField::ShowChainCard() { ...@@ -472,11 +480,15 @@ void ClientField::ShowChainCard() {
} }
void ClientField::ShowLocationCard() { void ClientField::ShowLocationCard() {
int startpos; int startpos;
if(display_cards.size() <= 5) size_t ct;
if(display_cards.size() <= 5) {
startpos = 30 + 125 * (5 - display_cards.size()) / 2; startpos = 30 + 125 * (5 - display_cards.size()) / 2;
else ct = display_cards.size();
} else {
startpos = 30; startpos = 30;
for(size_t i = 0; i < min(display_cards.size(), 5); ++i) { ct = 5;
}
for(size_t i = 0; i < ct; ++i) {
mainGame->stDisplayPos[i]->enableOverrideColor(false); mainGame->stDisplayPos[i]->enableOverrideColor(false);
if(display_cards[i]->code) if(display_cards[i]->code)
mainGame->imageLoading.insert(std::make_pair(mainGame->btnCardDisplay[i], display_cards[i]->code)); mainGame->imageLoading.insert(std::make_pair(mainGame->btnCardDisplay[i], display_cards[i]->code));
......
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