public GenericItemValues()
        {
            InitializeComponent();

            idTextBox.Tag = new JsonFormTag(
                "id",
                "A unique string ID for the object, used in recipes and the code.");
            symbolTextBox.Tag = new JsonFormTag(
                "symbol",
                "A single character used to display this item on the map.",
                true,
                "_");
            typeComboBox.Tag = new JsonFormTag(
                "type",
                "The type of the object, controlling what extra information it needs.",
                false);
            colorComboBox.Tag = new JsonFormTag(
                "color",
                "The color used to display this item on the map.",
                true,
                "light_gray");
            ((JsonFormTag)colorComboBox.Tag).dataSource = JsonFormTag.DataSourceType.COLOR;
            nameTextBox.Tag = new JsonFormTag(
                "name",
                "The displayed name of the object. Should be all lowercase except in special cases (like proper nouns and acronyms).");
            materialsCheckedListBox.Tag = new JsonFormTag(
                "material",
                "The materials making up this item (max 2).",
                false);
            ((JsonFormTag)materialsCheckedListBox.Tag).dataSource = JsonFormTag.DataSourceType.MATERIALS;
            descriptionTextBox.Tag = new JsonFormTag(
                "description",
                "The displayed description of the item.");
            phaseComboBox.Tag = new JsonFormTag(
                "phase",
                "The default phase of matter of the object. The only effect is that liquids are drinkable and require containers.",
                false);
            priceNumeric.Tag = new JsonFormTag(
                "price",
                "The monetary value of the object.");
            volumeNumeric.Tag = new JsonFormTag(
                "volume",
                "The inventory volume taken up by this object.");
            weightNumeric.Tag = new JsonFormTag(
                "weight",
                "How much this object weighs.");
            bashNumeric.Tag = new JsonFormTag(
                "bashing",
                "Bonus bash damage from this object when wielded as a weapon.");
            cutNumeric.Tag = new JsonFormTag(
                "cutting",
                "Bonus cut damage from this object when wielded as a weapon.");
            tohitNumeric.Tag = new JsonFormTag(
                "to_hit",
                "To-hit modifier for this object when wielded as a weapon.");
            techniquesCheckedListBox.Tag = new JsonFormTag(
                "techniques",
                "Technique flags for this item when used as a weapon.",
                false);
            ((JsonFormTag)techniquesCheckedListBox.Tag).dataSource = JsonFormTag.DataSourceType.TECHNIQUES;
            flagsCheckedListBox.Tag = new JsonFormTag(
                "flags",
                "Special flags giving specific functionality to the object.",
                false);
            ((JsonFormTag)flagsCheckedListBox.Tag).dataSource = JsonFormTag.DataSourceType.FLAGS;
            functionComboBox.Tag = new JsonFormTag(
                "use_action",
                "A game function to call when the item is applied or used.",
                false);

            WinformsUtil.SetupCharDisplayLabel(charDisplayLabel, symbolTextBox, colorComboBox);

            WinformsUtil.ControlsAttachHooks(this);
            WinformsUtil.TagsSetDefaults(this);

            //TODO: warning on load if symbol length > 1
        }
Ejemplo n.º 2
0
        public VehiclePartValues()
        {
            InitializeComponent();

            idTextBox.Tag = new JsonFormTag(
                "id",
                "A unique string identifier for this part.");
            nameTextBox.Tag = new JsonFormTag(
                "name",
                "The display name for this part in vehicle menus.");
            symbolTextBox.Tag = new JsonFormTag(
                "symbol",
                "The display symbol for this part on the map.");
            colorComboBox.Tag = new JsonFormTag(
                "color",
                "The display color for this part on the map.");
            ((JsonFormTag)colorComboBox.Tag).dataSource = JsonFormTag.DataSourceType.COLOR;
            brokeSymbolTextBox.Tag = new JsonFormTag(
                "broken_symbol",
                "The display symbol for the broken version of this part on the map.");
            brokeColorComboBox.Tag = new JsonFormTag(
                "broken_color",
                "The display color for the broken version of this part on the map.");
            ((JsonFormTag)brokeColorComboBox.Tag).dataSource = JsonFormTag.DataSourceType.COLOR;
            damModNumeric.Tag = new JsonFormTag(
                "damage_modifier",
                "A percentage applied to damage taken by this part. If 0, the part will not take damage.",
                false,
                0);
            itemNameTextBox.Tag = new JsonFormTag(
                "item",
                "The id of the item this part is built out of.");
            ((JsonFormTag)itemNameTextBox.Tag).dataSource = JsonFormTag.DataSourceType.ITEMS;
            vehicleFlagsListBox.Tag = new JsonFormTag(
                "flags",
                "A list of flags that apply certain properties to this part.");
            ((JsonFormTag)vehicleFlagsListBox.Tag).dataSource = JsonFormTag.DataSourceType.VEHICLEPART_FLAGS;
            fuelTypeComboBox.Tag = new JsonFormTag(
                "fuel_type",
                "The type of fuel this part uses, if it has the ENGINE flag.",
                false);
            ((JsonFormTag)fuelTypeComboBox.Tag).dataSource = JsonFormTag.DataSourceType.FUEL;

            par1Numeric.Tag = new JsonFormTag(
                "par1",
                "");
            powerNumeric.Tag = new JsonFormTag(
                "power",
                "");
            sizeNumeric.Tag = new JsonFormTag(
                "size",
                "");
            wheelWidthNumeric.Tag = new JsonFormTag(
                "wheel_width",
                "The width of this part if it has the WHEEL flag.");
            bonusNumeric.Tag = new JsonFormTag(
                "bonus",
                "");

            WinformsUtil.SetupCharDisplayLabel(charDisplayLabel, symbolTextBox, colorComboBox);
            WinformsUtil.SetupCharDisplayLabel(charDisplayLabelBroken, brokeSymbolTextBox, brokeColorComboBox);

            WinformsUtil.ControlsAttachHooks(this);
            WinformsUtil.TagsSetDefaults(this);

            WinformsUtil.OnLoadItem += LoadItem;
        }