Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
718c2369
Commit
718c2369
authored
Feb 11, 2010
by
Sebastian Eichelbaum
Browse files
[CHANGE] - WMHud now uses new properties
parent
e5df103a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
16 deletions
+17
-16
src/modules/hud/WMHud.cpp
src/modules/hud/WMHud.cpp
+14
-12
src/modules/hud/WMHud.h
src/modules/hud/WMHud.h
+3
-4
No files found.
src/modules/hud/WMHud.cpp
View file @
718c2369
...
...
@@ -61,7 +61,11 @@ void WMHud::connectors()
void
WMHud
::
properties
()
{
(
m_properties
->
addBool
(
"active"
,
true
,
true
)
)
->
connect
(
boost
::
bind
(
&
WMHud
::
slotPropertyChanged
,
this
,
_1
)
);
// m_active get initialized in WModule and is available for all modules.
// simply register our activate function
// It should get triggered whever m_active changes
m_active
->
getCondition
()
->
subscribeSignal
(
boost
::
bind
(
&
WMHud
::
activate
,
this
)
);
}
void
WMHud
::
moduleMain
()
...
...
@@ -177,7 +181,7 @@ void WMHud::init()
m_rootNode
->
setUserData
(
this
);
m_rootNode
->
setUpdateCallback
(
new
HUDNodeCallback
);
if
(
m_
properties
->
getValue
<
bool
>
(
"active"
)
)
if
(
m_
active
->
get
(
)
)
{
m_rootNode
->
setNodeMask
(
0xFFFFFFFF
);
}
...
...
@@ -212,17 +216,15 @@ void WMHud::update()
lock
.
unlock
();
}
void
WMHud
::
slotPropertyChanged
(
std
::
string
propertyName
)
void
WMHud
::
activate
(
)
{
if
(
propertyName
==
"active"
)
if
(
m_active
->
get
()
)
{
if
(
m_properties
->
getValue
<
bool
>
(
"active"
)
)
{
m_rootNode
->
setNodeMask
(
0xFFFFFFFF
);
}
else
{
m_rootNode
->
setNodeMask
(
0x0
);
}
m_rootNode
->
setNodeMask
(
0xFFFFFFFF
);
}
else
{
m_rootNode
->
setNodeMask
(
0x0
);
}
}
src/modules/hud/WMHud.h
View file @
718c2369
...
...
@@ -135,11 +135,10 @@ private:
void
update
();
/**
* Gets signaled from the properties object when something was changed
*
* \param propertyName the name of the property that has changed
* Gets signaled from the properties object when something was changed. Now, only m_active is used. This method therefore simply
* activates/deactivates the HUD.
*/
void
slotPropertyChanged
(
std
::
string
propertyName
);
void
activate
(
);
/**
* Node callback to handle updates properly
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment