Files
fs2open.github.com/code/scripting/api/objs/redalert.cpp
T
MjnMixael be00e257b8 Scripting functions required for SCPUI conversion of Red Alert (#4587)
* Scripting functions required for SCPUI conversion of Red Alert

* Correct documenation

* Address feedback

* Missed return

* Briefings
2022-08-28 13:18:12 -04:00

38 lines
966 B
C++

#include "redalert.h"
namespace scripting {
namespace api {
//**********HANDLE: red alert
ADE_OBJ(l_RedAlertStage, brief_stage, "red_alert_stage", "Red Alert stage handle");
ADE_VIRTVAR(Text, l_RedAlertStage, nullptr, "The briefing text of the stage", "red_alert_stage", "The text string")
{
brief_stage* current = nullptr;
if (!ade_get_args(L, "o", l_RedAlertStage.GetPtr(&current))) {
return ADE_RETURN_NIL;
}
if (ADE_SETTING_VAR) {
LuaError(L, "This property is read only.");
}
return ade_set_args(L, "s", current->text.c_str());
}
ADE_VIRTVAR(AudioFilename, l_RedAlertStage, nullptr, "The audio file of the stage", "red_alert_stage", "The audio file")
{
brief_stage* current = nullptr;
if (!ade_get_args(L, "o", l_RedAlertStage.GetPtr(&current))) {
return ADE_RETURN_NIL;
}
if (ADE_SETTING_VAR) {
LuaError(L, "This property is read only.");
}
return ade_set_args(L, "s", current->voice);
}
} // namespace api
} // namespace scripting