| 752 | } |
| 753 | |
| 754 | void InGameUI::DrawMenu() |
| 755 | { |
| 756 | if (_tmPos >= 1.0) |
| 757 | { |
| 758 | return; |
| 759 | } |
| 760 | |
| 761 | Texture* textureDef = GLOB_SCENE->Preloaded(TextureWhite); |
| 762 | const int w = GLOB_ENGINE->Width2D(); |
| 763 | const int h = GLOB_ENGINE->Height2D(); |
| 764 | const float border = 0.005; |
| 765 | float size = 0.02; |
| 766 | |
| 767 | float tmLeft = tmX + (1 - tmX) * _tmPos; |
| 768 | Texture* corner = GLOB_SCENE->Preloaded(Corner); |
| 769 | DrawFrame(corner, bgColor, Rect2DPixel(tmLeft * w, tmY * h, tmW * w, tmH * h)); |
| 770 | |
| 771 | MipInfo mip = GLOB_ENGINE->TextBank()->UseMipmap(textureDef, 0, 0); |
| 772 | |
| 773 | float width; |
| 774 | width = GLOB_ENGINE->GetTextWidth(size, _font24, _menuCurrent->_text) + 2 * border; |
| 775 | |
| 776 | float height = size + 2 * border; |
| 777 | float left = tmLeft + tmW - border - width; |
| 778 | float top = tmY + tmH; |
| 779 | GLOB_ENGINE->Draw2D(mip, capBgColor, Rect2DPixel(left * w, top * h, width * w, height * h)); |
| 780 | |
| 781 | GLOB_ENGINE->DrawText(Point2DFloat(left + border, top + border), size, _font24, capFtColor, _menuCurrent->_text); |
| 782 | |
| 783 | top = tmY + border; |
| 784 | height = size; |
| 785 | PackedColor color; |
| 786 | for (int i = 0; i < _menuCurrent->_items.Size(); i++) |
| 787 | { |
| 788 | MenuItem* item = _menuCurrent->_items[i]; |
| 789 | if (!item->_visible) |
| 790 | { |
| 791 | continue; |
| 792 | } |
| 793 | |
| 794 | if (item->_cmd == CMD_SEPARATOR) |
| 795 | { |
| 796 | top += border; |
| 797 | GEngine->DrawLine(Line2DPixel((tmLeft + border) * w, top * h, (tmLeft + tmW - border) * w, top * h), |
| 798 | menuDisabledColor, menuDisabledColor); |
| 799 | top += border; |
| 800 | continue; |
| 801 | } |
| 802 | |
| 803 | if (item->_check) |
| 804 | { |
| 805 | color = menuCheckedColor; |
| 806 | } |
| 807 | else if (item->_enable) |
| 808 | { |
| 809 | color = menuEnabledColor; |
| 810 | } |
| 811 | else |
nothing calls this directly
no test coverage detected