automatic restart of trial time and removed possible new topscore note

René Welbers [01-26-16 - 13:34]
automatic restart of trial time and removed possible new topscore note
Filename
Locales/de.lua
Locales/en.lua
RaidTimer.lua
RaidTimer.txt
diff --git a/Locales/de.lua b/Locales/de.lua
index 138d649..1592989 100644
--- a/Locales/de.lua
+++ b/Locales/de.lua
@@ -31,7 +31,7 @@ L.Raid_Score_Template           = 'Punkte: 0'
 L.Total_Time                    = 'Zeit: <<1>>' -- <<1>> is the formatted time
 L.Raid_Score_Without_Estimation = 'Punkte: <<1>>' -- <<1>> ist the current score
 L.Raid_Score_With_Estimation    = 'Punkte: <<1>> (~<<2>>)' -- <<1>> ist the current score, <<2>> the estimated score
-L.Raid_Score_With_New_TopScore  = 'Punkte: <<1>> (~<<2>>) - Mögliche neue Bestpunktzahl!'  -- <<1>> ist the current score, <<2>> the estimated score
+L.Raid_Score_With_New_TopScore  = 'Punkte: <<1>> (~<<2>>)!!'  -- <<1>> ist the current score, <<2>> the estimated score
 L.Possible_New_TopScore_Debug   = 'Mögliche neue Bestpunktzahl! Vorherige Bestpunktzahl war <<1>> (<<2>>)'  -- <<1>> ist the previous score, <<2>> the previous time
 L.Debug_Message                 = 'Punkte: |cFFFFFF<<1>>|r, Total: |cFFFFFF<<2>>|r, Grund: |cFFFFFF<<3>>|r'  -- <<1>> ist the current points, <<2>> the total raidscore and <<3>> the reason for getting points
 L.Trial_Start_Message           = 'Prüfung gestartet, aktuelle Bestpunktzahl: |cFFFFFF<<1>>|r, Zeit: |cFFFFFF<<2>>|r' -- <<1>> is the previous topscore, <<2>> the previous top time
diff --git a/Locales/en.lua b/Locales/en.lua
index 15bce2c..f122535 100644
--- a/Locales/en.lua
+++ b/Locales/en.lua
@@ -31,7 +31,7 @@ L.Raid_Score_Template           = 'Raid Score: 0'
 L.Total_Time                    = 'Total Time: <<1>>' -- <<1>> is the formatted time
 L.Raid_Score_Without_Estimation = 'Raid Score: <<1>>' -- <<1>> ist the current score
 L.Raid_Score_With_Estimation    = 'Raid Score: <<1>> (~<<2>>)' -- <<1>> ist the current score, <<2>> the estimated score
-L.Raid_Score_With_New_TopScore  = 'Raid Score: <<1>> (~<<2>>) - Possible new Topscore!'  -- <<1>> ist the current score, <<2>> the estimated score
+L.Raid_Score_With_New_TopScore  = 'Raid Score: <<1>> (~<<2>>)!!'  -- <<1>> ist the current score, <<2>> the estimated score
 L.Possible_New_TopScore_Debug   = 'Possible new Topscore! Previuos Topscore was <<1>> (<<2>>)'  -- <<1>> ist the previous score, <<2>> the previous time
 L.Debug_Message                 = 'Raid Score: |cFFFFFF<<1>>|r, total: |cFFFFFF<<2>>|r, reason: |cFFFFFF<<3>>|r'  -- <<1>> ist the current points, <<2>> the total raidscore and <<3>> the reason for getting points
 L.Trial_Start_Message           = 'Raid Started, current TopScore: |cFFFFFF<<1>>|r, Time: |cFFFFFF<<2>>|r' -- <<1>> is the previous topscore, <<2>> the previous top time
diff --git a/RaidTimer.lua b/RaidTimer.lua
index 764a824..7b0d108 100644
--- a/RaidTimer.lua
+++ b/RaidTimer.lua
@@ -5,7 +5,7 @@ RaidTimer = {}

 RaidTimer.name		= 'RaidTimer'
 RaidTimer.slash		= '/rt'
-RaidTimer.version	= '1.3.4'
+RaidTimer.version	= '1.3.5'
 RaidTimer.versionDB	= 1
 RaidTimer.loaded	= false
 RaidTimer.author    = 'Noshiz, Garkin & silentgecko'
@@ -380,6 +380,18 @@ end
 function RaidTimer.TimerStart()
     local self = RaidTimer

+    -- check if we are currently running, then auto stop and restart
+    if self.tempVars.instance then
+        local raidName = GetRaidName(GetCurrentParticipatingRaidId())
+        if #raidName == 0 then raidName = GetString(RAIDTIMER_TRIALNAME_UNKNOWN) end
+        local raidScore = GetCurrentRaidScore()
+        local totalTime
+        if HasRaidEnded() and WasRaidSuccessful() then
+            totalTime = GetGameTimeMilliseconds() - self.raidStart
+        end
+        self.TimerStop(nil, raidName, raidScore, totalTime)
+    end
+
     self.tempVars.stop = false
     self.tempVars.instance = true

diff --git a/RaidTimer.txt b/RaidTimer.txt
index f497992..5adce5f 100644
--- a/RaidTimer.txt
+++ b/RaidTimer.txt
@@ -1,6 +1,6 @@
 ## Title: |cEFEBBERaid Timer|r
 ## Author: Noshiz, |cEFEBBEGarkin|r, |c4779cesilentgecko|r
-## Version: 1.3.4
+## Version: 1.3.5
 ## APIVersion: 100013
 ## SavedVariables: RTVars
 ## OptionalDependsOn: LibAddonMenu-2.0