MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / SaveValue

Method SaveValue

ogsr_engine/xrGame/ui/UITrackBar.cpp:96–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94void CUITrackBar::Draw() { CUIWindow::Draw(); }
95
96void CUITrackBar::SaveValue()
97{
98 CUIOptionsItem::SaveValue();
99
100 string128 buf;
101 if (m_b_is_float)
102 {
103 SaveOptFloatValue(m_f_val);
104 if (m_f_step >= 1)
105 sprintf_s(buf, "%2.0f", m_f_val);
106 else if (m_f_step >= 0.1)
107 sprintf_s(buf, "%3.1f", m_f_val);
108 else
109 sprintf_s(buf, "%4.2f", m_f_val);
110 }
111 else
112 {
113 SaveOptIntegerValue(m_i_val);
114 sprintf_s(buf, "%d", m_i_val);
115 }
116
117 m_pSlider->SetText(buf);
118 GetMessageTarget()->SendMessage(this, TRACKBAR_CHANGED);
119}
120
121float CUITrackBar::GetTrackValue()
122{

Callers

nothing calls this directly

Calls 2

SetTextMethod · 0.45
SendMessageMethod · 0.45

Tested by

no test coverage detected