Added lua bindings for playing sounds in SCREENMAN. Added input redirection functions to SCREENMAN for disabling non-lua screen input processing. Added OF_FALSE, OV_EOF, and OV_HOLE to error string list in RageSound for more understandable messages. Made sure RageSound doesn't delete null pointers. Updated changelog.

This commit is contained in:
Kyzentun Keeslala
2016-02-03 13:05:23 -07:00
parent cfca85c464
commit 55e161336a
10 changed files with 161 additions and 6 deletions
+33 -1
View File
@@ -2000,6 +2000,23 @@ void ScreenSelectMusic::OnConfirmSongDeletion()
m_pSongAwaitingDeletionConfirmation = NULL;
}
bool ScreenSelectMusic::can_open_options_list(PlayerNumber pn)
{
if(!USE_OPTIONS_LIST)
{
return false;
}
if(pn >= NUM_PLAYERS)
{
return false;
}
if(m_OptionsList[pn].IsOpened())
{
return false;
}
return true;
}
// lua start
#include "LuaBinding.h"
@@ -2013,13 +2030,28 @@ public:
p->GetMusicWheel()->PushSelf(L);
return 1;
}
static int OpenOptionsList( T* p, lua_State *L ) { PlayerNumber pn = Enum::Check<PlayerNumber>(L, 1); p->OpenOptionsList(pn); COMMON_RETURN_SELF; }
static int OpenOptionsList( T* p, lua_State *L )
{
PlayerNumber pn = Enum::Check<PlayerNumber>(L, 1);
if(p->can_open_options_list(pn))
{
p->OpenOptionsList(pn);
}
COMMON_RETURN_SELF;
}
static int CanOpenOptionsList( T* p, lua_State *L )
{
PlayerNumber pn = Enum::Check<PlayerNumber>(L, 1);
lua_pushboolean(L, p->can_open_options_list(pn));
return 1;
}
LunaScreenSelectMusic()
{
ADD_METHOD( GetGoToOptions );
ADD_METHOD( GetMusicWheel );
ADD_METHOD( OpenOptionsList );
ADD_METHOD( CanOpenOptionsList );
}
};