diff --git a/objects/obj_creation_popup/Create_0.gml b/objects/obj_creation_popup/Create_0.gml index 496711ef2a..766509ad28 100644 --- a/objects/obj_creation_popup/Create_0.gml +++ b/objects/obj_creation_popup/Create_0.gml @@ -10,8 +10,6 @@ start_colour = -1; col_shift = false; bulk_buttons = []; -tooltip = ""; -tooltip2 = ""; item_name = []; role_names_all = ""; warning = ""; @@ -114,9 +112,17 @@ possible_custom_roles = [ ], ]; -if (type == ePOPUP_TYPE.LIVERYPICK) { +var _is_livery = type == ePOPUP_TYPE.LIVERYPICK; +livery_pick_type = -1; +if (_is_livery){ + livery_pick_type = obj_creation.colour_selection_options.current_selection; +} +if (_is_livery && livery_pick_type == eLIVERY_COLOURING_OPTIONS.BULK) { + if (target_role <= 0 || target_role >= 8) { + instance_destroy(); + exit; + } assign_picked_liveries = function() { - var _colour_area_chosen = colour_area != ""; draw_set_font(fnt_40k_30b); var _type_key = string(target_role); var _colour_type = struct_exists(type_names, _type_key) ? type_names[$ _type_key] : ""; @@ -127,45 +133,49 @@ if (type == ePOPUP_TYPE.LIVERYPICK) { if (_action == "destroy") { instance_destroy(); exit; + } + + var _col = picker.chosen; + if (start_colour == -1) { + start_colour = variable_instance_get(obj_creation, type_fields[target_role]); + + } + + + if (_col == -1) { + _col = start_colour; + } + + variable_instance_set(obj_creation, type_fields[target_role], _col); + + + with (obj_creation) { + bulk_selection_buttons_setup(); + } + }; +} else if (_is_livery && livery_pick_type == eLIVERY_COLOURING_OPTIONS.ADVANCED){ + start_colour = obj_creation.complex_livery_data[$ target_role][$ colour_area]; + assign_complex_picked_liveries = function(){ + var _action = picker.draw(); + if (_action == "destroy") { + instance_destroy(); + exit; + } + var _col = picker.chosen; + if (is_array(_col)) { + obj_creation.complex_livery_data[$ target_role][$ colour_area] = _col; } else { - var _col = picker.chosen; - if (start_colour == -1) { - if (!_colour_area_chosen && target_role >= 1 && target_role <= 7) { - start_colour = variable_instance_get(obj_creation, type_fields[target_role]); - } else if (_colour_area_chosen) { - var role_data = obj_creation.complex_livery_data[$ target_role]; - if (is_struct(role_data) && struct_exists(role_data, colour_area)) { - start_colour = role_data[$ colour_area]; - } - } + if (_col == -1) { + _col = start_colour; } - if (is_array(_col)) { - if (_colour_area_chosen) { - obj_creation.complex_livery_data[$ target_role][$ colour_area] = _col; - } - } else { - if (_col == -1) { - _col = start_colour; - } - - if (!_colour_area_chosen && target_role >= 1 && target_role <= 7) { - variable_instance_set(obj_creation, type_fields[target_role], _col); - } - - with (obj_creation) { - bulk_selection_buttons_setup(); - } - - if (_colour_area_chosen) { - obj_creation.complex_livery_data[$ target_role][$ colour_area] = _col; - with (obj_creation) { - set_complex_livery_buttons(); - } - } + obj_creation.complex_livery_data[$ target_role][$ colour_area] = _col; + with (obj_creation) { + set_complex_livery_buttons(); } + } - }; + } } else if (type == ePOPUP_TYPE.EQUIP) { role_name_input = new TextBarArea(800, 170, 380, true); diff --git a/objects/obj_creation_popup/Draw_0.gml b/objects/obj_creation_popup/Draw_0.gml index 3ad0e9c8af..b3fc51087b 100644 --- a/objects/obj_creation_popup/Draw_0.gml +++ b/objects/obj_creation_popup/Draw_0.gml @@ -2,8 +2,13 @@ try { tooltip = ""; tooltip2 = ""; - if (type == ePOPUP_TYPE.LIVERYPICK && target_role > 0) { - assign_picked_liveries(); + if (type == ePOPUP_TYPE.LIVERYPICK ) { + if (livery_pick_type == eLIVERY_COLOURING_OPTIONS.BULK){ + assign_picked_liveries(); + } else if (livery_pick_type == eLIVERY_COLOURING_OPTIONS.ADVANCED){ + assign_complex_picked_liveries(); + } + } else if (type == ePOPUP_TYPE.EQUIP) { draw_popup_equip(before_after_styling); draw_set_font(cjk_font(fnt_40k_30b)); @@ -17,20 +22,6 @@ try { _role_data.role = role_name_input.draw(_role_name); } } - - if ((tooltip != "") && (obj_creation.change_slide <= 0)) { - draw_set_alpha(1); - draw_set_font(cjk_font(fnt_40k_14)); - draw_set_halign(fa_left); - draw_set_color(0); - draw_rectangle(mouse_x + 18, mouse_y + 20, mouse_x + string_width_ext(string_hash_to_newline(tooltip2), -1, 500) + 24, mouse_y + 44 + string_height_ext(string_hash_to_newline(tooltip2), -1, 500), 0); - draw_set_color(CM_GREEN_COLOR); - draw_rectangle(mouse_x + 18, mouse_y + 20, mouse_x + string_width_ext(string_hash_to_newline(tooltip2), -1, 500) + 24, mouse_y + 44 + string_height_ext(string_hash_to_newline(tooltip2), -1, 500), 1); - draw_set_font(cjk_font(fnt_40k_14b)); - draw_text(mouse_x + 22, mouse_y + 22, string_hash_to_newline(string(tooltip))); - draw_set_font(cjk_font(fnt_40k_14)); - draw_text_ext(mouse_x + 22, mouse_y + 42, string_hash_to_newline(string(tooltip2)), -1, 500); - } } catch (ex) { ERROR_HANDLER.handle_exception(ex); instance_destroy(); diff --git a/objects/obj_star_select/Draw_64.gml b/objects/obj_star_select/Draw_64.gml index de268462a6..1bc9467327 100644 --- a/objects/obj_star_select/Draw_64.gml +++ b/objects/obj_star_select/Draw_64.gml @@ -243,7 +243,6 @@ try { } else { garrison_data_slate.sub_title = ""; } - garrison_data_slate.body_text = garrison.garrison_report(); garrison_data_slate.inside_method = function() { diff --git a/scripts/enums/enums.gml b/scripts/enums/enums.gml index 17a4e5794b..cacf88d326 100644 --- a/scripts/enums/enums.gml +++ b/scripts/enums/enums.gml @@ -141,3 +141,15 @@ enum eEQUIPMENT_SLOT { MOBILITY, ALL, } + +enum eLIVERY_SELECTION_TYPES { + DEFAULT, + BY_ROLE, + BY_COMPANY +} + +enum eLIVERY_COLOURING_OPTIONS { + STANDARD, + BULK, + ADVANCED +} \ No newline at end of file diff --git a/scripts/scr_creation/scr_creation.gml b/scripts/scr_creation/scr_creation.gml index ccd6f65be9..c5fd226d38 100644 --- a/scripts/scr_creation/scr_creation.gml +++ b/scripts/scr_creation/scr_creation.gml @@ -21,11 +21,10 @@ function set_complex_livery_buttons() { _data.helm_secondary = clamp(_data.helm_secondary, 0, array_length(col) - 1); _data.helm_lens = clamp(_data.helm_lens, 0, array_length(col) - 1); - // --- Build button objects --- complex_livery_buttons = [ new UnitButtonObject({ x1: 500, - y1: 252, + y1: 272, style: "pixel", tooltip: localize("Primary Helm Colour\nPrimary helm colour of {0}", [localize(_name)]), label: localize("Helm Primary : {0}", [localize(get_colour_name(_data.helm_primary))]), @@ -35,7 +34,7 @@ function set_complex_livery_buttons() { }), new UnitButtonObject({ x1: 500, - y1: 287, + y1: 307, style: "pixel", tooltip: localize("Secondary Helm Colour\nSecondary helm colour of {0}", [localize(_name)]), label: localize("Helm Secondary : {0}", [localize(get_colour_name(_data.helm_secondary))]), @@ -45,7 +44,7 @@ function set_complex_livery_buttons() { }), new UnitButtonObject({ x1: 500, - y1: 322, + y1: 342, style: "pixel", tooltip: localize("Helm Lens Colour\nHelm lens colour of {0}", [localize(_name)]), label: localize("Lens : {0}", [localize(get_colour_name(_data.helm_lens))]), @@ -85,69 +84,44 @@ function update_creation_roles_radio(start_role = 1) { /// @self Asset.GMObject.obj_creation function bulk_selection_buttons_setup() { + //TODO add functionnality to alter draw positions of buttons + var _start_y = 320; + var _start_x = 500; var _button_data = [ { text: localize("Primary : {0}", [localize(col[main_color])]), tooltip: localize("Primary"), tooltip2: localize("The main color of your Astartes and their vehicles. And the colour of your chapters Ships"), - cords: [ - 500, - 287, - ], }, { text: localize("Secondary: {0}", [localize(col[secondary_color])]), tooltip: localize("Secondary"), tooltip2: localize("The secondary color of your Astartes and their vehicles."), - cords: [ - 500, - 322, - ], }, { text: localize("Pauldron 1: {0}", [localize(col[left_pauldron])]), tooltip: localize("First Pauldron"), tooltip2: localize("The color of your Astartes' left Pauldron. Normally this Pauldron displays their rank and designation."), - cords: [ - 500, - 357, - ], }, { text: localize("Pauldron 2: {0}", [localize(col[right_pauldron])]), tooltip: localize("Second Pauldron"), tooltip2: localize("The color of your Astartes' right Pauldron. Normally this Pauldron contains the Chapter Insignia."), - cords: [ - 500, - 392, - ], }, { text: localize("Trim: {0}", [localize(col[main_trim])]), tooltip: localize("Trim"), tooltip2: localize("The trim color that appears on the Pauldrons, armour plating, and any decorations."), - cords: [ - 500, - 427, - ], }, { text: localize("Lens: {0}", [localize(col[lens_color])]), tooltip: localize("Lens"), tooltip2: localize("The color of your Astartes' lenses. Most of the time this will be the visor color."), - cords: [ - 500, - 462, - ], }, { text: localize("Weapon: {0}", [localize(col[weapon_color])]), tooltip: localize("Weapon"), tooltip2: localize("The primary color of your Astartes' weapons."), - cords: [ - 500, - 497, - ], }, ]; bulk_buttons = []; @@ -155,8 +129,8 @@ function bulk_selection_buttons_setup() { for (var i = 0; i < array_length(_button_data); i++) { var _but = _button_data[i]; array_push(bulk_buttons, new UnitButtonObject({ - x1: _but.cords[0], - y1: _but.cords[1], + x1: _start_x, + y1: _start_y + (i * 35), style: "pixel", tooltip: $"{_but.tooltip}\n{_but.tooltip2}", label: _but.text, @@ -298,17 +272,17 @@ function scr_creation(slide_num) { { str1: localize("Default"), tooltip: localize("The default livery all marines will be coloured in"), - font: fnt_menu, + font: fnt_40k_14b, }, { str1: localize("Role"), tooltip: localize("Role specific livery that will overide default livery"), - font: fnt_menu, + font: fnt_40k_14b, }, { str1: localize("Company"), tooltip: localize("company specific livery that will overide role livery"), - font: fnt_menu, + font: fnt_40k_14b, }, ], ); @@ -317,17 +291,17 @@ function scr_creation(slide_num) { { str1: localize("Standard"), tooltip: localize("standard options to colour marine"), - font: fnt_menu, + font: fnt_40k_14b, }, { str1: localize("Bulk"), tooltip: localize("bulk colouring for ease and speed"), - font: fnt_menu, + font: fnt_40k_14b, }, { str1: localize("Advanced"), tooltip: localize("Advanced options for colouring"), - font: fnt_menu, + font: fnt_40k_14b, }, ], ); diff --git a/scripts/scr_livery_setup/scr_livery_setup.gml b/scripts/scr_livery_setup/scr_livery_setup.gml index 271a4158f6..b0a656aa75 100644 --- a/scripts/scr_livery_setup/scr_livery_setup.gml +++ b/scripts/scr_livery_setup/scr_livery_setup.gml @@ -18,7 +18,7 @@ function scr_livery_setup() { }; preview_box.x2 = preview_box.x1 + preview_box.w; preview_box.y2 = preview_box.y1 + preview_box.h; - colour_selection_options.update({x1: preview_box.x1 + 20, y1: 200}); + colour_selection_options.update({x1: preview_box.x1 + 20, y1: 220}); colour_selection_options.draw(); livery_picker.draw_base(); @@ -35,29 +35,30 @@ function scr_livery_setup() { draw_set_font(cjk_font(fnt_40k_30b)); - if (colour_selection_options.current_selection == 0) { + var _cur_colouring_options = colour_selection_options.current_selection; + if (_cur_colouring_options == eLIVERY_COLOURING_OPTIONS.STANDARD) { var _col_areas = livery_picker.colours_radio; _col_areas.current_selection = -1; - _col_areas.update({x1: colour_selection_options.x1, y1: colour_selection_options.y2, max_width: 200}); + _col_areas.update({x1: colour_selection_options.x1, y1: colour_selection_options.y2 + 20, max_width: 200}); _col_areas.draw(); if (_col_areas.changed) { livery_picker.new_colour_pick(_col_areas.selection_val("area_id")); } - } else if (colour_selection_options.current_selection == 1) { - var _updater = draw_unit_buttons([500, preview_box.y1 - 10], "Update Sprite"); + } else if (_cur_colouring_options == eLIVERY_COLOURING_OPTIONS.BULK) { + var _updater = draw_unit_buttons([500, preview_box.y1 + 20], "Update Sprite"); if (scr_hit(_updater)) { tooltip_draw("Click to Update Marine colour picker with Colour settings, warning this will overide Existing colour selections"); } if (point_and_click(_updater)) { var struct_cols = { - main_color: main_color, - secondary_color: secondary_color, - main_trim: main_trim, - right_pauldron: right_pauldron, - left_pauldron: left_pauldron, - lens_color: lens_color, - weapon_color: weapon_color, + main_color, + secondary_color, + main_trim, + right_pauldron, + left_pauldron, + lens_color, + weapon_color, }; livery_picker.set_default_armour(struct_cols, col_special); } @@ -75,9 +76,10 @@ function scr_livery_setup() { } } + bulk_armour_pattern.update({y1:bulk_buttons[6].y2 + 20}); bulk_armour_pattern.draw(); col_special = bulk_armour_pattern.current_selection; - } else { + } else if (_cur_colouring_options == eLIVERY_COLOURING_OPTIONS.ADVANCED){ for (var i = 0; i < array_length(complex_livery_buttons); i++) { var _button = complex_livery_buttons[i]; @@ -99,14 +101,13 @@ function scr_livery_setup() { draw_set_font(cjk_font(fnt_40k_14b)); draw_set_halign(fa_left); var spacing = 30; - var xxx = 862; - var yyy = 255 - spacing; - livery_selection_options.update({x1: 862, y1: 200, max_width: 800}); + livery_selection_options.update({x1: 862, y1: 220, max_width: 800}); var _prev_val = variable_clone(livery_selection_options.current_selection); - if (colour_selection_options.current_selection != 2) { + var _non_advanced_painting = colour_selection_options.current_selection != eLIVERY_COLOURING_OPTIONS.ADVANCED; + if (_non_advanced_painting) { livery_selection_options.draw(); } @@ -119,14 +120,14 @@ function scr_livery_setup() { var _livery_type = livery_selection_options.current_selection; - if (colour_selection_options.current_selection != 2 && !_update_sprite) { - if (_livery_type == 1) { + if (_non_advanced_painting && !_update_sprite) { + if (_livery_type == eLIVERY_SELECTION_TYPES.BY_ROLE) { roles_radio.update({x1: 882, y1: livery_selection_options.y2 + 20, allow_changes: custom == eCHAPTER_TYPE.CUSTOM}); roles_radio.draw(); if (roles_radio.changed) { livery_picker.swap_role_set(1, 1); } - } else if (_livery_type == 2) { + } else if (_livery_type == eLIVERY_SELECTION_TYPES.BY_COMPANY) { company_radio.update({max_width: 350, x1: 862, y1: livery_selection_options.y2 + 20, allow_changes: true}); company_radio.draw(); if (company_radio.changed) {