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:
@@ -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 );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user