mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-09 13:01:29 -10:00
The new gauge can be accessed by the scripting API with which a function can be set which will be called when this gauge is rendered. This can be used for exposing the HUD gauge positioning and RTT options to the scripting API without a lot of work needed for the script writer. There is currently only one rendering function implemented since this is only a proof of concept.
19 lines
422 B
C++
19 lines
422 B
C++
#pragma once
|
|
|
|
#include "globalincs/pstypes.h"
|
|
#include "hud/hud.h"
|
|
#include "scripting/lua/LuaFunction.h"
|
|
|
|
class HudGaugeScripting: public HudGauge {
|
|
luacpp::LuaFunction _renderFunction;
|
|
public:
|
|
HudGaugeScripting();
|
|
|
|
void render(float frametime) override;
|
|
|
|
void initName(SCP_string name);
|
|
|
|
const luacpp::LuaFunction& getRenderFunction() const;
|
|
void setRenderFunction(const luacpp::LuaFunction& renderFunction);
|
|
};
|