summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/script_commands.txt8
-rw-r--r--src/map/script.c12
2 files changed, 20 insertions, 0 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index a80a8f2fa..4812a2cf2 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -10215,3 +10215,11 @@ account_id - (optional) AID to perform on (default to attached player).
returns progress on success and false on failure
---------------------------------------
+
+*itempreview(<index>)
+
+Update already opened preview window with item from
+ inventory with given index.
+Works for 20181017 RE and main clients or newer.
+
+---------------------------------------
diff --git a/src/map/script.c b/src/map/script.c
index 212c11687..e7a2fdb14 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -24816,6 +24816,16 @@ static BUILDIN(changecamera)
return true;
}
+// update preview window to given item
+static BUILDIN(itempreview)
+{
+ struct map_session_data *sd = script_rid2sd(st);
+ if (sd == NULL)
+ return false;
+ clif->item_preview(sd, script_getnum(st, 2));
+ return true;
+}
+
/**
* Adds a built-in script function.
*
@@ -25550,6 +25560,8 @@ static void script_parse_builtin(void)
// camera
BUILDIN_DEF(camerainfo, ""),
BUILDIN_DEF(changecamera, "iii?"),
+
+ BUILDIN_DEF(itempreview, "i"),
};
int i, len = ARRAYLENGTH(BUILDIN);
RECREATE(script->buildin, char *, script->buildin_count + len); // Pre-alloc to speed up