Missed some extra gnsonglength variables. Added in globals for TotalTimeMinutes and...
authorCameron Ball <c.ball1729@gmail.com>
Tue, 10 Dec 2013 16:54:18 +0000 (00:54 +0800)
committerCameron Ball <c.ball1729@gmail.com>
Tue, 10 Dec 2013 16:54:18 +0000 (00:54 +0800)
Themes/GrooveNights/BGAnimations/ScreenEvaluation overlay.xml
Themes/GrooveNights/Graphics/ScreenSelectMusic banner frame/default.xml
Themes/GrooveNights/Scripts/Other.lua
Themes/GrooveNights/Scripts/gnSystem.lua
Themes/GrooveNights/metrics.ini

index 33011c9..7e59d7d 100644 (file)
@@ -114,37 +114,7 @@ end">
                        />
                        </children>
                </ActorFrame>
-               
-       <!--[OBSOLETE BUT HAS CALCULATIONS] Display Song's Length-->
-       <BitmapText Font="_eurostile normal" Text=""
-       Condition="GAMESTATE:IsPlayerEnabled(PLAYER_1)"
-       InitCommand="%function(self)
-       if gnSongLength == nil then gnSongLength = '' end
-       if gnSongLength == 'Patched' then gnSongLength = 'Length Patched' end
-       self:settext(gnSongLength);
-       self:x(SCREEN_CENTER_X+101);
-       self:y(SCREEN_CENTER_Y-89);
-       self:zoom(0.5);
-       self:shadowlength(0);
-       self:horizalign('right');
-       self:hidden(1);
-       end"
-       />
-       <BitmapText Font="_eurostile normal" Text=""
-       Condition="GAMESTATE:IsPlayerEnabled(PLAYER_2)"
-       InitCommand="%function(self)
-       if gnSongLength == nil then gnSongLength = '' end
-       if gnSongLength == 'Patched' then gnSongLength = 'Length Patched' end
-       self:settext(gnSongLength);
-       self:x(SCREEN_CENTER_X+101);
-       self:y(SCREEN_CENTER_Y-89);
-       self:zoom(0.5);
-       self:shadowlength(0);
-       self:horizalign('right');
-       self:hidden(1);
-       end"
-       />
-       
+                       
        <!--Cull the Mods-->
        <BitmapText Font="_eurostile normal" Text=""
        Condition="GAMESTATE:IsPlayerEnabled(PLAYER_1)"
index 0dc7204..1d1f731 100644 (file)
@@ -240,6 +240,15 @@ end"
                                        end"
                                />
                                
+<!-- Determine Song Length-->
+               <BitmapText
+                       Text=""
+                       File="_eurostile blue glow"
+                       InitCommand="%function(self)  self:horizalign('right'); self:maxwidth(67); self:shadowlength(0); self:zoom(0.55); self:x(93+97); self:y(-22); self:draworder(10000); self:queuecommand('Update'); end"
+                       CurrentStepsP1ChangedMessageCommand="queuecommand,Update"
+                       CurrentStepsP2ChangedMessageCommand="queuecommand,Update"
+                       UpdateCommand="%function(self) self:settext(DisplaySongLength()) end"                   
+               />
 <!-- Determine Song Location-->
                <BitmapText
                        Text=""
index 7fb9485..c7856ee 100644 (file)
@@ -496,16 +496,9 @@ function DisplayScrollSpeed(pn)
 end
 
 function DisplaySongLength()
-       local SongLength = GetGlobal("TotalTime")
-
        local RateMod = string.gsub(GetRateMod(), "x" ,"")
        local ratio = 1/RateMod
-       
-       local pos = string.find(SongLength, ':')
-       local minutes = string.sub(SongLength, 1, pos-1)
-       local seconds = string.sub(SongLength, pos+1)
-       
-       seconds = (seconds + (minutes*60))*ratio
+       local seconds = (GetGlobal('TotalTimeSeconds') + (GetGlobal('TotalTimeMinutes')*60))*ratio
 
        return string.format("%.2d:%.2d", math.mod(seconds/60,60), math.mod(seconds,60))
 end
\ No newline at end of file
index 9409f79..b29c03a 100644 (file)
@@ -383,5 +383,17 @@ local function HighBPM( BPMDisplay )
        if pos ~= nil then return string.sub(BPMDisplay,pos+1) else return BPMDisplay end
 end
 
+local function TotalTimeMinutes( TimeDisplay ) 
+       local pos = string.find(TimeDisplay, ':')
+       return string.sub(TimeDisplay, 1, pos-1) 
+end
+
+local function TotalTimeSeconds( TimeDisplay )
+       local pos = string.find(TimeDisplay, ':')
+       return string.sub(TimeDisplay, pos+1)
+end
+
 RegisterGlobalCallback("HighBPM", HighBPM)
-RegisterGlobalCallback("LowBPM", LowBPM)
\ No newline at end of file
+RegisterGlobalCallback("LowBPM", LowBPM)
+RegisterGlobalCallback("TotalTimeMinutes", TotalTimeMinutes)
+RegisterGlobalCallback("TotalTimeSeconds", TotalTimeSeconds)
\ No newline at end of file
index d5e3c4d..6eaaf6c 100644 (file)
@@ -786,10 +786,10 @@ TipY=0
 [ScreenSelectMusic]
 TotalTimeX=SCREEN_CENTER_X 
 TotalTimeY=SCREEN_CENTER_Y+10000
-TotalTimeOnCommand=%function(self) self:diffusealpha(0); RegisterGlobal("TotalTime", self) end
+TotalTimeOnCommand=%function(self) self:diffusealpha(0); RegisterGlobal("TotalTimeMinutes", self); RegisterGlobal("TotalTimeSeconds", self) end
 # We must use the CurrentSteps message command as this command is broadcast AFTER the bpm display updates
-TotalTimeCurrentStepsP1ChangedMessageCommand=%function(self) RegisterGlobal("TotalTime", self) end
-TotalTimeCurrentStepsP2ChangedMessageCommand=%function(self) RegisterGlobal("TotalTime", self) end
+TotalTimeCurrentStepsP1ChangedMessageCommand=%function(self) self:diffusealpha(0); RegisterGlobal("TotalTimeMinutes", self); RegisterGlobal("TotalTimeSeconds", self) end
+TotalTimeCurrentStepsP2ChangedMessageCommand=%function(self) self:diffusealpha(0); RegisterGlobal("TotalTimeMinutes", self); RegisterGlobal("TotalTimeSeconds", self) end
 TotalTimeOffCommand=
 CDTitleX=SCREEN_CENTER_X+268 
 CDTitleY=SCREEN_CENTER_Y-50