Added "display_stats" script function #113

This commit is contained in:
NovaRain
2017-11-06 10:16:02 +08:00
parent bc38a02508
commit 9c1d439153
3 changed files with 23 additions and 12 deletions
@@ -19,6 +19,7 @@
#include "..\..\..\FalloutEngine\Fallout2.h"
#include "..\..\..\InputFuncs.h"
#include "..\..\BarBoxes.h"
#include "..\..\LoadGameHook.h"
#include "..\..\ScriptExtender.h"
#include "..\OpcodeContext.h"
@@ -449,5 +450,12 @@ void sf_set_cursor_mode(OpcodeContext& ctx) {
fo::func::gmouse_3d_set_mode(ctx.arg(0).asInt());
}
void sf_display_stats(OpcodeContext& ctx) {
// calling the function outside of inventory screen will crash the game
if (GetLoopFlags() & INVENTORY) {
__asm call fo::funcoffs::display_stats_
}
}
}
}
@@ -87,5 +87,7 @@ void sf_get_cursor_mode(OpcodeContext&);
void sf_set_cursor_mode(OpcodeContext&);
void sf_display_stats(OpcodeContext&);
}
}
@@ -78,6 +78,7 @@ static const SfallMetarule* currentMetarule;
static const SfallMetarule metarules[] = {
{"car_gas_amount", sf_car_gas_amount, 0, 0},
{"critter_inven_obj2", sf_critter_inven_obj2, 2, 2, {ARG_OBJECT, ARG_INT}},
{"display_stats", sf_display_stats, 0, 0},
{"exec_map_update_scripts", sf_exec_map_update_scripts, 0, 0},
{"get_cursor_mode", sf_get_cursor_mode, 0, 0},
{"get_flags", sf_get_flags, 1, 1, {ARG_OBJECT}},