OpenTTD Source 20241224-master-gee860a5c8e
SquirrelStd Class Reference

By default we want to give a set of standard commands to a SQ script. More...

#include <squirrel_std.hpp>

Static Public Member Functions

static SQInteger min (HSQUIRRELVM vm)
 Get the lowest of two integers.
 
static SQInteger max (HSQUIRRELVM vm)
 Get the highest of two integers.
 
static SQInteger require (HSQUIRRELVM vm)
 Load another file on runtime.
 
static SQInteger notifyallexceptions (HSQUIRRELVM vm)
 Enable/disable stack trace showing for handled exceptions.
 

Detailed Description

By default we want to give a set of standard commands to a SQ script.

Most of them are easy wrappers around internal functions. Of course we could just as easy include things like the stdmath of SQ, but of those functions we are sure they work on all our supported targets.

Definition at line 26 of file squirrel_std.hpp.

Member Function Documentation

◆ max()

SQInteger SquirrelStd::max ( HSQUIRRELVM  vm)
static

Get the highest of two integers.

Definition at line 31 of file squirrel_std.cpp.

Referenced by squirrel_register_std().

◆ min()

SQInteger SquirrelStd::min ( HSQUIRRELVM  vm)
static

Get the lowest of two integers.

Definition at line 21 of file squirrel_std.cpp.

Referenced by squirrel_register_std().

◆ notifyallexceptions()

SQInteger SquirrelStd::notifyallexceptions ( HSQUIRRELVM  vm)
static

Enable/disable stack trace showing for handled exceptions.

Definition at line 75 of file squirrel_std.cpp.

Referenced by squirrel_register_global_std().

◆ require()

SQInteger SquirrelStd::require ( HSQUIRRELVM  vm)
static

Load another file on runtime.

Note
This is always loaded on the root-level, no matter where you call this.
The filename is always relative from the script it is called from. Absolute calls are NOT allowed!

Definition at line 41 of file squirrel_std.cpp.

References Debug, and Squirrel::LoadScript().

Referenced by squirrel_register_global_std().


The documentation for this class was generated from the following files: