Added metrics for setting the screens Edit Mode uses for setting mods. Added functions for apply ModsLevel_Preferred to the other levels.

This commit is contained in:
Kyzentun
2014-12-09 21:59:01 -07:00
parent 89ed68f86d
commit c9a17dc48e
7 changed files with 40 additions and 7 deletions
+5
View File
@@ -8,7 +8,12 @@ ________________________________________________________________________________
----------
* [EditMode] Play whole song and play from current beat will now play until
either the music or the notes end, whichever is greater. [kyzentun]
The screens used for setting the options used to play the screen and for
adding attacks can be set through the "OptionsScreen" and "SetModScreen"
metrics in the ScreenEdit section.
* [GameState] ApplyPreferredSongOptionsToOtherLevels function added. [kyzentun]
* [Player] "ComboBreakOnImmediateHoldLetGo" theme metric added. [sillybear]
* [PlayerState] ApplyPreferredOptionsToOtherLevels function added. [kyzentun]
2014/12/03
----------
+2
View File
@@ -748,6 +748,7 @@
<Function name='AnyPlayerHasRankingFeats'/>
<Function name='ApplyGameCommand'/>
<Function name='ApplyPreferredModifiers'/>
<Function name='ApplyPreferredSongOptionsToOtherLevels'/>
<Function name='ApplyStageModifiers'/>
<Function name='ClearStageModifiersIllegalForCourse'/>
<Function name='CurrentOptionsDisqualifyPlayer'/>
@@ -1162,6 +1163,7 @@
<Function name='SetScore'/>
</Class>
<Class name='PlayerState'>
<Function name='ApplyPreferredOptionsToOtherLevels'/>
<Function name='GetCurrentPlayerOptions'/>
<Function name='GetHealthState'/>
<Function name='GetMultiPlayerNumber'/>
+6
View File
@@ -2257,6 +2257,9 @@ save yourself some time, copy this for undocumented things:
<Function name='ApplyPreferredModifiers' return='void' arguments='PlayerNumber pn, string mods'>
Applies the specified modifiers for the specified player's preferred modifier set.
</Function>
<Function name='ApplyPreferredSongOptionsToOtherLevels' return='void' arguments=''>
Applies the song options of ModsLevel_Preferred to the other ModsLevels.
</Function>
<Function name='ApplyStageModifiers' return='void' arguments='PlayerNumber pn, string mods'>
Applies the specified modifiers for the specified player for the current stage.
</Function>
@@ -3369,6 +3372,9 @@ save yourself some time, copy this for undocumented things:
</Function>
</Class>
<Class name='PlayerState'>
<Function name='ApplyPreferredOptionsToOtherLevels' return='void' arguments=''>
Applies the player options of ModsLevel_Preferred to the other ModsLevels.
</Function>
<Function name='GetCurrentPlayerOptions' return='PlayerOptions' arguments='' >
Returns the current PlayerOptions for this PlayerState.
</Function>
+3
View File
@@ -4007,6 +4007,9 @@ PlayRecordHelpX=SCREEN_LEFT+20
PlayRecordHelpY=SCREEN_BOTTOM-20
PlayRecordHelpOnCommand=halign,0;valign,0;shadowlength,1
SetModScreen="ScreenPlayerOptions"
OptionsScreen="ScreenEditOptions"
LoopOnChartEnd=true
CurrentBeatFormat="%s:\n %.3f\n"
+7
View File
@@ -2470,6 +2470,12 @@ public:
lua_pushstring(L, so.GetString());
return 1;
}
static int ApplyPreferredSongOptionsToOtherLevels(T* p, lua_State* L)
{
p->m_SongOptions.Assign(ModsLevel_Preferred,
p->m_SongOptions.Get(ModsLevel_Preferred));
return 0;
}
static int ApplyStageModifiers( T* p, lua_State *L )
{
p->ApplyStageModifiers( Enum::Check<PlayerNumber>(L, 1), SArg(2) );
@@ -2862,6 +2868,7 @@ public:
ADD_METHOD( GetSongOptions );
ADD_METHOD( GetSongOptionsObject );
ADD_METHOD( GetDefaultSongOptions );
ADD_METHOD( ApplyPreferredSongOptionsToOtherLevels );
ADD_METHOD( ApplyPreferredModifiers );
ADD_METHOD( ApplyStageModifiers );
ADD_METHOD( ClearStageModifiersIllegalForCourse );
+7
View File
@@ -213,6 +213,12 @@ const TimingData &PlayerState::GetDisplayedTiming() const
class LunaPlayerState: public Luna<PlayerState>
{
public:
static int ApplyPreferredOptionsToOtherLevels(T* p, lua_State* L)
{
p->m_PlayerOptions.Assign(ModsLevel_Preferred,
p->m_PlayerOptions.Get(ModsLevel_Preferred));
return 0;
}
DEFINE_METHOD( GetPlayerNumber, m_PlayerNumber );
static int GetSongPosition( T* p, lua_State *L )
{
@@ -260,6 +266,7 @@ public:
LunaPlayerState()
{
ADD_METHOD( ApplyPreferredOptionsToOtherLevels );
ADD_METHOD( GetPlayerNumber );
ADD_METHOD( GetMultiPlayerNumber );
ADD_METHOD( GetPlayerController );
+10 -7
View File
@@ -59,6 +59,9 @@ const float RECORD_HOLD_SECONDS = 0.3f;
#define PLAY_RECORD_HELP_TEXT THEME->GetString(m_sName,"PlayRecordHelpText")
#define EDIT_HELP_TEXT THEME->GetString(m_sName,"EditHelpText")
#define SET_MOD_SCREEN THEME->GetMetric("ScreenEdit", "SetModScreen")
#define OPTIONS_SCREEN THEME->GetMetric("ScreenEdit", "OptionsScreen")
AutoScreenMessage( SM_UpdateTextInfo );
AutoScreenMessage( SM_BackFromMainMenu );
AutoScreenMessage( SM_BackFromAreaMenu );
@@ -2722,7 +2725,7 @@ bool ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
g_fLastInsertAttackPositionSeconds = start;
g_fLastInsertAttackDurationSeconds = end - start;
toEdit.Assign( ModsLevel_Stage, po );
SCREENMAN->AddNewScreenToTop( "ScreenPlayerOptions", SM_BackFromInsertStepAttackPlayerOptions );
SCREENMAN->AddNewScreenToTop( SET_MOD_SCREEN, SM_BackFromInsertStepAttackPlayerOptions );
return true;
}
case EDIT_BUTTON_ADD_COURSE_MODS:
@@ -2758,7 +2761,7 @@ bool ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
g_fLastInsertAttackPositionSeconds = fStart;
g_fLastInsertAttackDurationSeconds = fEnd - fStart;
GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions.Assign( ModsLevel_Stage, po );
SCREENMAN->AddNewScreenToTop( "ScreenPlayerOptions", SM_BackFromInsertCourseAttackPlayerOptions );
SCREENMAN->AddNewScreenToTop( SET_MOD_SCREEN, SM_BackFromInsertCourseAttackPlayerOptions );
}
return true;
@@ -3739,7 +3742,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
int iDurationChoice = ScreenMiniMenu::s_viLastAnswers[0];
g_fLastInsertAttackDurationSeconds = StringToFloat( g_InsertTapAttack.rows[0].choices[iDurationChoice] );
SCREENMAN->AddNewScreenToTop( "ScreenPlayerOptions", SM_BackFromInsertTapAttackPlayerOptions );
SCREENMAN->AddNewScreenToTop( SET_MOD_SCREEN, SM_BackFromInsertTapAttackPlayerOptions );
}
else if( SM == SM_BackFromInsertTapAttackPlayerOptions )
{
@@ -3973,7 +3976,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
po.FromString(attacks[iAttack].sModifiers);
toEdit.Assign( ModsLevel_Preferred, po );
SCREENMAN->AddNewScreenToTop( "ScreenPlayerOptions", SM_BackFromInsertStepAttackPlayerOptions );
SCREENMAN->AddNewScreenToTop( SET_MOD_SCREEN, SM_BackFromInsertStepAttackPlayerOptions );
}
SetDirty(true);
}
@@ -4003,7 +4006,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
po.FromString( ce.attacks[iAttack].sModifiers );
GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions.Assign( ModsLevel_Preferred, po );
SCREENMAN->AddNewScreenToTop( "ScreenPlayerOptions", SM_BackFromInsertCourseAttackPlayerOptions );
SCREENMAN->AddNewScreenToTop( SET_MOD_SCREEN, SM_BackFromInsertCourseAttackPlayerOptions );
}
}
else if (SM == SM_BackFromInsertStepAttackPlayerOptions)
@@ -4646,7 +4649,7 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector<int> &iAns
ScreenPrompt::Prompt( SM_DoRevertFromDisk, REVERT_FROM_DISK.GetValue() + "\n\n" + DESTROY_ALL_UNSAVED_CHANGES.GetValue(), PROMPT_YES_NO, ANSWER_NO );
break;
case options:
SCREENMAN->AddNewScreenToTop( "ScreenEditOptions", SM_BackFromOptions );
SCREENMAN->AddNewScreenToTop( OPTIONS_SCREEN, SM_BackFromOptions );
break;
case edit_song_info:
{
@@ -5049,7 +5052,7 @@ void ScreenEdit::HandleAlterMenuChoice(AlterMenuChoice c, const vector<int> &iAn
po.FromString(attacks[iAttack].sModifiers);
toEdit.Assign( ModsLevel_Preferred, po );
SCREENMAN->AddNewScreenToTop( "ScreenPlayerOptions", SM_BackFromInsertStepAttackPlayerOptions );
SCREENMAN->AddNewScreenToTop( SET_MOD_SCREEN, SM_BackFromInsertStepAttackPlayerOptions );
SetDirty(true);
break;
}