* Builds dialog. */
| 66 | * Builds dialog. |
| 67 | */ |
| 68 | void ResearchInfoState::buildUi() |
| 69 | { |
| 70 | _screen = false; |
| 71 | |
| 72 | _window = new Window(this, 230, 140, 45, 30); |
| 73 | _txtTitle = new Text(210, 17, 61, 40); |
| 74 | |
| 75 | _txtAvailableScientist = new Text(210, 9, 61, 60); |
| 76 | _txtAvailableSpace = new Text(210, 9, 61, 70); |
| 77 | _txtAllocatedScientist = new Text(210, 17, 61, 80); |
| 78 | _txtMore = new Text(110, 17, 85, 100); |
| 79 | _txtLess = new Text(110, 17, 85, 120); |
| 80 | _btnCancel = new TextButton(90, 16, 61, 145); |
| 81 | _btnOk = new TextButton(83, 16, 169, 145); |
| 82 | |
| 83 | _btnMore = new ArrowButton(ARROW_BIG_UP, 13, 14, 195, 100); |
| 84 | _btnLess = new ArrowButton(ARROW_BIG_DOWN, 13, 14, 195, 120); |
| 85 | |
| 86 | _surfaceScientists = new InteractiveSurface(230, 140, 45, 30); |
| 87 | _surfaceScientists->onMouseClick((ActionHandler)&ResearchInfoState::handleWheel, 0); |
| 88 | |
| 89 | // Set palette |
| 90 | setPalette("PAL_BASESCAPE", 1); |
| 91 | |
| 92 | add(_surfaceScientists); |
| 93 | add(_window); |
| 94 | add(_btnOk); |
| 95 | add(_btnCancel); |
| 96 | add(_txtTitle); |
| 97 | add(_txtAvailableScientist); |
| 98 | add(_txtAvailableSpace); |
| 99 | add(_txtAllocatedScientist); |
| 100 | add(_txtMore); |
| 101 | add(_txtLess); |
| 102 | add(_btnMore); |
| 103 | add(_btnLess); |
| 104 | |
| 105 | centerAllSurfaces(); |
| 106 | |
| 107 | // Set up objects |
| 108 | _window->setColor(Palette::blockOffset(13)+5); |
| 109 | _window->setBackground(_game->getResourcePack()->getSurface("BACK05.SCR")); |
| 110 | _txtTitle->setColor(Palette::blockOffset(13)+5); |
| 111 | _txtTitle->setBig(); |
| 112 | |
| 113 | _txtTitle->setText(_rule ? tr(_rule->getName()) : tr(_project->getRules ()->getName())); |
| 114 | |
| 115 | _txtAvailableScientist->setColor(Palette::blockOffset(13)+5); |
| 116 | _txtAvailableScientist->setSecondaryColor(Palette::blockOffset(13)); |
| 117 | |
| 118 | _txtAvailableSpace->setColor(Palette::blockOffset(13)+5); |
| 119 | _txtAvailableSpace->setSecondaryColor(Palette::blockOffset(13)); |
| 120 | |
| 121 | _txtAllocatedScientist->setColor(Palette::blockOffset(13)+5); |
| 122 | _txtAllocatedScientist->setSecondaryColor(Palette::blockOffset(13)); |
| 123 | _txtAllocatedScientist->setBig(); |
| 124 | |
| 125 | _txtMore->setText(tr("STR_INCREASE")); |
nothing calls this directly
no test coverage detected