Skip to content
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

Arsenal button to sling helmet #17

Open
Saborknight opened this issue Feb 18, 2019 · 2 comments
Open

Arsenal button to sling helmet #17

Saborknight opened this issue Feb 18, 2019 · 2 comments
Assignees

Comments

@Saborknight
Copy link
Contributor

Similar to BackpackOnChest, have a button that allows the user to sling the helmet and then select another headgear.

@10Dozen
Copy link

10Dozen commented Apr 2, 2019

Fast and easy way to add stuff to arsenal is to draw controls using Arsenal display. Code below may be be plugged into some loop (e.g. eachFrame) or handler may be attached

		if ( isNull ( uinamespace getvariable "RSCDisplayArsenal") ) exitWith {}; // No arseanl display
		private _display = uinamespace getvariable "RSCDisplayArsenal";

		// Adds new button control to arsenal UI
		private _ctrl = _display ctrlCreate ["RscButton", -1];		
		_ctrl ctrlSetText  "MY BUTTON";
		_ctrl ctrlSetPosition [0.375,1,0.25,0.05];
		_ctrl ctrlCommit 0;
		
		_ctrl ctrlAddEventHandler ["ButtonClick", {
			params ["_control"];
			
			/* Do stuff, call some functions to move selected headgear to belt */
		}];

@DerZade
Copy link
Member

DerZade commented Apr 2, 2019

@10Dozen Thanks a lot for the code. I'll probably take the code from my other Mod BackpackOnChest :)

@DerZade DerZade self-assigned this Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants