Fandom

武装突袭 Wiki

InGameUISetEventHandler

简体 | 繁體

4,827个页面创建
于此维基上
添加新页面
评论0 分享

您使用了广告屏蔽软件!


Wikia通过广告运营为用户提供免费的服务。我们对用户通过嵌入广告屏蔽软件访问网站进行了使用调整。

如果您使用了广告屏蔽软件,将无法使用我们的服务。请您移除广告屏蔽软件,以确保页面正常加载。

  Effects of this scripting command are not broadcasted over the network and remain local to the client the command is executed on

点击图片可看到更多讯息

开始使用于

游戏:
Armed Assault
版本:
1.00

描述

描述:
Sets given event handler of in-game UI. If EH function returns true, performed action is overridden. Event handlers available are:

  • "PrevAction" - mouse scroll up
  • "Action" - action key press
  • "NextAction" - mouse scroll down

This is "set" type EH, which means it will replace previously set EH of the same type. So to remove EH, set another one with empty string "" for the function.

Since Arma 3 v1.49.131743 this EH returns array of params for selected/activated action in _this variable:

  • 0: Object - target object to which action is attached
  • 1: Object - caller object, basically player
  • 2: Number - index of the action in action menu (0 - top most)
  • 3: String - engine based action name ("User" for user added actions)
  • 4: String - localized action plain text as seen by the caller
  • 5: Number - action priority value
  • 6: Boolean - action showWindow value
  • 7: Boolean - action hideOnUse value
  • 8: String - action shortcut name or ""
  • 9: Boolean - action menu visibility (on first scroll or action press the menu is still invisible, so no action is performed, only menu is shown)
  • 10: String - EH event name

基本句法

句法:
inGameUISetEventHandler [handlerName, function]
参数:
[handlerName, function]: Array

handlerName: String

function: String
返回值:
Nothing

范例

范例1:
inGameUISetEventHandler ["Action","hint 'Lights, Camera, Action!'; true"];

范例2:
inGameUISetEventHandler ["PrevAction", "hint str _this; false"]; inGameUISetEventHandler ["NextAction", "hint str _this; false"]; inGameUISetEventHandler ["Action", "hint str _this; false"];

范例3:
Deny any weapon disassembly: inGameUISetEventHandler ["Action", " if (_this select 3 == 'DisAssemble') then { hint 'You are not allowed to do this'; true } "];

范例4:
Detect explosive/mine placement:onMagazineUse = ' params ["_target", "", "", "_action", "", "", "", "", "", "", "_event"]; if (_action == "UseMagazine") then { if (_event == "Action") then { 0 = _target spawn { waitUntil {!(all_magazines isEqualTo magazines _this)}; { 0 = all_magazines deleteAt (all_magazines find _x); } count magazines _this; hint format ["Magazine Used: %1", all_magazines select 0]; } } else { all_magazines = magazines _target; }; }; false '; inGameUISetEventHandler ["PrevAction", onMagazineUse]; inGameUISetEventHandler ["NextAction", onMagazineUse]; inGameUISetEventHandler ["Action", onMagazineUse];

额外资讯

多人游戏:
-
也可以看看:

addEventHandlerctrlAddEventHandlerdisplayAddEventHandler

注意事项

此处撰写句法皆为可行用法. 可到官网[1]专页回报错误. 你可以使用讨论页面或是论坛来进行讨论.
新增注意事项 | 如何新增?

Notes

Bottom Section

更多维基

随机维基