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

Medical/Repair 3den Toolbox State Fix (Bug fix for #4902) #4905

Merged
merged 4 commits into from
Feb 18, 2017
Merged

Medical/Repair 3den Toolbox State Fix (Bug fix for #4902) #4905

merged 4 commits into from
Feb 18, 2017

Conversation

AACO
Copy link
Contributor

@AACO AACO commented Feb 15, 2017

Simple fix to store the toolbox state on the control level, instead of the missionNamespace level.

Resolves #4902

@AACO AACO changed the title 3den tlbx fix Medical/Repair 3den Toolbox State Fix (Bug fix for #4902) Feb 15, 2017
@PabstMirror PabstMirror added the kind/bug-fix Release Notes: **FIXED:** label Feb 15, 2017
@PabstMirror PabstMirror added this to the 3.9.1 milestone Feb 15, 2017
attributeLoad = "(_this controlsGroupCtrl 100) lbsetcursel (((_value + 1) min 3) max 0);";
attributeSave = "(missionnamespace getvariable ['ace_isMedic_temp',0]) - 1;";
attributeLoad = "(_this controlsGroupCtrl 100) lbSetCurSel (((_value + 1) min 3) max 0);";
attributeSave = "(_this getVariable ['ace_isMedic_temp', 0]) - 1;";
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does this exist in the first place?

Copy link
Contributor

Choose a reason for hiding this comment

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

That's how BIS does attributes:

class Rank: Toolbox {
    attributeLoad = "(_this controlsGroupCtrl 100) lbsetcursel (['private','corporal','sergeant','lieutenant','captain','major','colonel'] find _value);";
    attributeSave = "['private','corporal','sergeant','lieutenant','captain','major','colonel'] select (missionnamespace getvariable ['Rank_value',0]);";
    class Controls: Controls {
        class Value: Value {
            tooltips[] = {"Private", "Corporal", "Sergeant", "Lieutenant", "Captain", "Major", "Colonel"};
            onToolboxSelChanged = "missionnamespace setvariable ['Rank_value',_this select 1];";
        };
    };
};

Does rank have the same issue as ace's medic setting?

Copy link
Contributor

Choose a reason for hiding this comment

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

Storing this on the control seems really pointless. The control itself already has a state. I'm not sure this fix is correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we use a default value of 0 we can probably get away with just using the toolbox state, otherwise it'd always save to the SQM, albeit it'd be the correct value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@PabstMirror to your point about the rank module, I'm really not sure. The rank (and stance) toolboxes are stored as bonafide unit attributes, so I'm going to speculate and say BI is cheating and treats those slightly differently.

@PabstMirror
Copy link
Contributor

Talking with @AACO - The way BIS does rank must use some special engine stuff as it works fine.

The current code's problem is using ace_isMedic_temp
It was only being changed on toolBoxChange, but not on load.
So opening and saving the attirbutes could change the value to the last settting.

@PabstMirror PabstMirror merged commit 0900bf9 into acemod:master Feb 18, 2017
@commy2
Copy link
Contributor

commy2 commented Feb 18, 2017

The way BIS does rank must use some special engine stuff as it works fine.

:\

@AACO AACO deleted the 3den-tlbx-fix branch February 19, 2017 01:42
thojkooi pushed a commit that referenced this pull request Mar 13, 2017
* Update medical/repair 3den away from missionNamespace

* Simplify save
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug-fix Release Notes: **FIXED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ace Unit Attributes Medic, Doctor, Engineer, ect resetting to default or swapping settings with other units
4 participants