use new function to toggle widget
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@8004 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 8db3362e79795065531751ed8be831e90955b25f Former-commit-id: dd0466d2fd0d64569347bad1de1544e8467defc2
This commit is contained in:
parent
ea95288055
commit
bfd22dfe44
1 changed files with 1 additions and 13 deletions
|
@ -1472,20 +1472,8 @@ void SDHUD::ToggleHUDwidgets(const std::string &widgets)
|
|||
|
||||
void SDHUD::ToggleHUDdriverinput()
|
||||
{
|
||||
hudWidgets["driverinputWidget"]->setNodeMask(1 - hudWidgets["driverinputWidget"]->getNodeMask());
|
||||
ToggleHUDwidget("driverinputWidget");
|
||||
hudImgRotableElements["driverinput-wheel"]->setNodeMask(hudWidgets["driverinputWidget"]->getNodeMask());
|
||||
|
||||
//save the current status in the config file
|
||||
std::string configFileUrl= GetLocalDir();
|
||||
configFileUrl.append("config/osghudconfig.xml");
|
||||
std::string path= "widgets/driverinputWidget";
|
||||
std::string attribute= "enabled";
|
||||
int value = hudWidgets["driverinputWidget"]->getNodeMask();
|
||||
|
||||
//read the config file, update the value and write it back
|
||||
void *paramHandle = GfParmReadFile(configFileUrl.c_str(), GFPARM_RMODE_STD);
|
||||
GfParmSetNum(paramHandle, path.c_str(), attribute.c_str(), NULL, (int)value);
|
||||
GfParmWriteFile(NULL, paramHandle, "osghudconfig");
|
||||
}
|
||||
|
||||
osg::ref_ptr <osg::Group> SDHUD::generateHudFromXmlFile(int scrH, int scrW)
|
||||
|
|
Loading…
Reference in a new issue