@@ -20,8 +20,6 @@ void Menu::Init(int iClientNum, Option *pOption)
20
20
m_Instructions = Text (" Navigate: " CHAR_UP " - " CHAR_DOWN " | Select: " CHAR_X " | Back: " CHAR_RS,
21
21
HudElem::s_MenuX + HudElem::s_Padding, HudElem::s_MenuY + HudElem::s_MenuHeight - HudElem::s_Padding - 80 .0f , HudElem::s_ColorWhite, 0 .7f );
22
22
23
- m_Feedback = Text (" " , 50 .0f , HudElem::s_MenuY + HudElem::s_MenuHeight - HudElem::s_Padding - 120 .0f , HudElem::s_ColorWhite, 0 .7f );
24
-
25
23
// Initialize the scroller position
26
24
m_iCurrentScrollerPos = 0 ;
27
25
@@ -101,49 +99,8 @@ void Menu::Update()
101
99
102
100
void Menu::Render ()
103
101
{
104
- // If the menu is not initialized, don't go further
105
- if (!m_bInitialized)
106
- return ;
107
-
108
- // This is a terrible way of getting the feedback text to disappear after
109
- // three seconds but I didn't find anything else that worked
110
-
111
- // Initialize the timer
112
- static DWORD dwMilliseconds = 0 ;
113
-
114
- // Update the feedback text if one has been pushed to the queue
115
- if (!m_ChangeFeedbackTextQueue.empty ())
116
- {
117
- m_Feedback.SetText (m_ChangeFeedbackTextQueue.front ());
118
- m_ChangeFeedbackTextQueue.pop ();
119
-
120
- // Reset the timer when the feedback text gets set
121
- dwMilliseconds = 0 ;
122
- }
123
-
124
- // Only render the feedback text if it's set
125
- if (m_Feedback.GetText () != " " )
126
- {
127
- // We incremement the timer by 16 because the game runs at 60fps with means
128
- // a frame is rendered every 16 milliseconds (1000 / 60 = 16)
129
- dwMilliseconds += 16 ;
130
-
131
- // If more than three seconds have elapsed, reset the timer and the feedback
132
- // text
133
- if (dwMilliseconds > 3000 )
134
- {
135
- m_Feedback.SetText (" " );
136
- dwMilliseconds = 0 ;
137
- }
138
-
139
- // Only render the feedback text if it's still set (three seconds have not
140
- // elapsed yet)
141
- if (m_Feedback.GetText () != " " )
142
- m_Feedback.Draw ();
143
- }
144
-
145
- // If the menu is not open, don't go further
146
- if (!m_bOpen)
102
+ // If the menu is not initialized or not open, don't go further
103
+ if (!m_bInitialized || !m_bOpen)
147
104
return ;
148
105
149
106
// Draw the constant HUD elements
@@ -177,12 +134,6 @@ void Menu::Stop()
177
134
m_pBotEntity = nullptr ;
178
135
}
179
136
180
- void Menu::SetFeedbackText (const std::string &strText)
181
- {
182
- // Set the feedback text
183
- m_ChangeFeedbackTextQueue.push (strText);
184
- }
185
-
186
137
void Menu::SetCurrentOption (Option *pOption)
187
138
{
188
139
// Reset the scroller position
0 commit comments