Merge pull request #1143 from kyzentun/sync_overlay_lua
Move ScreenSyncOverlay actors to lua
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
local revert_sync_changes= THEME:GetString("ScreenSyncOverlay", "revert_sync_changes")
|
||||
local change_bpm= THEME:GetString("ScreenSyncOverlay", "change_bpm")
|
||||
local change_song_offset= THEME:GetString("ScreenSyncOverlay", "change_song_offset")
|
||||
local change_machine_offset= THEME:GetString("ScreenSyncOverlay", "change_machine_offset")
|
||||
local hold_alt= THEME:GetString("ScreenSyncOverlay", "hold_alt")
|
||||
|
||||
return Def.ActorFrame{
|
||||
Def.Quad{
|
||||
Name= "quad", InitCommand= function(self)
|
||||
self:diffuse{0, 0, 0, 0}:horizalign(right):vertalign(top)
|
||||
:xy(_screen.w, 0)
|
||||
end,
|
||||
ShowCommand= function(self)
|
||||
self:stoptweening():linear(.3):diffusealpha(.5)
|
||||
:sleep(4):linear(.3):diffusealpha(0)
|
||||
end,
|
||||
HideCommand= function(self)
|
||||
self:finishtweening()
|
||||
end,
|
||||
},
|
||||
Def.BitmapText{
|
||||
Name= "help_text", Font= "Common Normal", InitCommand= function(self)
|
||||
local text= {
|
||||
revert_sync_changes..":",
|
||||
" F4",
|
||||
change_bpm..":",
|
||||
" F9/F10",
|
||||
change_song_offset..":",
|
||||
" F11/F12",
|
||||
change_machine_offset..":",
|
||||
" Shift + F11/F12",
|
||||
hold_alt,
|
||||
}
|
||||
self:diffuse{1, 1, 1, 0}:horizalign(left):vertalign(top)
|
||||
:shadowlength(2):settext(table.concat(text, "\n"))
|
||||
:xy(_screen.w - self:GetZoomedWidth() - 10, 10)
|
||||
|
||||
local quad= self:GetParent():GetChild("quad")
|
||||
quad:zoomtowidth(self:GetZoomedWidth()+20)
|
||||
:zoomtoheight(self:GetZoomedHeight()+20)
|
||||
end,
|
||||
ShowCommand= function(self)
|
||||
self:stoptweening():linear(.3):diffusealpha(1)
|
||||
:sleep(4):linear(.3):diffusealpha(0)
|
||||
end,
|
||||
HideCommand= function(self)
|
||||
self:finishtweening()
|
||||
end,
|
||||
},
|
||||
Def.BitmapText{
|
||||
Name= "Status", Font= "ScreenSyncOverlay status",
|
||||
InitCommand= function(self)
|
||||
ActorUtil.LoadAllCommands(self, "ScreenSyncOverlay")
|
||||
self:playcommand("On")
|
||||
end,
|
||||
SetStatusCommand= function(self, param)
|
||||
self:settext(param.text)
|
||||
end,
|
||||
},
|
||||
Def.BitmapText{
|
||||
Name= "Adjustments", Font= "ScreenSyncOverlay adjustments",
|
||||
InitCommand= function(self)
|
||||
ActorUtil.LoadAllCommands(self, "ScreenSyncOverlay")
|
||||
self:playcommand("On")
|
||||
end,
|
||||
SetAdjustmentsCommand= function(self, param)
|
||||
self:visible(param.visible):settext(param.text)
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -1949,24 +1949,6 @@ Stats not saved - No memory cards ready.=Statistiken nicht gespeichert - Keine S
|
||||
The profile on P%d card contains corrupt or tampered data.=Das Profil von P%ds Karte enthält korrupte oder modifizierte Daten.
|
||||
There is no machine profile on P%d card.=Es gibt kein Maschinen-Profil auf P%ds Karte.
|
||||
|
||||
[ScreenSyncOverlay]
|
||||
AutoPlay=AutoPlay
|
||||
AutoPlayCPU=AutoPlayCPU
|
||||
AutoSync Machine=AutoSync Machine
|
||||
AutoSync Song=AutoSync Song
|
||||
AutoSync Tempo=AutoSync Tempo
|
||||
Can't sync while playing a course.=Can't sync while playing a course.
|
||||
Sync changes reverted.=Sync changes reverted.
|
||||
Revert sync changes=Revert sync changes
|
||||
Current BPM - smaller/larger=Current BPM - smaller/larger
|
||||
Song offset - notes earlier/later=Song offset - notes earlier/later
|
||||
Machine offset - notes earlier/later=Machine offset - notes earlier/later
|
||||
(hold Alt for smaller increment)=(hold Alt for smaller increment)
|
||||
Old offset=Old offset
|
||||
New offset=New offset
|
||||
Collecting sample=Collecting sample
|
||||
Standard deviation=Standard deviation
|
||||
|
||||
[ScreenSystemLayer]
|
||||
CreditsCardChanged=KARTE AUSGEWECHSELT
|
||||
CreditsCardChecking=KARTEN-ÜBERPRÜFUNG
|
||||
|
||||
@@ -1960,11 +1960,11 @@ AutoSync Song=AutoSync Song
|
||||
AutoSync Tempo=AutoSync Tempo
|
||||
Can't sync while playing a course.=Can't sync while playing a course.
|
||||
Sync changes reverted.=Sync changes reverted.
|
||||
Revert sync changes=Revert sync changes
|
||||
Current BPM - smaller/larger=Current BPM - smaller/larger
|
||||
Song offset - notes earlier/later=Song offset - notes earlier/later
|
||||
Machine offset - notes earlier/later=Machine offset - notes earlier/later
|
||||
(hold Alt for smaller increment)=(hold Alt for smaller increment)
|
||||
revert_sync_changes=Revert sync changes
|
||||
change_bpm=Current BPM - smaller/larger
|
||||
change_song_offset=Song offset - notes earlier/later
|
||||
change_machine_offset=Machine offset - notes earlier/later
|
||||
hold_alt=(hold Alt for smaller increment)
|
||||
Old offset=Old offset
|
||||
New offset=New offset
|
||||
Collecting sample=Collecting sample
|
||||
|
||||
@@ -1917,11 +1917,11 @@ AutoSync Song=Autosinc. canción
|
||||
AutoSync Tempo=Autosinc. ritmo
|
||||
Can't sync while playing a course.=No se puede sinc. en un curso.
|
||||
Sync changes reverted.=Cambios de sinc. descartados.
|
||||
Revert sync changes=Descartar cambios de sinc.
|
||||
Current BPM - smaller/larger=BPM actual - mayor/superior
|
||||
Song offset - notes earlier/later=Ajuste de canción - notas antes/después
|
||||
Machine offset - notes earlier/later=Ajuste de máquina - notas antes/después
|
||||
(hold Alt for smaller increment)=(mantén Alt para incrementos menores)
|
||||
revert_sync_changes=Descartar cambios de sinc.
|
||||
change_bpm=BPM actual - mayor/superior
|
||||
change_song_offset=Ajuste de canción - notas antes/después
|
||||
change_machine_offset=Ajuste de máquina - notas antes/después
|
||||
hold_alt=(mantén Alt para incrementos menores)
|
||||
Old offset=Ajuste anterior
|
||||
New offset=Ajueste nuevo
|
||||
Collecting sample=Recogiendo muestra
|
||||
|
||||
@@ -1930,21 +1930,6 @@ The profile on P%d card contains corrupt or tampered data.=The profile on P%d ca
|
||||
There is no machine profile on P%d card.=There is no machine profile on P%d card.
|
||||
|
||||
[ScreenSyncOverlay]
|
||||
AutoPlay=AutoPlay
|
||||
AutoPlayCPU=AutoPlayCPU
|
||||
AutoSync Machine=AutoSync Machine
|
||||
AutoSync Song=AutoSync Song
|
||||
AutoSync Tempo=AutoSync Tempo
|
||||
Can't sync while playing a course.=Can't sync while playing a course.
|
||||
Sync changes reverted.=Sync changes reverted.
|
||||
Revert sync changes=Revert sync changes
|
||||
Current BPM - smaller/larger=Current BPM - smaller/larger
|
||||
Song offset - notes earlier/later=Song offset - notes earlier/later
|
||||
Machine offset - notes earlier/later=Machine offset - notes earlier/later
|
||||
(hold Alt for smaller increment)=(hold Alt for smaller increment)
|
||||
Old offset=Old offset
|
||||
New offset=New offset
|
||||
Collecting sample=Collecting sample
|
||||
Standard deviation=Déviation standard
|
||||
|
||||
[ScreenSystemLayer]
|
||||
|
||||
@@ -2108,11 +2108,11 @@ AutoSync Song=AutoSync Song
|
||||
AutoSync Tempo=AutoSync Tempo
|
||||
Can't sync while playing a course.=コースプレイ中は自動調整できません。
|
||||
Sync changes reverted.=自動調整の結果を破棄しました。
|
||||
Revert sync changes=調整結果の破棄
|
||||
Current BPM - smaller/larger=現在のBPMを下げる/上げる
|
||||
Song offset - notes earlier/later=譜面のオフセットを減らす/増やす
|
||||
Machine offset - notes earlier/later=筐体オフセットを減らす/増やす
|
||||
(hold Alt for smaller increment)=(Altを押しながらだと細かい調整が可能です)
|
||||
revert_sync_changes=調整結果の破棄
|
||||
change_bpm=現在のBPMを下げる/上げる
|
||||
change_song_offset=譜面のオフセットを減らす/増やす
|
||||
change_machine_offset=筐体オフセットを減らす/増やす
|
||||
hold_alt=(Altを押しながらだと細かい調整が可能です)
|
||||
Old offset=旧オフセット
|
||||
New offset=新オフセット
|
||||
Collecting sample=標本
|
||||
|
||||
@@ -1923,11 +1923,11 @@ AutoSync Song=AutoSync Nummer
|
||||
AutoSync Tempo=AutoSync Tempo
|
||||
Can't sync while playing a course.=Kan niet synchroniseren tijdens het spelen van een parkoers.
|
||||
Sync changes reverted.=Sync-veranderingen ongedaan gemaakt.
|
||||
Revert sync changes=Maak sync-veranderingen ongedaan
|
||||
Current BPM - smaller/larger=Huidige BPM - kleiner/groter
|
||||
Song offset - notes earlier/later=Nummer offset - noten eerder/later
|
||||
Machine offset - notes earlier/later=Machine offset - noten eerder/later
|
||||
(hold Alt for smaller increment)=(Hou Alt ingedrukt voor kleinere stappen)
|
||||
revert_sync_changes=Maak sync-veranderingen ongedaan
|
||||
change_bpm=Huidige BPM - kleiner/groter
|
||||
change_song_offset=Nummer offset - noten eerder/later
|
||||
change_machine_offset=Machine offset - noten eerder/later
|
||||
hold_alt=(Hou Alt ingedrukt voor kleinere stappen)
|
||||
Old offset=Oude offset
|
||||
New offset=Nieuwe offset
|
||||
Collecting sample=Sample wordt genomen
|
||||
|
||||
@@ -1906,11 +1906,11 @@ AutoSync Song=AutoSync. Piosenki
|
||||
AutoSync Tempo=AutoSync. Tempa
|
||||
Can't sync while playing a course.=Nie można synchronizować podczas maratonu.
|
||||
Sync changes reverted.=Przywrócono stare ustawienia synchronizacji.
|
||||
Revert sync changes=Przywróć stare ustawienia synchronizacji
|
||||
Current BPM - smaller/larger=Bieżące BPM - większe/mniejsze
|
||||
Song offset - notes earlier/later=Offset Piosenki - strzałki wcześniej/później
|
||||
Machine offset - notes earlier/later=Offset Maszyny - strzałki wcześniej/później
|
||||
(hold Alt for smaller increment)=(przytrzymaj Alt by zmniejszyć przyrost wartości)
|
||||
revert_sync_changes=Przywróć stare ustawienia synchronizacji
|
||||
change_bpm=Bieżące BPM - większe/mniejsze
|
||||
change_song_offset=Offset Piosenki - strzałki wcześniej/później
|
||||
change_machine_offset=Offset Maszyny - strzałki wcześniej/później
|
||||
hold_alt=(przytrzymaj Alt by zmniejszyć przyrost wartości)
|
||||
Old offset=Stary offset
|
||||
New offset=Nowy offset
|
||||
Collecting sample=Zbierane próbki
|
||||
|
||||
@@ -1965,11 +1965,11 @@ AutoSync Song=自動同歩歌曲
|
||||
AutoSync Tempo=自動同歩節奏
|
||||
Can't sync while playing a course.=遊玩組曲期間不可同歩
|
||||
Sync changes reverted.=已恢復同歩變更
|
||||
Revert sync changes=恢復同歩變更
|
||||
Current BPM - smaller/larger=現在的BPM已轉移
|
||||
Song offset - notes earlier/later=歌曲偏移植(offset)已轉移
|
||||
Machine offset - notes earlier/later=整體偏移植(offset)已轉移
|
||||
(hold Alt for smaller increment)=(按Alt鍵緩和數値差距)
|
||||
revert_sync_changes=恢復同歩變更
|
||||
change_bpm=現在的BPM已轉移
|
||||
change_song_offset=歌曲偏移植(offset)已轉移
|
||||
change_machine_offset=整體偏移植(offset)已轉移
|
||||
hold_alt=(按Alt鍵緩和數値差距)
|
||||
Old offset=舊偏移値(offset)
|
||||
New offset=新偏移値(offset)
|
||||
Collecting sample=採樣
|
||||
|
||||
+17
-65
@@ -18,53 +18,12 @@ static bool IsGameplay()
|
||||
|
||||
REGISTER_SCREEN_CLASS( ScreenSyncOverlay );
|
||||
|
||||
static LocalizedString REVERT_SYNC_CHANGES ( "ScreenSyncOverlay", "Revert sync changes" );
|
||||
static LocalizedString CURRENT_BPM ( "ScreenSyncOverlay", "Current BPM - smaller/larger" );
|
||||
static LocalizedString SONG_OFFSET ( "ScreenSyncOverlay", "Song offset - notes earlier/later" );
|
||||
static LocalizedString MACHINE_OFFSET ( "ScreenSyncOverlay", "Machine offset - notes earlier/later" );
|
||||
static LocalizedString HOLD_ALT ( "ScreenSyncOverlay", "(hold Alt for smaller increment)" );
|
||||
|
||||
void ScreenSyncOverlay::Init()
|
||||
{
|
||||
Screen::Init();
|
||||
|
||||
m_quad.SetDiffuse( RageColor(0,0,0,0) );
|
||||
m_quad.SetHorizAlign(align_right);
|
||||
m_quad.SetVertAlign(align_top);
|
||||
m_quad.SetXY(SCREEN_WIDTH, SCREEN_TOP);
|
||||
this->AddChild( &m_quad );
|
||||
|
||||
m_textHelp.LoadFromFont( THEME->GetPathF("Common", "normal") );
|
||||
m_textHelp.SetHorizAlign( align_left );
|
||||
m_textHelp.SetVertAlign(align_top);
|
||||
m_textHelp.SetDiffuseAlpha( 0 );
|
||||
m_textHelp.SetShadowLength( 2 );
|
||||
m_textHelp.SetText(
|
||||
REVERT_SYNC_CHANGES.GetValue()+":\n"
|
||||
" F4\n" +
|
||||
CURRENT_BPM.GetValue()+":\n"
|
||||
" F9/F10\n" +
|
||||
CURRENT_BPM.GetValue()+":\n"
|
||||
" F11/F12\n" +
|
||||
MACHINE_OFFSET.GetValue()+":\n"
|
||||
" Shift + F11/F12\n" +
|
||||
HOLD_ALT.GetValue() );
|
||||
m_textHelp.SetXY(SCREEN_WIDTH - m_textHelp.GetZoomedWidth() - 10,
|
||||
SCREEN_TOP + 10);
|
||||
this->AddChild( &m_textHelp );
|
||||
|
||||
m_quad.ZoomToWidth( m_textHelp.GetZoomedWidth()+20 );
|
||||
m_quad.ZoomToHeight( m_textHelp.GetZoomedHeight()+20 );
|
||||
|
||||
m_textStatus.SetName( "Status" );
|
||||
m_textStatus.LoadFromFont( THEME->GetPathF(m_sName, "status") );
|
||||
ActorUtil::LoadAllCommandsAndOnCommand( m_textStatus, m_sName );
|
||||
this->AddChild( &m_textStatus );
|
||||
|
||||
m_textAdjustments.SetName( "Adjustments" );
|
||||
m_textAdjustments.LoadFromFont( THEME->GetPathF(m_sName,"Adjustments") );
|
||||
ActorUtil::LoadAllCommandsAndOnCommand( m_textAdjustments, m_sName );
|
||||
this->AddChild( &m_textAdjustments );
|
||||
m_overlay.Load(THEME->GetPathB(m_sName, "overlay"));
|
||||
AddChild(m_overlay);
|
||||
|
||||
Update( 0 );
|
||||
}
|
||||
@@ -133,13 +92,16 @@ void ScreenSyncOverlay::UpdateText()
|
||||
AdjustSync::GetSyncChangeTextSong( vs );
|
||||
}
|
||||
|
||||
m_textStatus.SetText( join("\n",vs) );
|
||||
Message set_status("SetStatus");
|
||||
set_status.SetParam("text", join("\n",vs));
|
||||
m_overlay->HandleMessage(set_status);
|
||||
|
||||
|
||||
// Update SyncInfo
|
||||
bool bVisible = GAMESTATE->m_SongOptions.GetCurrent().m_AutosyncType != AutosyncType_Off;
|
||||
m_textAdjustments.SetVisible( bVisible );
|
||||
if( bVisible )
|
||||
bool visible= GAMESTATE->m_SongOptions.GetCurrent().m_AutosyncType != AutosyncType_Off;
|
||||
Message set_adjustments("SetAdjustments");
|
||||
set_adjustments.SetParam("visible", visible);
|
||||
if(visible)
|
||||
{
|
||||
float fNew = PREFSMAN->m_fGlobalOffsetSeconds;
|
||||
float fOld = AdjustSync::s_fGlobalOffsetSecondsOriginal;
|
||||
@@ -149,8 +111,13 @@ void ScreenSyncOverlay::UpdateText()
|
||||
s += NEW_OFFSET.GetValue() + ssprintf( ": %0.3f\n", fNew );
|
||||
s += STANDARD_DEVIATION.GetValue() + ssprintf( ": %0.3f\n", fStdDev );
|
||||
s += COLLECTING_SAMPLE.GetValue() + ssprintf( ": %d / %d", AdjustSync::s_iAutosyncOffsetSample+1, AdjustSync::OFFSET_SAMPLE_COUNT );
|
||||
m_textAdjustments.SetText( s );
|
||||
set_adjustments.SetParam("text", s);
|
||||
}
|
||||
else
|
||||
{
|
||||
set_adjustments.SetParam("text", RString(""));
|
||||
}
|
||||
m_overlay->HandleMessage(set_adjustments);
|
||||
}
|
||||
|
||||
static LocalizedString CANT_SYNC_WHILE_PLAYING_A_COURSE ("ScreenSyncOverlay","Can't sync while playing a course.");
|
||||
@@ -322,27 +289,12 @@ bool ScreenSyncOverlay::Input( const InputEventPlus &input )
|
||||
|
||||
void ScreenSyncOverlay::ShowHelp()
|
||||
{
|
||||
m_quad.StopTweening();
|
||||
m_quad.BeginTweening( 0.3f, TWEEN_LINEAR );
|
||||
m_quad.SetDiffuseAlpha( 0.5f );
|
||||
|
||||
m_textHelp.StopTweening();
|
||||
m_textHelp.BeginTweening( 0.3f, TWEEN_LINEAR );
|
||||
m_textHelp.SetDiffuseAlpha( 1 );
|
||||
|
||||
m_quad.Sleep( 4 );
|
||||
m_quad.BeginTweening( 0.3f, TWEEN_LINEAR );
|
||||
m_quad.SetDiffuseAlpha( 0 );
|
||||
|
||||
m_textHelp.Sleep( 4 );
|
||||
m_textHelp.BeginTweening( 0.3f, TWEEN_LINEAR );
|
||||
m_textHelp.SetDiffuseAlpha( 0 );
|
||||
m_overlay->PlayCommand("Show");
|
||||
}
|
||||
|
||||
void ScreenSyncOverlay::HideHelp()
|
||||
{
|
||||
m_quad.FinishTweening();
|
||||
m_textHelp.FinishTweening();
|
||||
m_overlay->PlayCommand("Hide");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
#define ScreenSyncOverlay_H
|
||||
|
||||
#include "Screen.h"
|
||||
#include "BitmapText.h"
|
||||
#include "Quad.h"
|
||||
#include "AutoActor.h"
|
||||
/** @brief Credits and statistics drawn on top of everything else. */
|
||||
class ScreenSyncOverlay : public Screen
|
||||
{
|
||||
@@ -20,10 +19,7 @@ private:
|
||||
void ShowHelp();
|
||||
void HideHelp();
|
||||
|
||||
Quad m_quad;
|
||||
BitmapText m_textHelp;
|
||||
BitmapText m_textStatus;
|
||||
BitmapText m_textAdjustments;
|
||||
AutoActor m_overlay;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user