mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-07 17:52:15 -10:00
This gives every document their own environment instead of using the global environment. Previously it was necessary to store variables in the global namespace since otherwise they could not be accessed by event listeners. This creates a separate environment table for every document so that all <script> blocks and event handlers share the same "global" environment.
29 lines
682 B
C++
29 lines
682 B
C++
#pragma once
|
|
|
|
#include "globalincs/pstypes.h"
|
|
|
|
// Our Assert conflicts with the definitions inside libRocket
|
|
#pragma push_macro("Assert")
|
|
#undef Assert
|
|
|
|
#include <Rocket/Core/Element.h>
|
|
#include <Rocket/Core/Lua/LuaSystemInterface.h>
|
|
|
|
#pragma pop_macro("Assert")
|
|
|
|
namespace scpui {
|
|
|
|
class RocketLuaSystemInterface : public Rocket::Core::Lua::LuaSystemInterface {
|
|
public:
|
|
RocketLuaSystemInterface();
|
|
~RocketLuaSystemInterface() override;
|
|
|
|
void PrepareFunction(lua_State* L, int funcIdx, Rocket::Core::Element* context) override;
|
|
|
|
void ReportError(lua_State* L, const Rocket::Core::String& location) override;
|
|
|
|
int ErrorHandler(lua_State* L) override;
|
|
};
|
|
|
|
} // namespace scpui
|