Added sfall_func7 and sfall_func8 new opcodes

Added 3 new attrType values to "get_window_attribute" function.
Minor code edits.
This commit is contained in:
NovaRain
2020-12-22 17:03:01 +08:00
parent 9052396de5
commit e0e300a91e
9 changed files with 54 additions and 23 deletions
@@ -340,6 +340,10 @@ There are several changes in this version of sslc which may result in problems f
=== Changelog ===
=================
> sfall 4.2.9
- added support for additional universal opcodes sfall_func7 and sfall_func8
- fixed a compilation error when the script has a UTF-8 BOM
> sfall 4.2.7
- added ability to declare local variables anywhere in the procedure body
+3
View File
@@ -286,8 +286,11 @@
#define get_flags(obj) sfall_func1("get_flags", obj)
#define get_ini_section(file, sect) sfall_func2("get_ini_section", file, sect)
#define get_ini_sections(file) sfall_func1("get_ini_sections", file)
#define get_interface_rect(winType) sfall_func2("get_window_attribute", winType, -1)
#define get_interface_x(winType) sfall_func2("get_window_attribute", winType, 1)
#define get_interface_y(winType) sfall_func2("get_window_attribute", winType, 2)
#define get_interface_width(winType) sfall_func2("get_window_attribute", winType, 3)
#define get_interface_height(winType) sfall_func2("get_window_attribute", winType, 4)
#define get_inven_ap_cost sfall_func0("get_inven_ap_cost")
#define get_map_enter_position sfall_func0("get_map_enter_position")
#define get_metarule_table sfall_func0("get_metarule_table")
+4 -1
View File
@@ -381,7 +381,7 @@ Some utility/math functions are available:
> any sfall_funcX(string funcName, ...)
- these opcodes allows to use additional scripting functions, that do not require new opcode
- first argument is always function name (string)
- there are 7 versions of this opcode for different number of additional arguments (for convenience)
- there are 9 versions of this opcode for different number of additional arguments (for convenience)
- opcodes have return value, but it is not necessary to use it
@@ -666,6 +666,9 @@ optional argument:
- winType: the type number of the interface window (see WINTYPE_* constants in sfall.h)
- attrType: 0 - checks and returns a value of 1 if the specified interface window is created by the game (same as without the argument)
1 - X position, 2 - Y position (relative to the top-left corner of the game screen)
3 - interface width size, 4 - interface height size
-1 - returns an associative array of keys (left, top, right, bottom) and values that define the position of the window rectangle
(use standard syntax to access array values, e.g. winRect.top, winRect.bottom)
- returns -1 if the specified attribute cannot be obtained
> void sfall_func2("set_town_title", int areaID, string title)
@@ -362,6 +362,9 @@
0x827f - div operator (unsigned integer division)
0x8280 - any sfall_func7(string funcName, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
0x8281 - any sfall_func8(string funcName, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
* These functions require AllowUnsafeScripting to be enabled in ddraw.ini