MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / setSelectedTab

Method setSelectedTab

game/ui/tileview/cityview.cpp:978–992  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

976}
977
978void CityView::setSelectedTab(int tabIndex)
979{
980 if (tabIndex < 0 || tabIndex > uiTabs.size())
981 {
982 LogError("Trying to select invalid tab: %d", tabIndex);
983 return;
984 }
985 for (auto tab : uiTabs)
986 {
987 tab->setVisible(false);
988 }
989 uiTabs[tabIndex]->setVisible(true);
990 this->activeTab = uiTabs[tabIndex];
991 this->state->current_city->cityViewPageIndex = tabIndex;
992}
993
994CityView::CityView(sp<GameState> state)
995 : CityTileView(*state->current_city->map, Vec3<int>{TILE_X_CITY, TILE_Y_CITY, TILE_Z_CITY},

Callers 1

CityViewMethod · 0.95

Calls 2

sizeMethod · 0.45
setVisibleMethod · 0.45

Tested by

no test coverage detected