Corrected code and renamed hook/functions from the previous commit

This commit is contained in:
NovaRain
2019-12-13 10:49:24 +08:00
parent a325dd18ea
commit 0bf9a322c1
13 changed files with 69 additions and 44 deletions
+3
View File
@@ -64,6 +64,7 @@
#define HOOK_SNEAK (39)
#define HOOK_STDPROCEDURE (40)
#define HOOK_STDPROCEDURE_END (41)
#define HOOK_TARGETOBJECT (42)
//Valid arguments to list_begin
#define LIST_CRITTERS (0)
@@ -296,6 +297,7 @@
#define metarule_exist(metaruleName) sfall_func1("metarule_exist", metaruleName)
#define npc_engine_level_up(toggle) sfall_func1("npc_engine_level_up", toggle)
#define obj_under_cursor(onlyCritter, includeDude) sfall_func2("obj_under_cursor", onlyCritter, includeDude)
#define objects_in_radius(tile, radius, elev, type) sfall_func4("objects_in_radius", tile, radius, elev, type)
#define outlined_object sfall_func0("outlined_object")
#define real_dude_obj sfall_func0("real_dude_obj")
#define remove_all_timer_events sfall_func0("remove_timer_event")
@@ -321,6 +323,7 @@
#define string_compare(str1, str2) sfall_func2("string_compare", str1, str2)
#define string_compare_locale(str1, str2, codePage) sfall_func3("string_compare", str1, str2, codePage)
#define string_format(format, a1, a2) sfall_func3("string_format", format, a1, a2)
#define tile_by_position(x, y) sfall_func2("tile_by_position", x, y)
#define tile_refresh_display sfall_func0("tile_refresh_display")
#define unjam_lock(obj) sfall_func1("unjam_lock", obj)
#define unset_unique_id(obj) sfall_func2("set_unique_id", obj, -1)
+12
View File
@@ -648,3 +648,15 @@ Obj arg3 - the object that called this handler (source_obj, can be 0)
int arg4 - 1 after procedure execution (for HOOK_STDPROCEDURE_END), 0 otherwise
int ret1 - pass -1 to cancel the execution of the handler (only for HOOK_STDPROCEDURE)
-------------------------------------------
HOOK_TARGETOBJECT (hs_targetobject.int)
Runs whenever the targeting cursor hovers over something.
int arg1 - event type: 0 - when hovering over the target, 1 - when clicking on the target
int arg2 - 1 if the target is a valid object, 0 otherwise
Obj arg3 - the target object
int ret1 - overrides the target object
+11 -1
View File
@@ -685,7 +685,17 @@ optional argument:
> string sfall_func3("string_format", string format, any val1, any val2, ...)
- formats given value using standard syntax of C printf function (google "printf" for format details). However it is limited to formatting up to 4 values
- formatting is only supported for %s and %d. The format string is limited to 1024 characters
- formatting is only supported for %s and %d, and the format string is limited to 1024 characters
> array sfall_func3("objects_in_radius", int tile, int radius, int elevation)
> array sfall_func4("objects_in_radius", int tile, int radius, int elevation, int type)
- returns an array of objects of a type (see OBJ_TYPE_* constants in define_extra.h) within the specified radius from the given tile
- The radius is limited to 50 hexes
- passing -1 to the type argument or not specifying it will return all types of objects
> int sfall_func2("tile_by_position", int x, int y)
- returns the tile number at the x/y position relative to the top-left corner of the screen
- returns -1 if the position is outside of the screen
------------------------
------ MORE INFO -------