Skip to content

Commit

Permalink
Add lua functions to set judge
Browse files Browse the repository at this point in the history
  • Loading branch information
nico-abram committed Dec 21, 2017
1 parent 0c58a6a commit 11cbd6e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/ScreenOptionsMasterPrefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,16 @@ static int GetTimingDifficulty()
iTimingDifficulty++; // TimingDifficulty returns an index
return iTimingDifficulty;
}
LuaFunction( GetTimingDifficulty, GetTimingDifficulty() );
LuaFunction(GetTimingDifficulty, GetTimingDifficulty());
static int SetTimingDifficulty(float judge)
{
int iTimingDifficulty = judge;
auto opt = ConfOption::Find("TimingWindowScale");
IPreference *pPref = IPreference::GetPreferenceByName(opt->m_sPrefName);
pPref->FromString(ToString(judge));
return 1;
}
LuaFunction(SetTimingDifficulty, SetTimingDifficulty(FArg(1)))
static int GetLifeDifficulty()
{
int iLifeDifficulty = 0;
Expand Down

0 comments on commit 11cbd6e

Please sign in to comment.