Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 48 additions & 38 deletions objects/obj_creation_popup/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ start_colour = -1;
col_shift = false;
bulk_buttons = [];

tooltip = "";
tooltip2 = "";
item_name = [];
role_names_all = "";
warning = "";
Expand Down Expand Up @@ -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] : "";
Expand All @@ -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);

Expand Down
23 changes: 7 additions & 16 deletions objects/obj_creation_popup/Draw_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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();
Expand Down
1 change: 0 additions & 1 deletion objects/obj_star_select/Draw_64.gml
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
12 changes: 12 additions & 0 deletions scripts/enums/enums.gml
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
54 changes: 14 additions & 40 deletions scripts/scr_creation/scr_creation.gml
Original file line number Diff line number Diff line change
Expand Up @@ -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))]),
Expand All @@ -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))]),
Expand All @@ -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))]),
Expand Down Expand Up @@ -85,78 +84,53 @@ 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 = [];
draw_set_font(cjk_font(fnt_40k_14b));
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),
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
style: "pixel",
tooltip: $"{_but.tooltip}\n{_but.tooltip2}",
label: _but.text,
Expand Down Expand Up @@ -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,
},
],
);
Expand All @@ -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,
},
],
);
Expand Down
Loading
Loading