iw4x-client/src/Components/Modules/GSC/ScriptExtension.hpp

33 lines
1.1 KiB
C++
Raw Normal View History

#pragma once
namespace Components
{
2022-01-23 14:32:20 -05:00
class ScriptExtension : public Component
{
public:
2022-01-23 14:32:20 -05:00
ScriptExtension();
2022-04-28 08:03:22 -04:00
static void AddEntityField(const char* name, Game::fieldtype_t type, const Game::ScriptCallbackEnt& setter, const Game::ScriptCallbackEnt& getter);
static void AddClientField(const char* name, Game::fieldtype_t type, const Game::ScriptCallbackClient& setter, const Game::ScriptCallbackClient& getter);
private:
2022-04-28 08:03:22 -04:00
static std::unordered_map<std::uint16_t, Game::ent_field_t> CustomEntityFields;
static std::unordered_map<std::uint16_t, Game::client_fields_s> CustomClientFields;
static void GScr_AddFieldsForEntityStub();
// Two hooks because it makes our code cleaner (luckily functions were not inlined)
static int Scr_SetObjectFieldStub(unsigned int classnum, int entnum, int offset);
static void Scr_SetClientFieldStub(Game::gclient_s* client, int offset);
// One hook because functions were inlined
static void Scr_GetEntityFieldStub(int entnum, int offset);
static void AddFunctions();
static void AddMethods();
2022-04-28 08:03:22 -04:00
static void AddEntityFields();
static void AddClientFields();
2022-03-21 14:55:35 -04:00
static void Scr_TableLookupIStringByRow();
};
}