Пример #1
0
/**
 * @brief Gets the slot name and size of an outfit.
 *
 * @usage slot_name, slot_size = o:slot() -- Gets the slot information of an outfit
 *
 *    @luaparam o Outfit to get information of.
 *    @luareturn The name and the size in human readable strings.
 * @luafunc slot( o )
 */
static int outfitL_slot( lua_State *L )
{
   Outfit *o = luaL_validoutfit(L,1);
   lua_pushstring(L, outfit_slotName(o));
   lua_pushstring(L, outfit_slotSize(o));
   return 2;
}
Пример #2
0
/**
 * @brief Gets the store icon for an outfit.
 *
 * @usage ico = o:icon() -- Gets the shop icon for an outfit
 *
 *    @luaparam o Outfit to get information of.
 *    @luareturn The texture containing the icon of the outfit.
 * @luafunc icon( o )
 */
static int outfitL_icon( lua_State *L )
{
   LuaTex lt;
   Outfit *o = luaL_validoutfit(L,1);
   lt.tex = gl_dupTexture( o->gfx_store );
   lua_pushtex( L, lt );
   return 1;
}
Пример #3
0
/**
 * @brief Gets the slot name, size and property of an outfit.
 *
 * @usage slot_name, slot_size, slot_prop = o:slot() -- Gets an outfit's slot info
 *
 *    @luaparam o Outfit to get information of.
 *    @luareturn The name, size and property in human readable strings.
 * @luafunc slot( o )
 */
static int outfitL_slot( lua_State *L )
{
   Outfit *o = luaL_validoutfit(L,1);
   lua_pushstring(L, outfit_slotName(o));
   lua_pushstring(L, outfit_slotSize(o));
   lua_pushstring(L, sp_display( o->slot.spid ));

   return 3;
}
Пример #4
0
/**
 * @brief Gets the name of the outfit's outfit.
 *
 * @usage outfitname = s:name()
 *
 *    @luaparam s Outfit to get outfit name.
 *    @luareturn The name of the outfit's outfit.
 * @luafunc name( s )
 */
static int outfitL_name( lua_State *L )
{
   Outfit *o;

   /* Get the outfit. */
   o  = luaL_validoutfit(L,1);

   /** Return the outfit name. */
   lua_pushstring(L, o->name);
   return 1;
}
Пример #5
0
/**
 * @brief Gets the price of an outfit.
 *
 * @usage price = o:price()
 *
 *    @luaparam o Outfit to get the price of.
 *    @luareturn The price, in credits.
 * @luafunc price( o )
 */
static int outfitL_price( lua_State *L )
{
   Outfit *o = luaL_validoutfit(L,1);
   lua_pushnumber(L, o->price);
   return 1;
}
Пример #6
0
/**
 * @brief Gets the store icon for an outfit.
 *
 * @usage ico = o:icon() -- Gets the shop icon for an outfit
 *
 *    @luaparam o Outfit to get information of.
 *    @luareturn The texture containing the icon of the outfit.
 * @luafunc icon( o )
 */
static int outfitL_icon( lua_State *L )
{
   Outfit *o = luaL_validoutfit(L,1);
   lua_pushtex( L, gl_dupTexture( o->gfx_store ) );
   return 1;
}
Пример #7
0
/**
 * @brief Gets the cpu usage of an outfit.
 *
 * @usage print( o:cpu() ) -- Prints the cpu usage of an outfit
 *
 *    @luaparam o Outfit to get information of.
 *    @luareturn The amount of cpu the outfit uses.
 * @luafunc cpu( o )
 */
static int outfitL_cpu( lua_State *L )
{
   Outfit *o = luaL_validoutfit(L,1);
   lua_pushnumber(L, outfit_cpu(o));
   return 1;
}
Пример #8
0
/**
 * @brief Gets the broad type of an outfit.
 *
 * This name is more generic and vague than type().
 *
 * @usage print( o:typeBroad() ) -- Prints the broad type of the outfit
 *
 *    @luaparam o Outfit to get information of.
 *    @luareturn The name of the outfit broad type.
 * @luafunc typeBroad( o )
 */
static int outfitL_typeBroad( lua_State *L )
{
   Outfit *o = luaL_validoutfit(L,1);
   lua_pushstring(L, outfit_getTypeBroad(o));
   return 1;
}