Commit 8f12fe7f authored by mercury233's avatar mercury233

update position

parent d7efd0db
...@@ -1824,14 +1824,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1824,14 +1824,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
SetResponseI(positions); SetResponseI(positions);
return true; return true;
} }
int count = 0, filter = 0x1, startpos; int count = 0, filter = 0x1, startpos = 30;
while(filter != 0x10) { while(filter != 0x10) {
if(positions & filter) count++; if(positions & filter) count++;
filter <<= 1; filter <<= 1;
} }
if(count == 4) startpos = 10;
else if(count == 3) startpos = 50;
else startpos = 50;
if(positions & 0x1) { if(positions & 0x1) {
mainGame->imageLoading.insert(std::make_pair(mainGame->btnPSAU, code)); mainGame->imageLoading.insert(std::make_pair(mainGame->btnPSAU, code));
mainGame->btnPSAU->setRelativePosition(rect<s32>(startpos * mainGame->xScale, 20 * mainGame->yScale, (startpos + 140) * mainGame->xScale, 160 * mainGame->yScale)); mainGame->btnPSAU->setRelativePosition(rect<s32>(startpos * mainGame->xScale, 20 * mainGame->yScale, (startpos + 140) * mainGame->xScale, 160 * mainGame->yScale));
...@@ -1855,7 +1852,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1855,7 +1852,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
startpos += 150; startpos += 150;
} else mainGame->btnPSDD->setVisible(false); } else mainGame->btnPSDD->setVisible(false);
recti pos = mainGame->wPosSelect->getRelativePosition(); recti pos = mainGame->wPosSelect->getRelativePosition();
pos.LowerRightCorner.X = pos.UpperLeftCorner.X + count * 150 * mainGame->xScale + 100 * mainGame->xScale; s32 oldcenter = pos.getCenter().X;
pos.LowerRightCorner.X = pos.UpperLeftCorner.X + count * 150 * mainGame->xScale + 50 * mainGame->xScale;
s32 newwidth = pos.getWidth();
pos.UpperLeftCorner.X = oldcenter - newwidth / 2;
pos.LowerRightCorner.X = oldcenter + newwidth / 2;
mainGame->wPosSelect->setRelativePosition(pos); mainGame->wPosSelect->setRelativePosition(pos);
mainGame->bgPosSelect->setRelativePosition(rect<s32>(0, 0, pos.getWidth(), pos.getHeight())); mainGame->bgPosSelect->setRelativePosition(rect<s32>(0, 0, pos.getWidth(), pos.getHeight()));
mainGame->gMutex.lock(); mainGame->gMutex.lock();
......
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