Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6623 for code/branches


Ignore:
Timestamp:
Mar 27, 2010, 5:48:34 PM (15 years ago)
Author:
rgrieder
Message:

The lua "print" function was previously stored in "debug" —> changed that to "original_print".
Please use logMessage(level, message)
or its shortcut cout(level, message)

Location:
code/branches/gamestate/data
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gamestate/data/gui/scripts/GameplayMenu.lua

    r6621 r6623  
    1818function P.GameplayThemeCombobox_changed(e)
    1919    -- theme
    20     debug("event: theme")
     20    logMessage(0, "event: theme")
    2121end
    2222
    2323function P.GameplayDifficultyEasyButton_clicked(e)
    2424    -- difficulty easy
    25     debug("event: easy")
     25    logMessage(0, "event: easy")
    2626end
    2727
    2828function P.GameplayDifficultyNormalButton_clicked(e)
    2929    -- difficulty normal
    30     debug("event: normal")
     30    logMessage(0, "event: normal")
    3131end
    3232
    3333function P.GameplayDifficultyHardButton_clicked(e)
    3434    -- difficulty hard
    35     debug("event: hard")
     35    logMessage(0, "event: hard")
    3636end
    3737
  • code/branches/gamestate/data/gui/scripts/GraphicsMenu.lua

    r6621 r6623  
    143143    if scrollbar_active == false then
    144144        -- brightness
    145         debug("event: brightness")
     145        logMessage(0, "event: brightness")
    146146    end
    147147end
     
    153153function P.GraphicsBrightnessScrollbar_ended(e)
    154154    -- brightness
    155     debug("event: brightness")
     155    logMessage(0, "event: brightness")
    156156    scrollbar_active = false
    157157end
  • code/branches/gamestate/data/gui/scripts/SettingsMenu.lua

    r6621 r6623  
    2525function P.SettingsResetSettingsButton_clicked(e)
    2626    -- reset settings
    27     debug("event: reset settings")
     27    logMessage(0, "event: reset settings")
    2828end
    2929
  • code/branches/gamestate/data/lua/LuaStateInit.lua

    r6432 r6623  
    11-- Note: luaState is a pointer to the LuaState instance that created this lua state
    22
    3 -- Save original print function in debug
    4 debug = print
    5 
    63-- Redirect print to the C++ print function
     4original_print = print
    75print = function(s)
    86  luaState:luaPrint(s)
     
    1311  luaState:luaLog(level, message)
    1412end
     13cout = logMessage
    1514
    1615-- Redirect dofile in order to load with the resource manager
    17 doFile = function(filename)
     16original_dofile = dofile
     17dofile = function(filename)
    1818  luaState:doFile(filename)
    1919  -- Required because the C++ function cannot return whatever might be on the stack
    2020  return LuaStateReturnValue -- C-injected global variable
    2121end
    22 original_dofile = dofile
    23 dofile = doFile
     22doFile = dofile
    2423
    2524-- Create includeFile function that preparses the file according
     
    3433-- The loaded modules are then stored with their names (where name has no .lua extension)
    3534-- Furthermore the ".lua" extension is appended to the moduleName parameter when looking for the file
    36 old_require = require
     35original_require = require
    3736require = function(moduleName)
    3837  if not luaState:fileExists(moduleName .. ".lua") then
     38    logMessage(2, "Warning: Lua function require() could not find file '" .. moduleName .. ".lua' ")
    3939    return nil
    4040  end
Note: See TracChangeset for help on using the changeset viewer.