Backported the code of four hookscripts from 4.x.

* FINDTARGET, BARTERPRICE, WITHINPERCEPTION, and INVENTORYMOVE. For
unifying the behavior of common hooks between 3.8 and 4.x.

Added the example script of WITHINPERCEPTION from 4.x.
Updated gl_highlighting_lite.
This commit is contained in:
NovaRain
2019-05-14 11:42:21 +08:00
parent 20ffc39f95
commit 5353ab0ad6
8 changed files with 602 additions and 272 deletions
@@ -100,6 +100,11 @@ procedure KeyPressHandler begin
end
end
procedure InventoryMoveHandler begin
// remove item outline when player picks up the item
if (isHighlight and get_sfall_arg == 7) then set_outline(get_sfall_arg, 0);
end
procedure start begin
if game_loaded and (sfall_ver_major < 4) then begin
call InitConfigs;
@@ -116,5 +121,6 @@ procedure start begin
highlightFailMsg2 := Translate("HighlightFail2", "Your motion sensor is out of charge.");
register_hook_proc(HOOK_KEYPRESS, KeyPressHandler);
register_hook_proc(HOOK_INVENTORYMOVE, InventoryMoveHandler);
end
end