mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Replaced hs_*.int scripts in example mods with normal global scripts with register_hook.
(cherry picked from commit e7e286013f)
This commit is contained in:
Binary file not shown.
+13
-11
@@ -1,22 +1,24 @@
|
|||||||
procedure start;
|
procedure start;
|
||||||
// adjust include paths if needed
|
// adjust include paths if needed
|
||||||
#include "..\..\scripting_docs\headers\sfall.h"
|
#include "..\..\scripting_docs\headers\sfall.h"
|
||||||
|
|
||||||
#define RESULT_SUCCESS (1)
|
#define RESULT_SUCCESS (1)
|
||||||
#define RESULT_FAIL (0)
|
#define RESULT_FAIL (0)
|
||||||
|
|
||||||
procedure start begin
|
procedure start begin
|
||||||
if not init_hook then begin
|
if game_loaded then begin
|
||||||
|
register_hook(HOOK_STEAL);
|
||||||
|
end else begin
|
||||||
variable
|
variable
|
||||||
thief := get_sfall_arg,
|
thief := get_sfall_arg,
|
||||||
target := get_sfall_arg,
|
target := get_sfall_arg,
|
||||||
item := get_sfall_arg,
|
item := get_sfall_arg,
|
||||||
action := get_sfall_arg,
|
action := get_sfall_arg,
|
||||||
result := RESULT_SUCCESS;
|
result := RESULT_SUCCESS;
|
||||||
|
|
||||||
if (thief == dude_obj) then begin
|
if (thief == dude_obj) then begin
|
||||||
display_msg(sprintf(mstr_skill(570 + result + action*2), obj_name(item)));
|
display_msg(sprintf(mstr_skill(570 + result + action*2), obj_name(item)));
|
||||||
set_sfall_return(result);
|
set_sfall_return(result);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,20 @@
|
|||||||
|
procedure start;
|
||||||
|
// adjust include paths if needed
|
||||||
|
#include "..\..\scripting_docs\headers\sfall.h"
|
||||||
|
#include "..\..\scripting_docs\headers\dik.h"
|
||||||
|
|
||||||
|
procedure start begin
|
||||||
|
if game_loaded then begin
|
||||||
|
register_hook(HOOK_KEYPRESS);
|
||||||
|
end else begin
|
||||||
|
variable
|
||||||
|
event := get_sfall_arg,
|
||||||
|
keyDX := get_sfall_arg;
|
||||||
|
|
||||||
|
if (event == 1) and (keyDX == DIK_SEMICOLON) then begin
|
||||||
|
tap_key(DIK_CAPITAL);
|
||||||
|
tap_key(DIK_A);
|
||||||
|
tap_key(DIK_CAPITAL);
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
Binary file not shown.
@@ -1,16 +0,0 @@
|
|||||||
procedure start;
|
|
||||||
#include ".\HEADERS\dik.h"
|
|
||||||
|
|
||||||
procedure start begin
|
|
||||||
variable event, keyDX;
|
|
||||||
if not init_hook then begin
|
|
||||||
event := get_sfall_arg;
|
|
||||||
keyDX := get_sfall_arg;
|
|
||||||
|
|
||||||
if ((event == 1) and (keyDX == DIK_SEMICOLON)) then begin
|
|
||||||
tap_key(DIK_CAPITAL);
|
|
||||||
tap_key(DIK_A);
|
|
||||||
tap_key(DIK_CAPITAL);
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -2,8 +2,8 @@
|
|||||||
----------------------------------------
|
----------------------------------------
|
||||||
|
|
||||||
- makes pressing the semicolon key send an uppercase A after a semicolon.
|
- makes pressing the semicolon key send an uppercase A after a semicolon.
|
||||||
- the uppercase A (shift + A if Caps Lock is off) is the built-in hotkey for the TAKE ALL button on the loot screen.
|
- Note: the uppercase A (shift + A if Caps Lock is off) is the built-in hotkey for the TAKE ALL button on the loot screen.
|
||||||
|
|
||||||
To use, copy hs_keypress.int file to your scripts folder.
|
To use, copy *.int file to your scripts folder.
|
||||||
|
|
||||||
This mod is a simple example of how you can use HOOK_KEYPRESS hooks.
|
This mod is a simple example of how you can use HOOK_KEYPRESS hooks.
|
||||||
|
|||||||
Reference in New Issue
Block a user