Skip to content
Snippets Groups Projects
Select Git revision
  • 8a15e9abc4b36a9c5af0e0f81c7aeea8096ee666
  • next default protected
  • personal-amalgamate
  • ogl-palette-update
  • rphys-update
  • overlay-fpcam
  • inputviewer-toggle
  • master
  • ogl-pal
  • trace
  • uncapped
  • personal
  • palette
  • shadernmus
  • missing-gcc-flags
  • g_findmap-lua
  • pictureformats
  • sprite-fof-plane-sorting-question-mark
  • opengl-skydome-fixes
  • patch-cache-refactor
  • video-refactor
  • SRB2_release_2.2.6
  • SRB2_release_2.2.5
  • SRB2_release_2.2.4
  • SRB2_release_2.2.3
  • SRB2_release_2.2.2
  • SRB2_release_2.2.1
  • SRB2_release_2.2.0
  • SRB2_release_2.1.25
  • SRB2_release_2.1.24
  • SRB2_release_2.1.23
  • SRB2_release_2.1.22
  • SRB2_release_2.1.21
  • SRB2_release_2.1.20
  • SRB2_release_2.1.19
  • SRB2_release_2.1.18
  • td-release-v1.0.0
  • SRB2_release_2.1.17
  • SRB2_release_2.1.16a
  • SRB2_release_2.1.16
  • SRB2_release_2.1.15
41 results

lua_consolelib.c

Blame
  • Forked from STJr / SRB2
    Source project has a limited visibility.
    lua_infolib.c 29.85 KiB
    // SONIC ROBO BLAST 2
    //-----------------------------------------------------------------------------
    // Copyright (C) 2012-2016 by John "JTE" Muniz.
    // Copyright (C) 2012-2016 by Sonic Team Junior.
    //
    // This program is free software distributed under the
    // terms of the GNU General Public License, version 2.
    // See the 'LICENSE' file for more details.
    //-----------------------------------------------------------------------------
    /// \file  lua_infolib.c
    /// \brief infotable editing library for Lua scripting
    
    #include "doomdef.h"
    #ifdef HAVE_BLUA
    #include "fastcmp.h"
    #include "info.h"
    #include "dehacked.h"
    #include "p_mobj.h"
    #include "p_local.h"
    #include "z_zone.h"
    
    #include "lua_script.h"
    #include "lua_libs.h"
    #include "lua_hud.h" // hud_running errors
    
    boolean LUA_CallAction(const char *action, mobj_t *actor);
    state_t *astate;
    
    enum sfxinfo_read {
    	sfxinfor_name = 0,
    	sfxinfor_singular,
    	sfxinfor_priority,
    	sfxinfor_flags, // "pitch"
    	sfxinfor_caption,
    	sfxinfor_skinsound
    };
    const char *const sfxinfo_ropt[] = {
    	"name",
    	"singular",
    	"priority",
    	"flags",
    	"caption",
    	"skinsound",
    	NULL};
    
    enum sfxinfo_write {
    	sfxinfow_singular = 0,
    	sfxinfow_priority,
    	sfxinfow_flags, // "pitch"
    	sfxinfow_caption
    };
    const char *const sfxinfo_wopt[] = {
    	"singular",
    	"priority",
    	"flags",
    	"caption",
    	NULL};
    
    //
    // Sprite Names
    //
    
    // push sprite name
    static int lib_getSprname(lua_State *L)
    {
    	UINT32 i;
    
    	lua_remove(L, 1); // don't care about sprnames[] dummy userdata.
    
    	if (lua_isnumber(L, 1))