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

Fix Layout Editor running out of repositionable controls #958

Merged
merged 4 commits into from
Aug 19, 2018

Conversation

mharis001
Copy link
Contributor

When merged this pull request will:

  • Layout editor only has 22 repositionable controls

@jonpas jonpas added the Feature label Aug 7, 2018
@commy2
Copy link
Contributor

commy2 commented Aug 7, 2018

I need this. Thank you so much.

@PabstMirror PabstMirror added this to the 3.8.1 milestone Aug 8, 2018
Copy link
Contributor

@commy2 commy2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put the config into RscDisplayOptionsLayout.hpp and include that file.

@commy2
Copy link
Contributor

commy2 commented Aug 8, 2018

Does Vanilla really start with Element000 ?

@mharis001
Copy link
Contributor Author

Done, and yeah Element000 -> Element021.

class Element021;
#define ADD_ELEMENT(var1) class Element##var1: Element021 {\
idc = __EVAL(12000 + var1);\
onMouseEnter = "with uinamespace do {['mouseEnter',_this,''] call RscDisplayOptionsLayout_script;};";\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are the same config values set in each element? Aren't they inherited?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Eventhandlers are added by script. So no Element000->021 doesn't have them so we need to add them. Which is what's happening here.

But how about we just make Element022 with the Eventhandlers and just have all the others inherit from that? Less code in the preprocessed config in the end.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will take a look at the master config.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how it looks in the displays init script:

// RscDisplayOptionsLayout.sqf
...
for "_i" from 0 to 21 do {
	_control = _display displayctrl (IDCBASE + _i);
	_control ctrladdeventhandler ["mouseenter","with uinamespace do {['mouseEnter',_this,''] call RscDisplayOptionsLayout_script;};"];
	_control ctrladdeventhandler ["mouseexit","with uinamespace do {['mouseExit',_this,''] call RscDisplayOptionsLayout_script;};"];
	_control ctrladdeventhandler ["mouseholding","with uinamespace do {['mouseMoving',_this,''] call RscDisplayOptionsLayout_script;};"];
	_control ctrladdeventhandler ["mousemoving","with uinamespace do {['mouseMoving',_this,''] call RscDisplayOptionsLayout_script;};"];
	_control ctrladdeventhandler ["mousebuttondown","with uinamespace do {['mouseButtonDown',_this,''] call RscDisplayOptionsLayout_script;};"];
	_control ctrladdeventhandler ["mousebuttonup","with uinamespace do {['mouseButtonUp',_this,''] call RscDisplayOptionsLayout_script;};"];
};
...

Strangely, in a few other places it just iterates through the child classes instead of assuming 0...21. /shrug

@Killswitch00 Killswitch00 merged commit 716f679 into CBATeam:master Aug 19, 2018
@mharis001 mharis001 deleted the layout-fix branch August 19, 2018 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants