From e7917f0721e541d7c0426e11b4d0c253fddfd288 Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Wed, 26 May 2010 00:07:00 -0500 Subject: [PATCH] [Course] add GetCourseDir(), HasBackground(), IsAnEdit() Lua bindings. --- src/Course.cpp | 12 +++++++++--- src/Course.h | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Course.cpp b/src/Course.cpp index ec21170f4a..bca019a845 100644 --- a/src/Course.cpp +++ b/src/Course.cpp @@ -1066,6 +1066,7 @@ public: } static int GetBannerPath( T* p, lua_State *L ) { RString s = p->GetBannerPath(); if( s.empty() ) return 0; LuaHelpers::Push(L, s); return 1; } static int GetBackgroundPath( T* p, lua_State *L ) { RString s = p->GetBackgroundPath(); if( s.empty() ) return 0; LuaHelpers::Push(L, s); return 1; } + static int GetCourseDir( T* p, lua_State *L ) { lua_pushstring(L, p->m_sPath ); return 1; } static int GetGroupName( T* p, lua_State *L ) { lua_pushstring(L, p->m_sGroupName ); return 1; } static int IsAutogen( T* p, lua_State *L ) { lua_pushboolean(L, p->m_bIsAutogen ); return 1; } static int GetEstimatedNumStages( T* p, lua_State *L ) { lua_pushnumber(L, p->GetEstimatedNumStages() ); return 1; } @@ -1084,6 +1085,8 @@ public: DEFINE_METHOD( IsOni, IsOni() ) DEFINE_METHOD( GetGoalSeconds, m_fGoalSeconds ) static int HasBanner( T* p, lua_State *L ) { lua_pushboolean(L, p->HasBanner() ); return 1; } + static int HasBackground( T* p, lua_State *L ) { lua_pushboolean(L, p->HasBackground() ); return 1; } + DEFINE_METHOD( IsAnEdit, IsAnEdit() ) LunaCourse() { @@ -1097,15 +1100,18 @@ public: ADD_METHOD( GetAllTrails ); ADD_METHOD( GetBannerPath ); ADD_METHOD( GetBackgroundPath ); // sm-ssc addition + ADD_METHOD( GetCourseDir ); // sm-ssc addition ADD_METHOD( GetGroupName ); ADD_METHOD( IsAutogen ); ADD_METHOD( GetEstimatedNumStages ); ADD_METHOD( GetTotalSeconds ); ADD_METHOD( IsEndless ); - ADD_METHOD( IsNonstop ); // sm-ssc addition - ADD_METHOD( IsOni ); // sm-ssc addition + ADD_METHOD( IsNonstop ); // sm-ssc addition + ADD_METHOD( IsOni ); // sm-ssc addition ADD_METHOD( GetGoalSeconds ); - ADD_METHOD( HasBanner ); // sm-ssc addition + ADD_METHOD( HasBanner ); // sm-ssc addition + ADD_METHOD( HasBackground ); // sm-ssc addition + ADD_METHOD( IsAnEdit ); } }; diff --git a/src/Course.h b/src/Course.h index 19c4e2b655..26c77ac430 100644 --- a/src/Course.h +++ b/src/Course.h @@ -94,7 +94,7 @@ public: RString GetDisplayMainTitle() const; RString GetDisplaySubTitle() const; - /* Returns the transliterated titles, if any; otherwise returns the main titles. */ + // Returns the transliterated titles, if any; otherwise returns the main titles. RString GetTranslitMainTitle() const { return m_sMainTitleTranslit.size()? m_sMainTitleTranslit: m_sMainTitle; } RString GetTranslitSubTitle() const { return m_sSubTitleTranslit.size()? m_sSubTitleTranslit: m_sSubTitle; }