Skip to content

Commit

Permalink
make txt bannors ref better and remove ability to set from string
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Dec 6, 2018
1 parent 55c65ba commit ae71ed5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 30 deletions.
30 changes: 6 additions & 24 deletions src/TextBanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ TextBanner::TextBanner(const TextBanner& cpy)
}

void
TextBanner::SetFromString(const RString& sDisplayTitle,
const RString& sTranslitTitle,
const RString& sDisplaySubTitle,
const RString& sTranslitSubTitle,
const RString& sDisplayArtist,
const RString& sTranslitArtist)
TextBanner::SetFromString(const string& sDisplayTitle,
const string& sTranslitTitle,
const string& sDisplaySubTitle,
const string& sTranslitSubTitle,
const string& sDisplayArtist,
const string& sTranslitArtist)
{
ASSERT(m_bInitted);

Expand Down Expand Up @@ -110,28 +110,10 @@ class LunaTextBanner : public Luna<TextBanner>
p->SetFromSong(pSong);
COMMON_RETURN_SELF;
}
static int SetFromString(T* p, lua_State* L)
{
RString sDisplayTitle = SArg(1);
RString sTranslitTitle = SArg(2);
RString sDisplaySubTitle = SArg(3);
RString sTranslitSubTitle = SArg(4);
RString sDisplayArtist = SArg(5);
RString sTranslitArtist = SArg(6);
p->SetFromString(sDisplayTitle,
sTranslitTitle,
sDisplaySubTitle,
sTranslitSubTitle,
sDisplayArtist,
sTranslitArtist);
COMMON_RETURN_SELF;
}

LunaTextBanner()
{
ADD_METHOD(Load);
ADD_METHOD(SetFromSong);
ADD_METHOD(SetFromString);
}
};

Expand Down
12 changes: 6 additions & 6 deletions src/TextBanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ class TextBanner : public ActorFrame
void LoadFromNode(const XNode* pNode) override;
void Load(const RString& sMetricsGroup); // load metrics
void SetFromSong(const Song* pSong);
void SetFromString(const RString& sDisplayTitle,
const RString& sTranslitTitle,
const RString& sDisplaySubTitle,
const RString& sTranslitSubTitle,
const RString& sDisplayArtist,
const RString& sTranslitArtist);
void SetFromString(const string&sDisplayTitle,
const string&sTranslitTitle,
const string&sDisplaySubTitle,
const string&sTranslitSubTitle,
const string&sDisplayArtist,
const string&sTranslitArtist);

// Lua
void PushSelf(lua_State* L) override;
Expand Down

0 comments on commit ae71ed5

Please sign in to comment.