mirror of
https://github.com/DaKerboul/perun.git
synced 2026-08-09 15:55:39 +02:00
Improvments at GUI
This commit is contained in:
@@ -48,8 +48,8 @@ class CurrentMissionClass
|
||||
public string Pause = ""; // Mission pause
|
||||
public int PlayerCount = 0; // Actual player time
|
||||
|
||||
public string ModelTime = ""; // Mission time
|
||||
public string RealTime = ""; // Server time
|
||||
public float ModelTime = 0; // Mission time
|
||||
public float RealTime = 0; // Server time
|
||||
}
|
||||
|
||||
internal class Globals
|
||||
|
||||
@@ -5,6 +5,14 @@ using System.Text.RegularExpressions;
|
||||
|
||||
internal class PerunHelper
|
||||
{
|
||||
public static string SecondsToString(float Seconds)
|
||||
{
|
||||
int Hours = (int) Seconds / 3600;
|
||||
int Minutes = ((int)Seconds % 3600)/60 ;
|
||||
string ToReturn = $"{Hours.ToString("00")}h {Minutes.ToString("00")}m";
|
||||
return ToReturn;
|
||||
}
|
||||
|
||||
public static void SetFrameRates(float frame_rate, float last_delay)
|
||||
{
|
||||
Globals.LastFrameTime = frame_rate;
|
||||
|
||||
@@ -187,6 +187,11 @@ public class TCPController
|
||||
Globals.ErrorsGame++;
|
||||
Console.WriteLine(e.ToString());
|
||||
PerunHelper.LogError(ref Globals.arrGUILogHistory, $"ERROR TCP - connection closed or port in use, error: {e.Message}",1,1,"?");
|
||||
|
||||
// Reset last frame times on broken connection
|
||||
Globals.LastFrameTime = 0f;
|
||||
Globals.LastFrameDelay = 0f;
|
||||
|
||||
bTCPConnectionOnline = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -526,8 +526,8 @@ namespace Perun_v1
|
||||
label18.Text = Globals.CurrentMission.Theatre;
|
||||
label19.Text = Globals.CurrentMission.PlayerCount.ToString();
|
||||
|
||||
label21.Text = Globals.CurrentMission.ModelTime;
|
||||
label16.Text = Globals.CurrentMission.RealTime;
|
||||
label21.Text = PerunHelper.SecondsToString(Globals.CurrentMission.ModelTime);
|
||||
label16.Text = PerunHelper.SecondsToString(Globals.CurrentMission.RealTime);
|
||||
|
||||
if (Globals.CurrentMission.Pause == "True")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user