Commit 87460264 authored by mercury233's avatar mercury233

update dialog pos

parent e0a3d04d
...@@ -612,9 +612,12 @@ void ClientField::ShowSelectOption(int select_hint) { ...@@ -612,9 +612,12 @@ void ClientField::ShowSelectOption(int select_hint) {
mainGame->btnOptionOK->setVisible(false); mainGame->btnOptionOK->setVisible(false);
for(int i = 0; i < 5; i++) for(int i = 0; i < 5; i++)
mainGame->btnOption[i]->setVisible(i < count); mainGame->btnOption[i]->setVisible(i < count);
recti loc = mainGame->wOptions->getRelativePosition(); recti pos = mainGame->wOptions->getRelativePosition();
loc.LowerRightCorner.Y = loc.UpperLeftCorner.Y + 30 + 40 * count; int newheight = 30 + 40 * count;
mainGame->wOptions->setRelativePosition(loc); int oldheight = pos.LowerRightCorner.Y - pos.UpperLeftCorner.Y;
pos.UpperLeftCorner.Y = pos.UpperLeftCorner.Y + (oldheight - newheight) / 2;
pos.LowerRightCorner.Y = pos.UpperLeftCorner.Y + newheight;
mainGame->wOptions->setRelativePosition(pos);
} else { } else {
mainGame->SetStaticText(mainGame->stOptions, 310, mainGame->guiFont, mainGame->SetStaticText(mainGame->stOptions, 310, mainGame->guiFont,
(wchar_t*)dataManager.GetDesc(select_options[0])); (wchar_t*)dataManager.GetDesc(select_options[0]));
...@@ -626,9 +629,9 @@ void ClientField::ShowSelectOption(int select_hint) { ...@@ -626,9 +629,9 @@ void ClientField::ShowSelectOption(int select_hint) {
mainGame->btnOptionOK->setVisible(true); mainGame->btnOptionOK->setVisible(true);
for(int i = 0; i < 5; i++) for(int i = 0; i < 5; i++)
mainGame->btnOption[i]->setVisible(false); mainGame->btnOption[i]->setVisible(false);
recti loc = mainGame->wOptions->getRelativePosition(); recti pos = mainGame->wOptions->getRelativePosition();
loc.LowerRightCorner.Y = loc.UpperLeftCorner.Y + 140; pos.LowerRightCorner.Y = pos.UpperLeftCorner.Y + 140;
mainGame->wOptions->setRelativePosition(loc); mainGame->wOptions->setRelativePosition(pos);
} }
if(select_hint) if(select_hint)
myswprintf(textBuffer, L"%ls", dataManager.GetDesc(select_hint)); myswprintf(textBuffer, L"%ls", dataManager.GetDesc(select_hint));
......
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