1class PluginUniversalTemperatureSourceClient
extends PluginBase
3 const int MAX_SIMULTANEOUS_UTS = 10;
42 m_RootWidget[
i] =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/debug/day_z_debug_remoteinfo.layout");
54 float temp =
utsd.GetValue(3).ToFloat();
72 if (m_UTemperatureSourceDebugs.Count() > 0)
74 DbgUI.
Begin(
"Universal Temp Sources", 10, 300);
75 DbgUI.
Text(
string.Format(
"Lookup radius: %1m (server-side)", PluginUniversalTemperatureSourceServer.LOOKUP_RADIUS));
76 DbgUI.
Text(
string.Format(
"Count: %1", m_UTemperatureSourceDebugs.Count()));
77 DbgUI.
Text(
string.Format(
"Avg. temp: %1 °C", m_UTSAverageTemperature));
84 if (m_UTemperatureSourceDebugs.Count() == 0)
86 m_UTSAverageTemperature = 0;
107 m_UTSAverageTemperature = (
max +
min) * 0.5;
109 m_UTSAverageTemperature =
max;
192 m_UTemperatureSourceDebugs.Clear();
209 PrintString(
"-------------------------------------");
211 PrintString(
"-------------------------------------");
219 ctx.Read(m_UTemperatureSourceDebugs);
ref TextListboxWidget m_StatListWidgets[MAX_SIMULTANIOUS_PLAYERS]
ref Widget m_RootWidget[MAX_SIMULTANIOUS_PLAYERS]
static Shape DrawCylinder(vector pos, float radius, float height=1, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.NOOUTLINE)
static Shape DrawArrow(vector from, vector to, float size=0.5, int color=0xFFFFFFFF, int flags=0)
void UpdateStatWidget(int rowIndex, UTemperatureSourceDebug utsd)
void RequestUniversalTemperatureSources(PlayerBase player, int enable)
void PluginUniversalTemperatureSourceClient()
void ProcessUniversalTemperatureSources()
ref array< ref UTemperatureSourceDebug > m_UTemperatureSourceDebugs
const int MAX_SIMULTANEOUS_UTS
void OnRPC(ParamsReadContext ctx)
float CalcTemperatureFromTemperatureSource(notnull UTemperatureSourceDebug utsd)
float m_UTSAverageTemperature
override void OnUpdate(float delta_time)
void EnableWidgets(bool enable)
Serialization general interface. Serializer API works with:
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
proto native CGame GetGame()
static proto native void End()
static proto native void Begin(string windowTitle, float x=0, float y=0)
static proto native void Text(string label)
void PrintString(string s)
Helper for printing out string expression. Example: PrintString("Hello " + var);.
static proto float Max(float x, float y)
Returns bigger of two given values.
static proto float SqrFloat(float f)
Returns squared value.