Mercurial > sumwars
changeset 2698:78b5adbf95ac
refs #29: Hidden debug window (initially). Was actually just attached to the wrong node.
author | Augustin Preda |
---|---|
date | Sun, 30 Mar 2014 11:43:32 +0300 |
parents | 287738b8843e |
children | a4852d1bc2c0 |
files | src/gui/contenteditor/contenteditor.cpp src/gui/contenteditor/fixedobjecteditor.cpp src/gui/debugpanel/debugpanel.cpp |
diffstat | 3 files changed, 29 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/src/gui/contenteditor/contenteditor.cpp Sat Mar 29 11:31:47 2014 +0200 +++ b/src/gui/contenteditor/contenteditor.cpp Sun Mar 30 11:43:32 2014 +0300 @@ -235,7 +235,9 @@ } if(keyboard->isKeyDown(OIS::KC_LCONTROL) && keyboard->isKeyDown(OIS::KC_K)) + { toggleVisibility(); + } std::map<std::string, ContentEditorTab*>::iterator it; for (it = m_components.begin(); it != m_components.end(); ++it)
--- a/src/gui/contenteditor/fixedobjecteditor.cpp Sat Mar 29 11:31:47 2014 +0200 +++ b/src/gui/contenteditor/fixedobjecteditor.cpp Sun Mar 30 11:43:32 2014 +0300 @@ -310,7 +310,7 @@ { CEGUI::WindowManager& win_mgr = CEGUI::WindowManager::getSingleton(); CEGUI::MultiLineEditbox* editor = static_cast<CEGUI::MultiLineEditbox*>(CEGUIUtility::getWindowForLoadedLayout(m_rootWindow, - "FOTab/XML/FOXMLEditbox")); + "Root/ObjectInfoTabControl/__auto_TabPane__/FixedObjectTab/FixedObjectTabControl/__auto_TabPane__/XML/FOXMLEditbox")); // Parse the editor text to XML // use temporary XML document for recovering from errors @@ -345,7 +345,7 @@ int err_row = ri_temp_xml.ErrorRow(); int err_col = ri_temp_xml.ErrorCol(); - setMultiLineEditboxCursor("FOTab/XML/FOXMLEditbox",err_row,err_col); + setMultiLineEditboxCursor("Root/ObjectInfoTabControl/__auto_TabPane__/FixedObjectTab/FixedObjectTabControl/__auto_TabPane__/XML/FOXMLEditbox",err_row,err_col); } return true; @@ -384,9 +384,9 @@ Region* region = player->getRegion(); // if the position is set to default, use the player position - pos.m_x = getSpinnerValue("FOTab/Create/PosXSpinner",0); - pos.m_y = getSpinnerValue("FOTab/Create/PosYSpinner",0); - angle = getSpinnerValue("FOTab/Create/AngleSpinner",0); + pos.m_x = getSpinnerValue("Root/ObjectInfoTabControl/__auto_TabPane__/FixedObjectTab/FixedObjectTabControl/__auto_TabPane__/Create/PosXSpinner", 0); + pos.m_y = getSpinnerValue("Root/ObjectInfoTabControl/__auto_TabPane__/FixedObjectTab/FixedObjectTabControl/__auto_TabPane__/Create/PosYSpinner", 0); + angle = getSpinnerValue("Root/ObjectInfoTabControl/__auto_TabPane__/FixedObjectTab/FixedObjectTabControl/__auto_TabPane__/Create/AngleSpinner",0); if (pos.m_x == 0 && pos.m_y == 0) { pos = player->getShape()->m_center; @@ -401,7 +401,7 @@ bool FixedObjectEditor::onCopyData(const CEGUI::EventArgs& evt) { - std::string objname = getComboboxSelection("FOTab/Properties/CopyDataBox", ""); + std::string objname = getComboboxSelection("Root/ObjectInfoTabControl/__auto_TabPane__/FixedObjectTab/FixedObjectTabControl/__auto_TabPane__/Properties/CopyDataBox", ""); if (objname == "") return true; @@ -430,8 +430,8 @@ Vector pos = player->getShape()->m_center; - setSpinnerValue("FOTab/Create/PosXSpinner", pos.m_x); - setSpinnerValue("FOTab/Create/PosYSpinner", pos.m_y); + setSpinnerValue("Root/ObjectInfoTabControl/__auto_TabPane__/FixedObjectTab/FixedObjectTabControl/__auto_TabPane__/Create/PosXSpinner", pos.m_x); + setSpinnerValue("Root/ObjectInfoTabControl/__auto_TabPane__/FixedObjectTab/FixedObjectTabControl/__auto_TabPane__/Create/PosYSpinner", pos.m_y); return true; }
--- a/src/gui/debugpanel/debugpanel.cpp Sat Mar 29 11:31:47 2014 +0200 +++ b/src/gui/debugpanel/debugpanel.cpp Sun Mar 30 11:43:32 2014 +0300 @@ -21,6 +21,8 @@ #include "benchmarktab.h" #include "contenttab.h" +#include "debug.h" + // TODO(Augustin Preda, 2014.03.25): re-enable when functionality can be added. // #include "reloadtab.h" @@ -48,6 +50,7 @@ { if((Ogre::Root::getSingleton().getTimer()->getMilliseconds() - m_lastVisibilitySwitch) > 500) { + SW_DEBUG("Debug panel visibility toggle"); m_rootWindow->setVisible(!m_rootWindow->isVisible()); m_lastVisibilitySwitch = Ogre::Root::getSingleton().getTimer()->getMilliseconds(); } @@ -58,6 +61,9 @@ { m_rootWindow = m_winManager->createWindow("TaharezLook/FrameWindow", "DebugPanel"); m_rootWindow->setPosition(UVector2(UDim(0.1f, 0.0f), UDim(0.1f, 0.0f))); + m_rootWindow->setProperty("FrameEnabled", "true"); + m_rootWindow->setVisible(false); + CEGUIUtility::setWidgetSizeRel (m_rootWindow, 0.6f, 0.6f); m_rootWindow->setText((CEGUI::utf8*)"Debug Panel"); CEGUIUtility::addChildWidget(m_gameScreen, m_rootWindow); @@ -66,31 +72,37 @@ m_tabControl = static_cast<TabControl*>(m_winManager->createWindow("TaharezLook/TabControl", "DebugPanelTabControl")); m_tabControl->setPosition(UVector2(UDim(0.03f, 0.0f), UDim(0.06f, 0.0f))); + m_tabControl->setInheritsAlpha(true); CEGUIUtility::setWidgetSizeRel (m_tabControl,0.95f, 0.9f); - CEGUIUtility::addChildWidget(m_gameScreen, m_tabControl); + CEGUIUtility::addChildWidget(m_rootWindow, m_tabControl); GuiDebugTab *guiTab = static_cast<GuiDebugTab*>(m_winManager->createWindow("GuiDebugTab", "GuiDebugTab")); guiTab->setPosition(UVector2(UDim(0.0f, 0.0f), UDim(0.0f, 0.0f))); + guiTab->setInheritsAlpha(true); CEGUIUtility::setWidgetSizeRel (guiTab, 1.0f, 1.0f); addTabWindow("GuiDebugTab", guiTab); LuaScriptTab *luaTab = static_cast<LuaScriptTab*>(m_winManager->createWindow("LuaScriptTab", "LuaScriptTab")); luaTab->setPosition(UVector2(UDim(0.0f, 0.0f), UDim(0.0f, 0.0f))); + luaTab->setInheritsAlpha(true); CEGUIUtility::setWidgetSizeRel (luaTab, 1.0f, 1.0f); addTabWindow("LuaScriptTab", luaTab); IconEditorTab *iconEdTab = static_cast<IconEditorTab*>(m_winManager->createWindow("IconEditorTab", "IconEditorTab")); iconEdTab->setPosition(UVector2(UDim(0.0f, 0.0f), UDim(0.0f, 0.0f))); + iconEdTab->setInheritsAlpha(true); CEGUIUtility::setWidgetSizeRel (iconEdTab, 1.0f, 1.0f); addTabWindow("IconEditorTab", iconEdTab); BenchmarkTab *benchTab = static_cast<BenchmarkTab*>(m_winManager->createWindow("BenchmarkTab", "BenchmarkTab")); benchTab->setPosition(UVector2(UDim(0.0f, 0.0f), UDim(0.0f, 0.0f))); + benchTab->setInheritsAlpha(true); CEGUIUtility::setWidgetSizeRel (benchTab, 1.0f, 1.0f); addTabWindow("BenchmarkTab", benchTab); DebugCameraTab *camTab = static_cast<DebugCameraTab*>(m_winManager->createWindow("DebugCamera", "DebugCamera")); camTab->setPosition(UVector2(UDim(0.0f, 0.0f), UDim(0.0f, 0.0f))); + camTab->setInheritsAlpha(true); CEGUIUtility::setWidgetSizeRel (camTab, 1.0f, 1.0f); addTabWindow("DebugCamera", camTab); @@ -120,7 +132,9 @@ bool DebugPanel::tabExists(std::string tabName) { if(m_tabs.find(tabName) != m_tabs.end()) + { return true; + } return false; } @@ -129,10 +143,14 @@ void DebugPanel::update(OIS::Keyboard *keyboard, OIS::Mouse *mouse) { if(m_tabs.size() < 1) + { return; + } if(keyboard->isKeyDown(OIS::KC_LCONTROL) && keyboard->isKeyDown(OIS::KC_D)) + { toogleVisibility(); + } std::map<std::string, DebugTab*>::iterator iter; for (iter = m_tabs.begin(); iter != m_tabs.end(); ++iter)