| 82 | } |
| 83 | |
| 84 | void SaveWorldMenu::resize(int _width, int _height) { |
| 85 | HUDDialog::resize(_width, _height); |
| 86 | FontSizer fs = FontSizer(_width, _height); |
| 87 | |
| 88 | FontManager& fm = FontManager::instance(); |
| 89 | std::vector<HUDuiElement*>& listHUD = getElements(); |
| 90 | HUDuiLabel* title = (HUDuiLabel*)listHUD[0]; |
| 91 | const LocalFontFace* fontFace = title->getFontFace(); |
| 92 | |
| 93 | // use a big font for the body, bigger for the title |
| 94 | fs.setMin(0, (int)(1.0 / BZDB.eval("headerFontSize") / 2.0)); |
| 95 | const float titleFontSize = fs.getFontSize(fontFace->getFMFace(), "headerFontSize"); |
| 96 | |
| 97 | fs.setMin(0, 20); |
| 98 | float fontSize = fs.getFontSize(fontFace->getFMFace(), "menuFontSize"); |
| 99 | |
| 100 | // reposition title |
| 101 | title->setFontSize(titleFontSize); |
| 102 | const float titleWidth = fm.getStringWidth(fontFace->getFMFace(), titleFontSize, title->getString()); |
| 103 | const float titleHeight = fm.getStringHeight(fontFace->getFMFace(), titleFontSize); |
| 104 | float x = 0.5f * ((float)_width - titleWidth); |
| 105 | float y = (float)_height - titleHeight; |
| 106 | title->setPosition(x, y); |
| 107 | |
| 108 | // reposition options |
| 109 | x = 0.5f * ((float)_width - 0.75f * titleWidth); |
| 110 | y -= 0.6f * 3 * titleHeight; |
| 111 | const float h = fm.getStringHeight(fontFace->getFMFace(), fontSize); |
| 112 | const int count = (const int)listHUD.size(); |
| 113 | int i; |
| 114 | for (i = 1; i < count - 1; i++) { |
| 115 | listHUD[i]->setFontSize(fontSize); |
| 116 | listHUD[i]->setPosition(x, y); |
| 117 | y -= 1.0f * h; |
| 118 | } |
| 119 | |
| 120 | x = 100.0f; |
| 121 | y -= 100.0f; |
| 122 | listHUD[i]->setFontSize(fontSize); |
| 123 | listHUD[i]->setPosition(x, y); |
| 124 | } |
| 125 | |
| 126 | // Local Variables: *** |
| 127 | // mode: C++ *** |
nothing calls this directly
no test coverage detected