TopMenuBar reference decomp
This commit is contained in:
parent
6d964be479
commit
4827d85e9e
|
|
@ -3,8 +3,17 @@
|
||||||
|
|
||||||
namespace RNR
|
namespace RNR
|
||||||
{
|
{
|
||||||
|
// sub_60D330
|
||||||
TopMenuBar::TopMenuBar(World* world)
|
TopMenuBar::TopMenuBar(World* world)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
if ( v30 )
|
||||||
|
{
|
||||||
|
*(float *)(v30 + 260) = 100.0;
|
||||||
|
*(float *)(v30 + 264) = 20.0;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
m_world = world;
|
m_world = world;
|
||||||
|
|
||||||
m_overlayManager = Ogre::OverlayManager::getSingletonPtr();
|
m_overlayManager = Ogre::OverlayManager::getSingletonPtr();
|
||||||
|
|
@ -20,53 +29,53 @@ namespace RNR
|
||||||
Ogre::OverlayContainer* panel = static_cast<Ogre::OverlayContainer*>(m_overlayManager->createOverlayElement("Panel", "TopMenuBarPanel"));
|
Ogre::OverlayContainer* panel = static_cast<Ogre::OverlayContainer*>(m_overlayManager->createOverlayElement("Panel", "TopMenuBarPanel"));
|
||||||
panel->setMetricsMode(Ogre::GMM_PIXELS);
|
panel->setMetricsMode(Ogre::GMM_PIXELS);
|
||||||
panel->setPosition(0,0);
|
panel->setPosition(0,0);
|
||||||
panel->setDimensions(128 * 5, 20);
|
panel->setDimensions(100 * 5, 20);
|
||||||
panel->setMaterial(material);
|
panel->setMaterial(material);
|
||||||
|
|
||||||
Ogre::ColourValue text_color = Ogre::ColourValue(0.25, 0.25, 0.25);
|
Ogre::ColourValue text_color = Ogre::ColourValue(0.25, 0.25, 0.25, 0.95);
|
||||||
|
|
||||||
Ogre::TextAreaOverlayElement* toolsTextArea = static_cast<Ogre::TextAreaOverlayElement*>(m_overlayManager->createOverlayElement("TextArea", "TopMenuBarTools"));
|
Ogre::TextAreaOverlayElement* toolsTextArea = static_cast<Ogre::TextAreaOverlayElement*>(m_overlayManager->createOverlayElement("TextArea", "TopMenuBarTools"));
|
||||||
toolsTextArea->setMetricsMode(Ogre::GMM_PIXELS);
|
toolsTextArea->setMetricsMode(Ogre::GMM_PIXELS);
|
||||||
toolsTextArea->setPosition(0, 0);
|
toolsTextArea->setPosition(0, 0);
|
||||||
toolsTextArea->setDimensions(128, 24);
|
toolsTextArea->setDimensions(100, 20);
|
||||||
toolsTextArea->setCaption("Tools");
|
toolsTextArea->setCaption("Tools");
|
||||||
toolsTextArea->setCharHeight(24);
|
toolsTextArea->setCharHeight(20);
|
||||||
toolsTextArea->setFontName("ComicSans");
|
toolsTextArea->setFontName("ComicSans");
|
||||||
toolsTextArea->setColour(text_color);
|
toolsTextArea->setColour(text_color);
|
||||||
|
|
||||||
Ogre::TextAreaOverlayElement* insertTextArea = static_cast<Ogre::TextAreaOverlayElement*>(m_overlayManager->createOverlayElement("TextArea", "TopMenuBarInsert"));
|
Ogre::TextAreaOverlayElement* insertTextArea = static_cast<Ogre::TextAreaOverlayElement*>(m_overlayManager->createOverlayElement("TextArea", "TopMenuBarInsert"));
|
||||||
insertTextArea->setMetricsMode(Ogre::GMM_PIXELS);
|
insertTextArea->setMetricsMode(Ogre::GMM_PIXELS);
|
||||||
insertTextArea->setPosition(128, 0);
|
insertTextArea->setPosition(100, 0);
|
||||||
insertTextArea->setDimensions(128, 24);
|
insertTextArea->setDimensions(100, 20);
|
||||||
insertTextArea->setCaption("Insert");
|
insertTextArea->setCaption("Insert");
|
||||||
insertTextArea->setCharHeight(24);
|
insertTextArea->setCharHeight(20);
|
||||||
insertTextArea->setFontName("ComicSans");
|
insertTextArea->setFontName("ComicSans");
|
||||||
insertTextArea->setColour(text_color);
|
insertTextArea->setColour(text_color);
|
||||||
|
|
||||||
Ogre::TextAreaOverlayElement* fullscreenTextArea = static_cast<Ogre::TextAreaOverlayElement*>(m_overlayManager->createOverlayElement("TextArea", "TopMenuBarFullscreen"));
|
Ogre::TextAreaOverlayElement* fullscreenTextArea = static_cast<Ogre::TextAreaOverlayElement*>(m_overlayManager->createOverlayElement("TextArea", "TopMenuBarFullscreen"));
|
||||||
fullscreenTextArea->setMetricsMode(Ogre::GMM_PIXELS);
|
fullscreenTextArea->setMetricsMode(Ogre::GMM_PIXELS);
|
||||||
fullscreenTextArea->setPosition(128*2, 0);
|
fullscreenTextArea->setPosition(100*2, 0);
|
||||||
fullscreenTextArea->setDimensions(128, 24);
|
fullscreenTextArea->setDimensions(100, 20);
|
||||||
fullscreenTextArea->setCaption("Fullscreen");
|
fullscreenTextArea->setCaption("Fullscreen");
|
||||||
fullscreenTextArea->setCharHeight(24);
|
fullscreenTextArea->setCharHeight(20);
|
||||||
fullscreenTextArea->setFontName("ComicSans");
|
fullscreenTextArea->setFontName("ComicSans");
|
||||||
fullscreenTextArea->setColour(text_color);
|
fullscreenTextArea->setColour(text_color);
|
||||||
|
|
||||||
Ogre::TextAreaOverlayElement* helpTextArea = static_cast<Ogre::TextAreaOverlayElement*>(m_overlayManager->createOverlayElement("TextArea", "TopMenuBarHelp"));
|
Ogre::TextAreaOverlayElement* helpTextArea = static_cast<Ogre::TextAreaOverlayElement*>(m_overlayManager->createOverlayElement("TextArea", "TopMenuBarHelp"));
|
||||||
helpTextArea->setMetricsMode(Ogre::GMM_PIXELS);
|
helpTextArea->setMetricsMode(Ogre::GMM_PIXELS);
|
||||||
helpTextArea->setPosition(128*3, 0);
|
helpTextArea->setPosition(100*3, 0);
|
||||||
helpTextArea->setDimensions(128, 24);
|
helpTextArea->setDimensions(100, 20);
|
||||||
helpTextArea->setCaption("Help...");
|
helpTextArea->setCaption("Help...");
|
||||||
helpTextArea->setCharHeight(24);
|
helpTextArea->setCharHeight(20);
|
||||||
helpTextArea->setFontName("ComicSans");
|
helpTextArea->setFontName("ComicSans");
|
||||||
helpTextArea->setColour(text_color);
|
helpTextArea->setColour(text_color);
|
||||||
|
|
||||||
Ogre::TextAreaOverlayElement* exitTextArea = static_cast<Ogre::TextAreaOverlayElement*>(m_overlayManager->createOverlayElement("TextArea", "TopMenuBarExit"));
|
Ogre::TextAreaOverlayElement* exitTextArea = static_cast<Ogre::TextAreaOverlayElement*>(m_overlayManager->createOverlayElement("TextArea", "TopMenuBarExit"));
|
||||||
exitTextArea->setMetricsMode(Ogre::GMM_PIXELS);
|
exitTextArea->setMetricsMode(Ogre::GMM_PIXELS);
|
||||||
exitTextArea->setPosition(128*4, 0);
|
exitTextArea->setPosition(100*4, 0);
|
||||||
exitTextArea->setDimensions(128, 24);
|
exitTextArea->setDimensions(100, 20);
|
||||||
exitTextArea->setCaption("Exit");
|
exitTextArea->setCaption(" Exit"); // ... apparently spacing is how it was done in the original client
|
||||||
exitTextArea->setCharHeight(24);
|
exitTextArea->setCharHeight(20);
|
||||||
exitTextArea->setFontName("ComicSans");
|
exitTextArea->setFontName("ComicSans");
|
||||||
exitTextArea->setColour(text_color);
|
exitTextArea->setColour(text_color);
|
||||||
|
|
||||||
|
|
@ -89,7 +98,7 @@ namespace RNR
|
||||||
|
|
||||||
m_playerPanel = static_cast<Ogre::OverlayContainer*>(m_overlayManager->createOverlayElement("Panel", "PlayerListPanel"));
|
m_playerPanel = static_cast<Ogre::OverlayContainer*>(m_overlayManager->createOverlayElement("Panel", "PlayerListPanel"));
|
||||||
m_playerPanel->setMetricsMode(Ogre::GMM_PIXELS);
|
m_playerPanel->setMetricsMode(Ogre::GMM_PIXELS);
|
||||||
m_playerPanel->setDimensions(128, 20);
|
m_playerPanel->setDimensions(100, 20);
|
||||||
m_playerPanel->setMaterial(material);
|
m_playerPanel->setMaterial(material);
|
||||||
|
|
||||||
m_playerList = static_cast<Ogre::TextAreaOverlayElement*>(m_overlayManager->createOverlayElement("TextArea", "PlayerListTextArea"));
|
m_playerList = static_cast<Ogre::TextAreaOverlayElement*>(m_overlayManager->createOverlayElement("TextArea", "PlayerListTextArea"));
|
||||||
|
|
@ -97,7 +106,7 @@ namespace RNR
|
||||||
m_playerList->setPosition(0, 0);
|
m_playerList->setPosition(0, 0);
|
||||||
m_playerList->setDimensions(1000, 1000);
|
m_playerList->setDimensions(1000, 1000);
|
||||||
m_playerList->setCaption("Player List");
|
m_playerList->setCaption("Player List");
|
||||||
m_playerList->setCharHeight(24);
|
m_playerList->setCharHeight(20);
|
||||||
m_playerList->setFontName("ComicSans");
|
m_playerList->setFontName("ComicSans");
|
||||||
m_playerList->setColour(Ogre::ColourValue(1.0f, 1.0f, 1.0f));
|
m_playerList->setColour(Ogre::ColourValue(1.0f, 1.0f, 1.0f));
|
||||||
|
|
||||||
|
|
@ -146,14 +155,14 @@ namespace RNR
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_playerPanel->setVisible(true);
|
m_playerPanel->setVisible(true);
|
||||||
m_playerPanel->setPosition(m_overlayManager->getViewportWidth() - 128 - 5,5);
|
m_playerPanel->setPosition(m_overlayManager->getViewportWidth() - 100 - 5,5);
|
||||||
std::string player_list_text = "Player List\n";
|
std::string player_list_text = "Player List\n";
|
||||||
for(auto player : *player_list)
|
for(auto player : *player_list)
|
||||||
{
|
{
|
||||||
player_list_text += player->getName() + "\n";
|
player_list_text += player->getName() + "\n";
|
||||||
}
|
}
|
||||||
m_playerList->setCaption(player_list_text);
|
m_playerList->setCaption(player_list_text);
|
||||||
m_playerPanel->setDimensions(128, 20 * (player_list->size() + 1));
|
m_playerPanel->setDimensions(100, 20 * (player_list->size() + 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue