MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / SetStates

Method SetStates

ui/UIHotspot.cpp:114–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112}
113
114void UIHotspot::SetStates(UIItem *itemoff, UIItem *itemon) {
115 ASSERT(itemoff);
116 ASSERT(itemon);
117
118 // determine which state it currently set, so we can set it on the new state
119 bool currstate = false;
120
121 if (m_ItemOn == m_ItemCur)
122 currstate = true;
123
124 if (m_ItemOff)
125 delete m_ItemOff;
126 if (m_ItemOn)
127 delete m_ItemOn;
128
129 m_ItemOff = itemoff->CopyUIItem();
130 m_ItemOn = itemon->CopyUIItem();
131
132 if (currstate)
133 m_ItemCur = m_ItemOn;
134 else
135 m_ItemCur = m_ItemOff;
136}
137
138// override: behavior when gadget is destroyed.
139void UIHotspot::OnDestroy() {

Callers 4

SetCurrentValueMethod · 0.80
UpdateCheckBoxMethod · 0.80
AddMethod · 0.80
HotSpotSetStatesFunction · 0.80

Calls 1

CopyUIItemMethod · 0.45

Tested by

no test coverage detected