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
30 changes: 17 additions & 13 deletions objects/obj_creation_popup/Draw_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ if (col_shift){
}
if (is_string(type)){
obj_creation.complex_livery_data[$ role][$ type] = _col;
set_complex_livery_buttons();
with (obj_creation){
set_complex_livery_buttons();
}
}
}
}
Expand Down Expand Up @@ -187,7 +189,9 @@ if (col_shift){
}

instance_destroy();
update_creation_roles_radio();
with (obj_creation){
update_creation_roles_radio();
}
}

draw_set_halign(fa_left);
Expand Down Expand Up @@ -246,18 +250,18 @@ if (target_gear > 0) {
if (scr_click_left()) {
var buh = item_name[h] == ITEM_NAME_NONE ? "" : item_name[h];
switch (target_gear) {
case 1: obj_creation.wep1[co, ide] = buh; break;
case 2: obj_creation.wep2[co, ide] = buh; break;
case 3: obj_creation.armour[co, ide] = buh; break;
case 4: obj_creation.gear[co, ide] = buh; break;
case 5: obj_creation.mobi[co, ide] = buh; break;
case 0: obj_creation.wep1[co, ide] = buh; break;
case 1: obj_creation.wep2[co, ide] = buh; break;
case 2: obj_creation.armour[co, ide] = buh; break;
case 3: obj_creation.gear[co, ide] = buh; break;
case 4: obj_creation.mobi[co, ide] = buh; break;
}
target_gear = 0;
}
}
}

if (target_gear == 1 || target_gear == 2) {
if (target_gear == EquipmentSlot.WEAPON_ONE || target_gear == EquipmentSlot.WEAPON_TWO) {
tab = 2;
item_name = [];
scr_get_item_names(
Expand Down Expand Up @@ -287,11 +291,11 @@ if (target_gear > 0) {
if (scr_click_left()) {
var buh = item_name[h] == ITEM_NAME_NONE ? "" : item_name[h];
switch (target_gear) {
case 1: obj_creation.wep1[co, ide] = buh; break;
case 2: obj_creation.wep2[co, ide] = buh; break;
case 3: obj_creation.armour[co, ide] = buh; break;
case 4: obj_creation.gear[co, ide] = buh; break;
case 5: obj_creation.mobi[co, ide] = buh; break;
case 0: obj_creation.wep1[co, ide] = buh; break;
case 1: obj_creation.wep2[co, ide] = buh; break;
case 2: obj_creation.armour[co, ide] = buh; break;
case 3: obj_creation.gear[co, ide] = buh; break;
case 4: obj_creation.mobi[co, ide] = buh; break;
}
target_gear = 0;
}
Expand Down
33 changes: 22 additions & 11 deletions scripts/scr_buttons/scr_buttons.gml
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ function RadioSet(options_array, title="", data = {})constructor{
add_draw_return_values();

draw_set_halign(fa_center);
if (max_width > 0){
if (max_width > 0 && string_length(draw_title) < max_width){
if (draw_title){
draw_text(x1+(max_width/2) - (string_length(draw_title)/2), y1, title);
}
Expand All @@ -547,17 +547,17 @@ function RadioSet(options_array, title="", data = {})constructor{
_cur_opt.x1 = _prev_x;
_cur_opt.y1 = _prev_y;
_cur_opt.update()
_cur_opt.active = i==current_selection;
_cur_opt.active = i == current_selection;
_cur_opt.button_color = _cur_opt.active ? active_col: inactive_col;
_cur_opt.draw();
items_on_row++
items_on_row++;

if (_cur_opt.clicked() && allow_changes){
current_selection = i;
}
_prev_x = _cur_opt.x2+x_gap;
_prev_x = _cur_opt.x2 + x_gap;

x2 = _prev_x>x2 ? _prev_x:x2;
x2 = _prev_x > x2 ? _prev_x : x2;
y2 = _prev_y + _cur_opt.height;
if (max_width>0){
if (_prev_x - x1 > max_width){
Expand All @@ -574,6 +574,9 @@ function RadioSet(options_array, title="", data = {})constructor{
}

static selection_val = function(value){
if (current_selection == -1){
return noone;
}
return toggles[current_selection][$value];
}
}
Expand All @@ -596,6 +599,9 @@ function ToggleButton(data={}) constructor {
font = fnt_40k_12;
style = "default";

//make true to run clicked() within draw sequence
clicked_check_default = false;

update = function () {
add_draw_return_values();
draw_set_font(font);
Expand All @@ -607,8 +613,8 @@ function ToggleButton(data={}) constructor {
height = string_height(str1) + 4;
}
}else if (style == "box"){
width = max(32, string_width(str1)/2) + 6;
height = 32;
width = max(32, string_width(str1)) + 6;
height = 32 + 2 +string_height(str1);
}
x2 = x1 + width;
y2 = y1 + height;
Expand All @@ -633,7 +639,8 @@ function ToggleButton(data={}) constructor {
}
};

draw = function() {
draw = function(is_active = active) {
self.active = is_active;
add_draw_return_values();
draw_set_font(font);
var str1_h = string_height(str1);
Expand Down Expand Up @@ -674,16 +681,20 @@ function ToggleButton(data={}) constructor {
draw_set_halign(fa_left);
} else if (style == "box"){
// Icon with alpha
draw_sprite_ext(spr_creation_check, active, x1, y1, 1, 1, 0, c_white, total_alpha);
draw_set_halign(fa_left);
draw_sprite_ext(spr_creation_check, active, x1 + 2, y1, 1, 1, 0, c_white, total_alpha);
// Label centred below icon
draw_set_alpha(total_alpha);
draw_set_valign(fa_top);
draw_set_halign(fa_center);
var _label_y = y1 + 32 + 4;
draw_text_transformed(x1 + width/2, _label_y, str1, 1, 1, 0);
var _label_y = y1 + 32 + 2;
draw_text_transformed(x1+18 , _label_y, str1, 1, 1, 0);
draw_set_alpha(1);
}

if (clicked_check_default){
clicked();
}
pop_draw_return_values();
};
}
Expand Down
4 changes: 4 additions & 0 deletions scripts/scr_complex_colour_kit/scr_complex_colour_kit.gml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ function ColourItem(xx,yy) constructor{
switch(type_end){
case 1:
role_set = obj_creation.roles_radio.selection_val("role_id");
role_set = role_set == noone ? 0: role_set;
map_colour = variable_clone(_full_livs[role_set]);
break;
case 0:
Expand All @@ -34,6 +35,9 @@ function ColourItem(xx,yy) constructor{
break;
case 2:
role_set = obj_creation.buttons.company_liveries_choice.current_selection;
if (role_set == -1){
role_set = 1;
}
map_colour = variable_clone(_comp_livs[role_set]);
break;
}
Expand Down
3 changes: 2 additions & 1 deletion scripts/scr_creation/scr_creation.gml
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ function scr_creation(slide_num) {
font : fnt_40k_12,
style : "box",
},
], "", {x1 : 437, y1 : 500, max_width : 400});
], "", {x1 : 477, y1 : 515, max_width : 400});

set_complex_livery_buttons();

Expand Down Expand Up @@ -317,6 +317,7 @@ function scr_creation(slide_num) {
change_slide=true;
goto_slide=eCREATIONSLIDES.CHAPTERROLES;
update_creation_roles_radio();
role_setup_objects();
}
}

Expand Down
2 changes: 2 additions & 0 deletions scripts/scr_livery_setup/scr_livery_setup.gml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Script assets have changed for v2.3.0 see
// https://help.yoyogames.com/hc/en-us/articles/360005277377 for more information
function scr_livery_setup(){
add_draw_return_values();
draw_set_font(fnt_40k_30b);
draw_set_halign(fa_center);
draw_set_alpha(1);
Expand Down Expand Up @@ -222,4 +223,5 @@ function scr_livery_setup(){
}

right_data_slate.draw(1210, 5,0.45, 1);
pop_draw_return_values();
}
Loading