-
Notifications
You must be signed in to change notification settings - Fork 740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Zeus utility modules #4661
Add Zeus utility modules #4661
Changes from 16 commits
51de0bd
d2638cf
9332101
d27c68c
1683b5d
f329405
7037676
2398ac9
5a87acf
aa3289d
221d0ae
40ba9ef
7868eaf
be7c4d6
4b690e8
a1ebaed
dd85fcb
59ef96c
1c73355
30c694d
aab2cb7
438255a
008bb40
6c6bb58
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class CfgFactionClasses { | ||
class ACE_UI_Util { | ||
displayName = "ACE Util"; | ||
priority = 2; | ||
side = 7; | ||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Author: Fisher | ||
* Toggle Simulation on object (runs on server only via module framework). | ||
* | ||
* Arguments: | ||
* 0: The module logic <OBJECT> | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Public: No | ||
*/ | ||
|
||
#include "script_component.hpp" | ||
|
||
params ["_logic"]; | ||
|
||
private _object = attachedTo _logic; | ||
if (isNull _object) then { | ||
[LSTRING(NoObjectSelected)] call EFUNC(common,displayTextStructured); | ||
} else { | ||
if (isMultiplayer) then { | ||
_object enableSimulationGlobal !(simulationEnabled _object); | ||
} else { | ||
_object enableSimulation !(simulationEnabled _object); | ||
}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this whole then block can be simplified to: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah that's what I thought too, the biki seems to suggest that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm. Weird comment on the wiki. Should be tested. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. enableSimulationGlobal seems to work in MP, enableSimulation doesn't so I guess replace it with just There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The question is about a offhand (?) comment on the wiki:
Thing is that the SP client is for all intents and purposes the "server". But maybe the command is bugged and doesn't work at all in SP? Someone should test it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tested enableSimulationGlobal in singleplayer aswell, it works fine on my end |
||
}; | ||
|
||
deleteVehicle _logic; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. white space here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. white space There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. white space : ( |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Author: Fisher | ||
* Adds all objects in given radius to all curators. | ||
* | ||
* Arguments: | ||
* 0: Dummy controls group <CONTROL> | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Public: No | ||
*/ | ||
|
||
#include "script_component.hpp" | ||
|
||
disableSerialization; | ||
|
||
params ["_control"]; | ||
private _display = ctrlParent _control; | ||
private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); | ||
|
||
_control ctrlRemoveAllEventHandlers "setFocus"; | ||
|
||
scopeName "Main"; | ||
|
||
private _fnc_onUnload = { | ||
private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); | ||
if (isNull _logic) exitWith {}; | ||
|
||
if (_this select 1 == 2) then { | ||
deleteVehicle _logic; | ||
}; | ||
}; | ||
|
||
private _fnc_onConfirm = { | ||
params [["_ctrlButtonOK", controlNull, [controlNull]]]; | ||
|
||
private _display = ctrlparent _ctrlButtonOK; | ||
if (isNull _display) exitWith {}; | ||
|
||
private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); | ||
if (isNull _logic) exitWith {}; | ||
|
||
private _radius = GETVAR(_display,GVAR(radius),50); | ||
private _position = GETVAR(_display,GVAR(position),getPos _logic); | ||
private _objectsToAdd = nearestObjects [_position, ["All"], _radius]; | ||
|
||
{ | ||
_x addCuratorEditableObjects [_objectsToAdd, true]; | ||
} forEach allCurators; | ||
|
||
deleteVehicle _logic; | ||
}; | ||
|
||
_display displayAddEventHandler ["unload", _fnc_onUnload]; | ||
_control ctrlAddEventHandler ["buttonClick", _fnc_onConfirm]; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Author: Fisher | ||
* Removes all objects in given radius for all curators. | ||
* | ||
* Arguments: | ||
* 0: Dummy controls group <CONTROL> | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Public: No | ||
*/ | ||
|
||
#include "script_component.hpp" | ||
|
||
params ["_control"]; | ||
private _display = ctrlParent _control; | ||
private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); | ||
|
||
_control ctrlRemoveAllEventHandlers "setFocus"; | ||
|
||
scopeName "Main"; | ||
private _fnc_onUnload = { | ||
private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); | ||
if (isNull _logic) exitWith {}; | ||
|
||
if (_this select 1 == 2) then { | ||
deleteVehicle _logic; | ||
}; | ||
}; | ||
|
||
private _fnc_onConfirm = { | ||
params [["_ctrlButtonOK", controlNull, [controlNull]]]; | ||
|
||
private _display = ctrlparent _ctrlButtonOK; | ||
if (isNull _display) exitWith {}; | ||
|
||
private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); | ||
if (isNull _logic) exitWith {}; | ||
|
||
private _radius = GETVAR(_display,GVAR(radius),50); | ||
private _position = GETVAR(_display,GVAR(position),getPos _logic); | ||
private _objectsToAdd = nearestObjects [_position, ["All"], _radius]; | ||
|
||
{ | ||
_x removeCuratorEditableObjects [_objectsToAdd, true]; | ||
} forEach allCurators; | ||
|
||
deleteVehicle _logic; | ||
}; | ||
|
||
_display displayAddEventHandler ["unload", _fnc_onUnload]; | ||
_control ctrlAddEventHandler ["buttonClick", _fnc_onConfirm]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this script does indeed only run on the server, then why does it show a text there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't it so that it runs on both server & local? @SilentSpike
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also a good catch, hmm, I suppose it probably should run on the client and then send an event to the server so that this client feedback can be given.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not optimal in terms of minimising network traffic, but much better UX for zeus and also these modules are only running when prompted by zeus anyway so it's not a big deal.