AGS: Engine: register missing SetProperty script functions for plugins

Reimplemented from upstream 96d52b258dd226bc8c2243c1a5bc95a9ceeecd2a
This commit is contained in:
Walter Agazzi 2023-02-27 18:30:05 +01:00 committed by Thierry Crozat
parent 0fbdbdfcdd
commit ecc1d17655
15 changed files with 80 additions and 0 deletions

View File

@ -70,6 +70,8 @@ ScriptOverlay *Character_SayBackground(CharacterInfo *chaa, const char *texx);
void Character_SetAsPlayer(CharacterInfo *chaa);
void Character_SetIdleView(CharacterInfo *chaa, int iview, int itime);
void Character_SetOption(CharacterInfo *chaa, int flag, int yesorno);
bool Character_SetProperty(CharacterInfo *chaa, const char *property, int value);
bool Character_SetTextProperty(CharacterInfo *chaa, const char *property, const char *value);
void Character_SetSpeed(CharacterInfo *chaa, int xspeed, int yspeed);
void Character_StopMoving(CharacterInfo *charp);
void Character_Tint(CharacterInfo *chaa, int red, int green, int blue, int opacity, int luminance);

View File

@ -41,6 +41,8 @@ void Hotspot_RunInteraction(ScriptHotspot *hss, int mood);
int Hotspot_GetProperty(ScriptHotspot *hss, const char *property);
void Hotspot_GetPropertyText(ScriptHotspot *hss, const char *property, char *bufer);
const char *Hotspot_GetTextProperty(ScriptHotspot *hss, const char *property);
bool Hotspot_SetProperty(ScriptHotspot *hss, const char *property, int value);
bool Hotspot_SetTextProperty(ScriptHotspot *hss, const char *property, const char *value);
// Gets hotspot ID at the given room coordinates;
// if hotspot is disabled or non-existing, returns 0 (no area)

View File

@ -40,6 +40,8 @@ int InventoryItem_CheckInteractionAvailable(ScriptInvItem *iitem, int mood);
int InventoryItem_GetProperty(ScriptInvItem *scii, const char *property);
void InventoryItem_GetPropertyText(ScriptInvItem *scii, const char *property, char *bufer);
const char *InventoryItem_GetTextProperty(ScriptInvItem *scii, const char *property);
bool InventoryItem_SetProperty(ScriptInvItem *scii, const char *property, int value);
bool InventoryItem_SetTextProperty(ScriptInvItem *scii, const char *property, const char *value);
void set_inv_item_cursorpic(int invItemId, int piccy);

View File

@ -94,6 +94,8 @@ void Object_RunInteraction(ScriptObject *objj, int mode);
int Object_GetProperty(ScriptObject *objj, const char *property);
void Object_GetPropertyText(ScriptObject *objj, const char *property, char *bufer);
const char *Object_GetTextProperty(ScriptObject *objj, const char *property);
bool Object_SetProperty(ScriptObject *objj, const char *property, int value);
bool Object_SetTextProperty(ScriptObject *objj, const char *property, const char *value);
void move_object(int objj, int tox, int toy, int spee, int ignwal);
void get_object_blocking_rect(int objid, int *x1, int *y1, int *width, int *y2);

View File

@ -42,6 +42,8 @@ int Room_GetBottomEdge();
int Room_GetMusicOnLoad();
const char *Room_GetTextProperty(const char *property);
int Room_GetProperty(const char *property);
bool Room_SetProperty(const char *property, int value);
bool Room_SetTextProperty(const char *property, const char *value);
const char *Room_GetMessages(int index);
bool Room_Exists(int room);
RuntimeScriptValue Sc_Room_GetProperty(const RuntimeScriptValue *params, int32_t param_count);

View File

@ -72,6 +72,8 @@ void Character::AGS_EngineStartup(IAGSEngine *engine) {
SCRIPT_METHOD(Character::SetAsPlayer^0, Character::SetAsPlayer);
SCRIPT_METHOD(Character::SetIdleView^2, Character::SetIdleView);
//SCRIPT_METHOD(Character::SetOption^2", Character:: (void*)SetOption);
SCRIPT_METHOD(Character::SetProperty^2, Character::SetProperty);
SCRIPT_METHOD(Character::SetTextProperty^2, Character::SetTextProperty);
SCRIPT_METHOD(Character::SetWalkSpeed^2, Character::SetSpeed);
SCRIPT_METHOD(Character::StopMoving^0, Character::StopMoving);
SCRIPT_METHOD(Character::Think^101, Character::ScPl_Think);
@ -353,6 +355,16 @@ void Character::SetIdleView(ScriptMethodParams &params) {
AGS3::Character_SetIdleView(chaa, iview, itime);
}
void Character::SetProperty(ScriptMethodParams &params) {
PARAMS3(CharacterInfo *, chaa, const char *, property, int, value);
params._result = AGS3::Character_SetProperty(chaa, property, value);
}
void Character::SetTextProperty(ScriptMethodParams &params) {
PARAMS3(CharacterInfo *, chaa, const char *, property, const char *, value);
params._result = AGS3::Character_SetTextProperty(chaa, property, value);
}
void Character::SetSpeed(ScriptMethodParams &params) {
PARAMS3(CharacterInfo *, chaa, int, xspeed, int, yspeed);
AGS3::Character_SetSpeed(chaa, xspeed, yspeed);

View File

@ -70,6 +70,8 @@ public:
void SayBackground(ScriptMethodParams &params);
void SetAsPlayer(ScriptMethodParams &params);
void SetIdleView(ScriptMethodParams &params);
void SetProperty(ScriptMethodParams &params);
void SetTextProperty(ScriptMethodParams &params);
void SetSpeed(ScriptMethodParams &params);
void StopMoving(ScriptMethodParams &params);
void ScPl_Think(ScriptMethodParams &params);

View File

@ -35,6 +35,8 @@ void Hotspot::AGS_EngineStartup(IAGSEngine *engine) {
SCRIPT_METHOD(Hotspot::GetProperty^1, Hotspot::GetProperty);
SCRIPT_METHOD(Hotspot::GetPropertyText^2, Hotspot::GetPropertyText);
SCRIPT_METHOD(Hotspot::GetTextProperty^1, Hotspot::GetTextProperty);
SCRIPT_METHOD(Hotspot::SetProperty^2, Hotspot::SetProperty);
SCRIPT_METHOD(Hotspot::SetTextProperty^2, Hotspot::SetTextProperty);
SCRIPT_METHOD(Hotspot::RunInteraction^1, Hotspot::RunInteraction);
SCRIPT_METHOD(Hotspot::get_Enabled, Hotspot::GetEnabled);
SCRIPT_METHOD(Hotspot::set_Enabled, Hotspot::SetEnabled);
@ -74,6 +76,16 @@ void Hotspot::GetTextProperty(ScriptMethodParams &params) {
params._result = AGS3::Hotspot_GetTextProperty(hss, property);
}
void Hotspot::SetProperty(ScriptMethodParams &params) {
PARAMS3(ScriptHotspot *, hss, const char *, property, int, value);
params._result = AGS3::Hotspot_SetProperty(hss, property, value);
}
void Hotspot::SetTextProperty(ScriptMethodParams &params) {
PARAMS3(ScriptHotspot *, hss, const char *, property, const char *, value);
params._result = AGS3::Hotspot_SetTextProperty(hss, property, value);
}
void Hotspot::RunInteraction(ScriptMethodParams &params) {
PARAMS2(ScriptHotspot *, hss, int, mood);
AGS3::Hotspot_RunInteraction(hss, mood);

View File

@ -40,6 +40,8 @@ public:
void GetProperty(ScriptMethodParams &params);
void GetPropertyText(ScriptMethodParams &params);
void GetTextProperty(ScriptMethodParams &params);
void SetProperty(ScriptMethodParams &params);
void SetTextProperty(ScriptMethodParams &params);
void RunInteraction(ScriptMethodParams &params);
void GetEnabled(ScriptMethodParams &params);
void SetEnabled(ScriptMethodParams &params);

View File

@ -35,6 +35,8 @@ void InventoryItem::AGS_EngineStartup(IAGSEngine *engine) {
SCRIPT_METHOD(InventoryItem::GetProperty ^ 1, InventoryItem::GetProperty);
SCRIPT_METHOD(InventoryItem::GetPropertyText ^ 2, InventoryItem::GetPropertyText);
SCRIPT_METHOD(InventoryItem::GetTextProperty ^ 1, InventoryItem::GetTextProperty);
SCRIPT_METHOD(InventoryItem::SetProperty ^ 2, InventoryItem::SetProperty);
SCRIPT_METHOD(InventoryItem::SetTextProperty ^ 2, InventoryItem::SetTextProperty);
SCRIPT_METHOD(InventoryItem::RunInteraction ^ 1, InventoryItem::RunInteraction);
SCRIPT_METHOD(InventoryItem::SetName ^ 1, InventoryItem::SetName);
SCRIPT_METHOD(InventoryItem::get_CursorGraphic, InventoryItem::GetCursorGraphic);
@ -76,6 +78,16 @@ void InventoryItem::GetTextProperty(ScriptMethodParams &params) {
params._result = AGS3::InventoryItem_GetTextProperty(scii, property);
}
void InventoryItem::SetProperty(ScriptMethodParams &params) {
PARAMS3(ScriptInvItem *, scii, const char *, property, int, value);
params._result = AGS3::InventoryItem_SetProperty(scii, property, value);
}
void InventoryItem::SetTextProperty(ScriptMethodParams &params) {
PARAMS3(ScriptInvItem *, scii, const char *, property, const char *, value);
params._result = AGS3::InventoryItem_SetTextProperty(scii, property, value);
}
void InventoryItem::RunInteraction(ScriptMethodParams &params) {
PARAMS2(ScriptInvItem *, iitem, int, mood);
AGS3::InventoryItem_RunInteraction(iitem, mood);

View File

@ -40,6 +40,8 @@ public:
void GetProperty(ScriptMethodParams &params);
void GetPropertyText(ScriptMethodParams &params);
void GetTextProperty(ScriptMethodParams &params);
void SetProperty(ScriptMethodParams &params);
void SetTextProperty(ScriptMethodParams &params);
void RunInteraction(ScriptMethodParams &params);
void SetName(ScriptMethodParams &params);
void GetCursorGraphic(ScriptMethodParams &params);

View File

@ -35,6 +35,8 @@ void Object::AGS_EngineStartup(IAGSEngine *engine) {
SCRIPT_METHOD(Object::GetProperty^1, Object::GetProperty);
SCRIPT_METHOD(Object::GetPropertyText^2, Object::GetPropertyText);
SCRIPT_METHOD(Object::GetTextProperty^1, Object::GetTextProperty);
SCRIPT_METHOD(Object::SetProperty^2, Object::SetProperty);
SCRIPT_METHOD(Object::SetTextProperty^2, Object::SetTextProperty);
SCRIPT_METHOD(Object::MergeIntoBackground^0, Object::MergeIntoBackground);
SCRIPT_METHOD(Object::Move^5, Object::Move);
SCRIPT_METHOD(Object::RemoveTint^0, Object::RemoveTint);
@ -109,6 +111,16 @@ void Object::GetTextProperty(ScriptMethodParams &params) {
params._result = AGS3::Object_GetTextProperty(objj, property);
}
void Object::SetProperty(ScriptMethodParams &params) {
PARAMS3(ScriptObject *, objj, const char *, property, int, value);
params._result = AGS3::Object_SetProperty(objj, property, value);
}
void Object::SetTextProperty(ScriptMethodParams &params) {
PARAMS3(ScriptObject *, objj, const char *, property, const char *, value);
params._result = AGS3::Object_SetTextProperty(objj, property, value);
}
void Object::MergeIntoBackground(ScriptMethodParams &params) {
PARAMS1(ScriptObject *, objj);
AGS3::Object_MergeIntoBackground(objj);

View File

@ -40,6 +40,8 @@ public:
void GetProperty(ScriptMethodParams &params);
void GetPropertyText(ScriptMethodParams &params);
void GetTextProperty(ScriptMethodParams &params);
void SetProperty(ScriptMethodParams &params);
void SetTextProperty(ScriptMethodParams &params);
void MergeIntoBackground(ScriptMethodParams &params);
void Move(ScriptMethodParams &params);
void RemoveTint(ScriptMethodParams &params);

View File

@ -32,6 +32,8 @@ void Room::AGS_EngineStartup(IAGSEngine *engine) {
SCRIPT_METHOD(Room::GetDrawingSurfaceForBackground^1, Room::GetDrawingSurfaceForBackground);
SCRIPT_METHOD(Room::GetProperty^1, Room::GetProperty);
SCRIPT_METHOD(Room::GetTextProperty^1, Room::GetTextProperty);
SCRIPT_METHOD(Room::SetProperty^2, Room::SetProperty);
SCRIPT_METHOD(Room::SetTextProperty^2, Room::SetTextProperty);
SCRIPT_METHOD(Room::get_BottomEdge, Room::GetBottomEdge);
SCRIPT_METHOD(Room::get_ColorDepth, Room::GetColorDepth);
SCRIPT_METHOD(Room::get_Height, Room::GetHeight);
@ -59,6 +61,16 @@ void Room::GetTextProperty(ScriptMethodParams &params) {
params._result = AGS3::Room_GetTextProperty(property);
}
void Room::SetProperty(ScriptMethodParams &params) {
PARAMS2(const char *, property, int, value);
params._result = AGS3::Room_SetProperty(property, value);
}
void Room::SetTextProperty(ScriptMethodParams &params) {
PARAMS2(const char *, property, const char *, value);
params._result = AGS3::Room_SetTextProperty(property, value);
}
void Room::GetBottomEdge(ScriptMethodParams &params) {
params._result = AGS3::Room_GetBottomEdge();
}

View File

@ -37,6 +37,8 @@ public:
void GetDrawingSurfaceForBackground(ScriptMethodParams &params);
void GetProperty(ScriptMethodParams &params);
void GetTextProperty(ScriptMethodParams &params);
void SetProperty(ScriptMethodParams &params);
void SetTextProperty(ScriptMethodParams &params);
void GetBottomEdge(ScriptMethodParams &params);
void GetColorDepth(ScriptMethodParams &params);
void GetHeight(ScriptMethodParams &params);