Added GetMainTitle to Song to bypass ShowNativeLanguage pref.

This commit is contained in:
Kyzentun Keeslala
2015-10-26 13:38:23 -06:00
parent 31b4066c3c
commit bd3da6a46d
4 changed files with 16 additions and 0 deletions
+1
View File
@@ -1568,6 +1568,7 @@
<Function name='GetLastBeat'/>
<Function name='GetLastSecond'/>
<Function name='GetLyricsPath'/>
<Function name='GetMainTitle'/>
<Function name='GetMusicPath'/>
<Function name='GetOneSteps'/>
<Function name='GetOrigin'/>
+4
View File
@@ -4586,6 +4586,10 @@ save yourself some time, copy this for undocumented things:
<Function name='GetLyricsPath' return='string' arguments=''>
Gets the path to the lyrics.
</Function>
<Function name='GetMainTitle' return='string' arguments=''>
GetDisplayMainTitle checks the ShowNativeLanguage pref and returns the transliterated title is that pref is false.<br />
GetMainTitle (this function) does not check that pref. Instead, it directly returns the title, exactly as it is in the #TITLE field in the simfile.
</Function>
<Function name='GetMusicPath' return='string' arguments=''>
Gets the path to the music file.
</Function>
+10
View File
@@ -1726,6 +1726,11 @@ RString Song::GetDisplayArtist() const
return m_sArtist;
}
RString Song::GetMainTitle() const
{
return m_sMainTitle;
}
RString Song::GetDisplayFullTitle() const
{
RString Title = GetDisplayMainTitle();
@@ -1955,6 +1960,10 @@ public:
{
lua_pushstring(L, p->GetDisplayMainTitle() ); return 1;
}
static int GetMainTitle(T* p, lua_State* L)
{
lua_pushstring(L, p->GetMainTitle()); return 1;
}
static int GetTranslitMainTitle( T* p, lua_State *L )
{
lua_pushstring(L, p->GetTranslitMainTitle() ); return 1;
@@ -2303,6 +2312,7 @@ public:
ADD_METHOD( GetDisplayFullTitle );
ADD_METHOD( GetTranslitFullTitle );
ADD_METHOD( GetDisplayMainTitle );
ADD_METHOD(GetMainTitle);
ADD_METHOD( GetTranslitMainTitle );
ADD_METHOD( GetDisplaySubTitle );
ADD_METHOD( GetTranslitSubTitle );
+1
View File
@@ -193,6 +193,7 @@ public:
RString GetDisplayMainTitle() const;
RString GetDisplaySubTitle() const;
RString GetDisplayArtist() const;
RString GetMainTitle() const;
/**
* @brief Retrieve the transliterated title, or the main title if there is no translit.