MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / buildPlayerSettingsWindow

Method buildPlayerSettingsWindow

source/modes/GameMode.cpp:1845–1894  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1843}
1844
1845void GameMode::buildPlayerSettingsWindow()
1846{
1847 if(!mSeatIds.empty())
1848 return;
1849
1850 CEGUI::Window* tmpWin = mRootWindow->getChild("PlayerSettingsWindow/Seats/SeatsSP");
1851 CEGUI::WindowManager& winMgr = CEGUI::WindowManager::getSingleton();
1852 float offset = 15;
1853 for(Seat* seat : mGameMap->getSeats())
1854 {
1855 if(seat->isRogueSeat())
1856 continue;
1857
1858 Player* player = seat->getPlayer();
1859 if(player == nullptr)
1860 continue;
1861
1862 CEGUI::DefaultWindow* tmpElt;
1863 std::string name;
1864 Ogre::ColourValue seatColor = seat->getColorValue();
1865 seatColor.a = 1.0f; // Restore the color opacity
1866
1867 name = TEXT_SEAT_ID_PREFIX + Helper::toString(seat->getId());
1868 tmpElt = static_cast<CEGUI::DefaultWindow*>(winMgr.createWindow("OD/StaticText", name));
1869 tmpWin->addChild(tmpElt);
1870 tmpElt->setArea(CEGUI::UDim(0,20), CEGUI::UDim(0, offset), CEGUI::UDim(0.2,-20), CEGUI::UDim(0,offset));
1871 tmpElt->setText("[colour='" + Helper::getCEGUIColorFromOgreColourValue(seatColor) + "']" + Helper::toString(seat->getId()));
1872 tmpElt->setProperty("FrameEnabled", "False");
1873 tmpElt->setProperty("BackgroundEnabled", "False");
1874
1875 name = TEXT_SEAT_PLAYER_NICKNAME_PREFIX + Helper::toString(seat->getId());
1876 tmpElt = static_cast<CEGUI::DefaultWindow*>(winMgr.createWindow("OD/StaticText", name));
1877 tmpWin->addChild(tmpElt);
1878 tmpElt->setArea(CEGUI::UDim(0.2,20), CEGUI::UDim(0, offset), CEGUI::UDim(0.6,-20), CEGUI::UDim(0,offset));
1879 tmpElt->setText("[colour='" + Helper::getCEGUIColorFromOgreColourValue(seatColor) + "']" + player->getNick());
1880 tmpElt->setProperty("FrameEnabled", "False");
1881 tmpElt->setProperty("BackgroundEnabled", "False");
1882
1883 name = TEXT_SEAT_TEAM_ID_PREFIX + Helper::toString(seat->getId());
1884 tmpElt = static_cast<CEGUI::DefaultWindow*>(winMgr.createWindow("OD/StaticText", name));
1885 tmpWin->addChild(tmpElt);
1886 tmpElt->setArea(CEGUI::UDim(0.8,20), CEGUI::UDim(0, offset), CEGUI::UDim(0.2,-20), CEGUI::UDim(0,offset));
1887 tmpElt->setText("[colour='" + Helper::getCEGUIColorFromOgreColourValue(seatColor) + "']" + Helper::toString(seat->getTeamId()));
1888 tmpElt->setProperty("FrameEnabled", "False");
1889 tmpElt->setProperty("BackgroundEnabled", "False");
1890
1891 mSeatIds.push_back(seat->getId());
1892 offset += 15;
1893 }
1894}

Callers

nothing calls this directly

Calls 7

isRogueSeatMethod · 0.80
setTextMethod · 0.80
getTeamIdMethod · 0.80
toStringFunction · 0.50
getPlayerMethod · 0.45
getIdMethod · 0.45

Tested by

no test coverage detected