DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ SetFramerateText()

void DebugMonitor::SetFramerateText ( TextWidget widget,
float value )
inlineprotected

Sets the provided text widget to display framerate value. Formats and colors the widget according to the value.

См. определение в файле DebugMonitor.c строка 100

101 {
102 // Ideally we would poll the refresh rate and base the values as
103 // percentage thereof, but there is no such API in scripts.
104
105 #ifdef PLATFORM_CONSOLE
106 // default [30, inf] ; orange [20, 29] ; red [0, 19]
107 if (value > 29)
108 widget.SetColor(m_FPSTextDefaultColor);
109 else if (value > 19)
110 widget.SetColor(0xFFFF8000); // COLOR_ORANGE
111 else
112 widget.SetColor(COLOR_RED);
113 #else
114 // default [60, inf] ; yellow [40, 59] ; orange [30, 39] ; red [0, 29]
115 if (value > 59)
116 widget.SetColor(m_FPSTextDefaultColor);
117 else if (value > 39)
118 widget.SetColor(COLOR_YELLOW);
119 else if (value > 29)
120 widget.SetColor(0xFFFF8000); // COLOR_ORANGE
121 else
122 widget.SetColor(COLOR_RED);
123 #endif
124
125 widget.SetTextFormat("%1", Math.Round(value));
126 }
int m_FPSTextDefaultColor
Определения DebugMonitor.c:24
const int COLOR_RED
Определения 1_Core/DayZ/constants.c:64
const int COLOR_YELLOW
Определения 1_Core/DayZ/constants.c:67

Перекрестные ссылки COLOR_RED, COLOR_YELLOW, m_FPSTextDefaultColor и Math::Round().

Используется в SetFramerate().