Added report better
This commit is contained in:
parent
54ed6af060
commit
ccf8618ff2
4 changed files with 38 additions and 17 deletions
|
|
@ -11,6 +11,7 @@ namespace MosswartMassacre
|
||||||
private static IStaticText lblKillsPerHour;
|
private static IStaticText lblKillsPerHour;
|
||||||
private static IStaticText lblElapsedTime;
|
private static IStaticText lblElapsedTime;
|
||||||
private static IStaticText lblRareCount;
|
private static IStaticText lblRareCount;
|
||||||
|
private static IButton btnRestart;
|
||||||
|
|
||||||
public static void ViewInit()
|
public static void ViewInit()
|
||||||
{
|
{
|
||||||
|
|
@ -26,6 +27,8 @@ namespace MosswartMassacre
|
||||||
lblKillsPerHour = (IStaticText)View["lblKillsPerHour"];
|
lblKillsPerHour = (IStaticText)View["lblKillsPerHour"];
|
||||||
lblElapsedTime = (IStaticText)View["lblElapsedTime"];
|
lblElapsedTime = (IStaticText)View["lblElapsedTime"];
|
||||||
lblRareCount = (IStaticText)View["lblRareCount"];
|
lblRareCount = (IStaticText)View["lblRareCount"];
|
||||||
|
btnRestart = (IButton)View["btnRestart"];
|
||||||
|
btnRestart.Hit += OnRestartClick;
|
||||||
|
|
||||||
PluginCore.WriteToChat("View initialized.");
|
PluginCore.WriteToChat("View initialized.");
|
||||||
}
|
}
|
||||||
|
|
@ -41,6 +44,7 @@ namespace MosswartMassacre
|
||||||
{
|
{
|
||||||
View.Dispose();
|
View.Dispose();
|
||||||
PluginCore.WriteToChat("View destroyed.");
|
PluginCore.WriteToChat("View destroyed.");
|
||||||
|
btnRestart.Hit -= OnRestartClick;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
@ -57,12 +61,15 @@ namespace MosswartMassacre
|
||||||
|
|
||||||
public static void UpdateElapsedTime(TimeSpan elapsed)
|
public static void UpdateElapsedTime(TimeSpan elapsed)
|
||||||
{
|
{
|
||||||
lblElapsedTime.Text = $"Elapsed Time: {Math.Floor(elapsed.TotalHours):00}:{elapsed.Minutes:00}:{elapsed.Seconds:00}";
|
lblElapsedTime.Text = $"Elapsed Time: {elapsed:hh\\:mm\\:ss}";
|
||||||
|
|
||||||
}
|
}
|
||||||
public static void UpdateRareCount(int rareCount)
|
public static void UpdateRareCount(int rareCount)
|
||||||
{
|
{
|
||||||
lblRareCount.Text = $"Rare Count: {rareCount}";
|
lblRareCount.Text = $"Rare Count: {rareCount}";
|
||||||
}
|
}
|
||||||
|
private static void OnRestartClick(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
PluginCore.RestartStats();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -205,5 +205,17 @@ namespace MosswartMassacre
|
||||||
{
|
{
|
||||||
MyHost.Actions.AddChatText("[Mosswart Massacre] " + message, 0, 1);
|
MyHost.Actions.AddChatText("[Mosswart Massacre] " + message, 0, 1);
|
||||||
}
|
}
|
||||||
|
public static void RestartStats()
|
||||||
|
{
|
||||||
|
totalKills = 0;
|
||||||
|
rareCount = 0;
|
||||||
|
statsStartTime = DateTime.Now;
|
||||||
|
killsPer5Min = 0;
|
||||||
|
killsPerHour = 0;
|
||||||
|
|
||||||
|
WriteToChat("Stats have been reset.");
|
||||||
|
MainView.UpdateKillStats(totalKills, killsPer5Min, killsPerHour);
|
||||||
|
MainView.UpdateRareCount(rareCount);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<view icon="7735" title="Mosswart Massacre" width="270" height="140">
|
<view icon="7735" title="Mosswart Massacre" width="160" height="160">
|
||||||
<control progid="DecalControls.FixedLayout" clipped="">
|
<control progid="DecalControls.FixedLayout" clipped="">
|
||||||
<control progid="DecalControls.StaticText" name="lblTotalKills" left="10" top="10" width="250" height="20" text="Total Kills: 0"/>
|
<control progid="DecalControls.StaticText" name="lblTotalKills" left="10" top="10" width="250" height="20" text="Total Kills: 0"/>
|
||||||
<control progid="DecalControls.StaticText" name="lblKillsPer5Min" left="10" top="30" width="250" height="20" text="Kills per 5 Min: 0"/>
|
<control progid="DecalControls.StaticText" name="lblKillsPer5Min" left="10" top="30" width="250" height="20" text="Kills per 5 Min: 0"/>
|
||||||
<control progid="DecalControls.StaticText" name="lblKillsPerHour" left="10" top="50" width="250" height="20" text="Kills per Hour: 0"/>
|
<control progid="DecalControls.StaticText" name="lblKillsPerHour" left="10" top="50" width="250" height="20" text="Kills per Hour: 0"/>
|
||||||
<control progid="DecalControls.StaticText" name="lblElapsedTime" left="10" top="70" width="250" height="20" text="Elapsed Time: 00:00:00"/>
|
<control progid="DecalControls.StaticText" name="lblElapsedTime" left="10" top="70" width="250" height="20" text="Elapsed Time: 00:00:00"/>
|
||||||
<control progid="DecalControls.StaticText" name="lblRareCount" left="10" top="90" width="250" height="20" text="Rare Count: 0"/>
|
<control progid="DecalControls.StaticText" name="lblRareCount" left="10" top="90" width="250" height="20" text="Rare Count: 0"/>
|
||||||
|
<control progid="DecalControls.PushButton" name="btnRestart" left="10" top="110" width="100" height="20" text="Restart"/>
|
||||||
|
|
||||||
</control>
|
</control>
|
||||||
</view>
|
</view>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue