| 138 | } |
| 139 | |
| 140 | void InGameOptions::loadList(int id) |
| 141 | { |
| 142 | saveList(); |
| 143 | curId = id; |
| 144 | menuform->findControlTyped<Label>("LIST_NAME")->setText(listNames[curId]); |
| 145 | std::list<std::pair<UString, UString>> *notificationList = nullptr; |
| 146 | switch (curId) |
| 147 | { |
| 148 | case 0: |
| 149 | notificationList = |
| 150 | state->current_battle ? &battleNotificationList : &cityNotificationList; |
| 151 | break; |
| 152 | case 1: |
| 153 | notificationList = &openApocList; |
| 154 | break; |
| 155 | } |
| 156 | auto listControl = menuform->findControlTyped<ListBox>("NOTIFICATIONS_LIST"); |
| 157 | listControl->clear(); |
| 158 | auto font = ui().getFont("smalfont"); |
| 159 | for (auto &p : *notificationList) |
| 160 | { |
| 161 | auto checkBox = mksp<CheckBox>(fw().data->loadImage("BUTTON_CHECKBOX_TRUE"), |
| 162 | fw().data->loadImage("BUTTON_CHECKBOX_FALSE")); |
| 163 | checkBox->Size = {240, listControl->ItemSize}; |
| 164 | UString full_name = p.first + "." + p.second; |
| 165 | checkBox->setData(mksp<UString>(full_name)); |
| 166 | checkBox->setChecked(config().getBool(full_name)); |
| 167 | auto label = checkBox->createChild<Label>(tr(config().describe(p.first, p.second)), font); |
| 168 | label->Size = {216, listControl->ItemSize}; |
| 169 | label->Location = {24, 0}; |
| 170 | label->ToolTipText = tr(config().describe(p.first, p.second)); |
| 171 | label->ToolTipFont = font; |
| 172 | listControl->addItem(checkBox); |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | void InGameOptions::loadNextList() |
| 177 | { |