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

Attributes Framework #16

Closed
jameslkingsley opened this issue May 25, 2016 · 2 comments
Closed

Attributes Framework #16

jameslkingsley opened this issue May 25, 2016 · 2 comments
Labels
Milestone

Comments

@jameslkingsley
Copy link
Owner

jameslkingsley commented May 25, 2016

This is the system that will manage UI's for either specific object classes or generic dialogs. It is dynamically created by traversing through the given attributes class and creating its controls inside the parent window. God help us all.

@jameslkingsley jameslkingsley added this to the 1.0.0 milestone May 25, 2016
@jameslkingsley jameslkingsley changed the title Attributes UI Framework Attributes Framework May 25, 2016
@654wak654
Copy link
Contributor

654wak654 commented May 25, 2016

Table of attribute types:

Type name Type of control default value details about return value
string editbox "" value inside the editbox (STR)
string_long ml editbox "" value inside the editbox (STR)
range 2 editboxes [0, 0] values in both editboxes (ARR)
position 3 editboxes [0, 0, 0] vector (x,y,z) (ARR)
color 4 editboxes [0, 0, 0, 0] color (r,g,b,a) (ARR)
date 3 comboboxes epoch* date (year, month, day) (ARR)
list combobox 0 corresponding value to curSel (STR)
number editbox 0 value number inside the editbox (NUM)
slider slider 0 current pos of slider (NUM)
bool checkbox 0 (false) is checkbox selected (BOOL)
custom good luck nil (ANY)

*epoch is January first of smallest year given

Example:

class GVARMAIN(attributes) {
    class CAManBase {
        class ADDON {
            class General {
                class Awesome {
                    displayName = "Is awesome";
                    tooltipText = "Select if this unit is awesome or not.";
                    type = "BOOL";
                    default = 1; // Optional, default is 0
                    exceptions[] = {"isAlive"};
                    expression = QUOTE(_x setVariable [QGVAR(isAwesome), _this]);
                };
                class CombatMode {
                    displayName = "Combat Mode";
                    tooltipText = "Select this unit's group's combat mode.";
                    type = "COMBO";
                    values[] = {"BLUE", "GREEN", "WHITE", "YELLOW", "RED"};
                    labels[] = {
                        "Never fire",
                        "Hold fire - defend only",
                        "Hold fire, engage at will",
                        "Fire at will",
                        "Fire at will, engage at will"
                    };
                    expression = "(group _x) setCombatMode _this";
                    condition = "_x == leader _x";
                };
            };
        };
    };
};

@jameslkingsley
Copy link
Owner Author

jameslkingsley commented May 30, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants