Add a DISABLE_DREAMLUAU define, for disabling dreamluau at compile-time (#89359)

## About The Pull Request

this adds a new define, `DISABLE_DREAMLUAU` (commented out by default),
which does... exactly what it says on the tin. it fully disables any
dreamluau-related code (the "Open Lua Editor" admin verb is left in,
albeit just giving the user a warning saying Lua is disabled, just so
there's no confusion about the verb itself being missing)

when compiling with OpenDream outside of CI (so dreamluau code will
still be linted), `DISABLE_DREAMLUAU` will be defined by default, tho.

## Why It's Good For The Game

makes OpenDream testing easier

## Changelog

no user-facing changes. or even code changes for most cases.
This commit is contained in:
Lucy
2025-02-05 20:27:55 -05:00
committed by GitHub
parent 0261ad2997
commit 348413a8a6
14 changed files with 42 additions and 0 deletions
@@ -103,12 +103,14 @@ GLOBAL_VAR_INIT(total_runtimes_skipped, 0)
// The proceeding mess will almost definitely break if error messages are ever changed
var/list/splitlines = splittext(E.desc, "\n")
var/list/desclines = list()
#ifndef DISABLE_DREAMLUAU
var/list/state_stack = GLOB.lua_state_stack
var/is_lua_call = length(state_stack)
var/list/lua_stacks = list()
if(is_lua_call)
for(var/level in 1 to state_stack.len)
lua_stacks += list(splittext(DREAMLUAU_GET_TRACEBACK(level), "\n"))
#endif
if(LAZYLEN(splitlines) > ERROR_USEFUL_LEN) // If there aren't at least three lines, there's no info
for(var/line in splitlines)
if(LAZYLEN(line) < 3 || findtext(line, "source file:") || findtext(line, "usr.loc:"))
@@ -124,8 +126,10 @@ GLOBAL_VAR_INIT(total_runtimes_skipped, 0)
desclines += line
if(usrinfo) //If this info isn't null, it hasn't been added yet
desclines.Add(usrinfo)
#ifndef DISABLE_DREAMLUAU
if(is_lua_call)
SSlua.log_involved_runtime(E, desclines, lua_stacks)
#endif
if(silencing)
desclines += " (This error will now be silenced for [DisplayTimeText(configured_error_silence_time)])"
if(GLOB.error_cache)