Basic style fixes.
This commit is contained in:
parent
7a9f9ab744
commit
5e198c6730
@ -33,9 +33,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/****************************
|
// Better error reporting for Lua
|
||||||
* Better error reporting for Lua
|
|
||||||
**/
|
|
||||||
static int tolua_do_error(lua_State* L, const char * a_pMsg, tolua_Error * a_pToLuaError)
|
static int tolua_do_error(lua_State* L, const char * a_pMsg, tolua_Error * a_pToLuaError)
|
||||||
{
|
{
|
||||||
// Retrieve current function name
|
// Retrieve current function name
|
||||||
@ -81,10 +79,7 @@ static int lua_do_error(lua_State* L, const char * a_pFormat, ...)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/****************************
|
// Lua bound functions with special return types
|
||||||
* Lua bound functions with special return types
|
|
||||||
**/
|
|
||||||
|
|
||||||
static int tolua_StringSplit(lua_State * tolua_S)
|
static int tolua_StringSplit(lua_State * tolua_S)
|
||||||
{
|
{
|
||||||
cLuaState LuaState(tolua_S);
|
cLuaState LuaState(tolua_S);
|
||||||
@ -557,9 +552,11 @@ static int tolua_DoWithXYZ(lua_State* tolua_S)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template< class Ty1,
|
template<
|
||||||
|
class Ty1,
|
||||||
class Ty2,
|
class Ty2,
|
||||||
bool (Ty1::*Func1)(int, int, cItemCallback<Ty2> &) >
|
bool (Ty1::*Func1)(int, int, cItemCallback<Ty2> &)
|
||||||
|
>
|
||||||
static int tolua_ForEachInChunk(lua_State * tolua_S)
|
static int tolua_ForEachInChunk(lua_State * tolua_S)
|
||||||
{
|
{
|
||||||
int NumArgs = lua_gettop(tolua_S) - 1; /* This includes 'self' */
|
int NumArgs = lua_gettop(tolua_S) - 1; /* This includes 'self' */
|
||||||
@ -651,9 +648,11 @@ static int tolua_ForEachInChunk(lua_State* tolua_S)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template< class Ty1,
|
template<
|
||||||
|
class Ty1,
|
||||||
class Ty2,
|
class Ty2,
|
||||||
bool (Ty1::*Func1)(cItemCallback<Ty2> &) >
|
bool (Ty1::*Func1)(cItemCallback<Ty2> &)
|
||||||
|
>
|
||||||
static int tolua_ForEach(lua_State * tolua_S)
|
static int tolua_ForEach(lua_State * tolua_S)
|
||||||
{
|
{
|
||||||
int NumArgs = lua_gettop(tolua_S) - 1; /* This includes 'self' */
|
int NumArgs = lua_gettop(tolua_S) - 1; /* This includes 'self' */
|
||||||
|
@ -42,10 +42,7 @@ public:
|
|||||||
// Called each tick
|
// Called each tick
|
||||||
virtual void Tick(float a_Dt) = 0;
|
virtual void Tick(float a_Dt) = 0;
|
||||||
|
|
||||||
/**
|
/** Calls the specified hook with the params given. Returns the bool that the hook callback returns.*/
|
||||||
* On all these functions, return true if you want to override default behavior and not call other plugins on that callback.
|
|
||||||
* You can also return false, so default behavior is used.
|
|
||||||
**/
|
|
||||||
virtual bool OnBlockSpread (cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ, eSpreadSource a_Source) = 0;
|
virtual bool OnBlockSpread (cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ, eSpreadSource a_Source) = 0;
|
||||||
virtual bool OnBlockToPickups (cWorld * a_World, cEntity * a_Digger, int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, cItems & a_Pickups) = 0;
|
virtual bool OnBlockToPickups (cWorld * a_World, cEntity * a_Digger, int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, cItems & a_Pickups) = 0;
|
||||||
virtual bool OnChat (cPlayer * a_Player, AString & a_Message) = 0;
|
virtual bool OnChat (cPlayer * a_Player, AString & a_Message) = 0;
|
||||||
|
@ -51,9 +51,11 @@ class cBlockEntityWithItems;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
class cPluginManager // tolua_export
|
// tolua_begin
|
||||||
{ // tolua_export
|
class cPluginManager
|
||||||
public: // tolua_export
|
{
|
||||||
|
public:
|
||||||
|
// tolua_end
|
||||||
|
|
||||||
// Called each tick
|
// Called each tick
|
||||||
virtual void Tick(float a_Dt);
|
virtual void Tick(float a_Dt);
|
||||||
@ -164,8 +166,10 @@ public: // tolua_export
|
|||||||
cPlugin * GetPlugin( const AString & a_Plugin ) const; // tolua_export
|
cPlugin * GetPlugin( const AString & a_Plugin ) const; // tolua_export
|
||||||
const PluginMap & GetAllPlugins() const; // >> EXPORTED IN MANUALBINDINGS <<
|
const PluginMap & GetAllPlugins() const; // >> EXPORTED IN MANUALBINDINGS <<
|
||||||
|
|
||||||
void FindPlugins(); // tolua_export
|
// tolua_begin
|
||||||
void ReloadPlugins(); // tolua_export
|
void FindPlugins();
|
||||||
|
void ReloadPlugins();
|
||||||
|
// tolua_end
|
||||||
|
|
||||||
/** Adds the plugin to the list of plugins called for the specified hook type. Handles multiple adds as a single add */
|
/** Adds the plugin to the list of plugins called for the specified hook type. Handles multiple adds as a single add */
|
||||||
void AddHook(cPlugin * a_Plugin, int a_HookType);
|
void AddHook(cPlugin * a_Plugin, int a_HookType);
|
||||||
|
@ -66,12 +66,12 @@ std::pair< AString, AString > cWebPlugin::GetTabNameForRequest(const HTTPRequest
|
|||||||
|
|
||||||
if (Split.size() > 1)
|
if (Split.size() > 1)
|
||||||
{
|
{
|
||||||
sWebPluginTab* Tab = 0;
|
sWebPluginTab * Tab = NULL;
|
||||||
if (Split.size() > 2) // If we got the tab name, show that page
|
if (Split.size() > 2) // If we got the tab name, show that page
|
||||||
{
|
{
|
||||||
for( TabList::iterator itr = GetTabs().begin(); itr != GetTabs().end(); ++itr )
|
for( TabList::iterator itr = GetTabs().begin(); itr != GetTabs().end(); ++itr )
|
||||||
{
|
{
|
||||||
if( (*itr)->SafeTitle.compare( Split[2] ) == 0 ) // This is the one! Rawr
|
if ((*itr)->SafeTitle.compare(Split[2]) == 0) // This is the one!
|
||||||
{
|
{
|
||||||
Tab = *itr;
|
Tab = *itr;
|
||||||
break;
|
break;
|
||||||
@ -84,7 +84,7 @@ std::pair< AString, AString > cWebPlugin::GetTabNameForRequest(const HTTPRequest
|
|||||||
Tab = *GetTabs().begin();
|
Tab = *GetTabs().begin();
|
||||||
}
|
}
|
||||||
|
|
||||||
if( Tab )
|
if (Tab != NULL)
|
||||||
{
|
{
|
||||||
Names.first = Tab->Title;
|
Names.first = Tab->Title;
|
||||||
Names.second = Tab->SafeTitle;
|
Names.second = Tab->SafeTitle;
|
||||||
@ -111,3 +111,7 @@ AString cWebPlugin::SafeString( const AString & a_String )
|
|||||||
}
|
}
|
||||||
return RetVal;
|
return RetVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user