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
6 changes: 6 additions & 0 deletions ChapterMaster.yyp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@
"IncludedFiles": [
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"traits.json","CopyToMask":-1,"filePath":"datafiles/data",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"custom_icons_help.txt","CopyToMask":153157610357391598,"filePath":"datafiles/icons",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"custom1.png","CopyToMask":-1,"filePath":"datafiles/icons",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"custom2.png","CopyToMask":-1,"filePath":"datafiles/icons",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"1.png","CopyToMask":-1,"filePath":"datafiles/images/advisor/splash",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"11.png","CopyToMask":-1,"filePath":"datafiles/images/advisor/splash",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"12.png","CopyToMask":-1,"filePath":"datafiles/images/advisor/splash",},
Expand Down Expand Up @@ -961,6 +963,10 @@
{"id":{"name":"spr_ground_las","path":"sprites/spr_ground_las/spr_ground_las.yy",},},
{"id":{"name":"spr_weapon_standard2","path":"sprites/spr_weapon_standard2/spr_weapon_standard2.yy",},},
{"id":{"name":"spr_mk7_right_trim","path":"sprites/spr_mk7_right_trim/spr_mk7_right_trim.yy",},},
{"id":{"name":"spr_unit_card_icons","path":"sprites/spr_unit_card_icons/spr_unit_card_icons.yy",},},
{"id":{"name":"spr_pixel_button_right","path":"sprites/spr_pixel_button_right/spr_pixel_button_right.yy",},},
{"id":{"name":"spr_pixel_button_middle","path":"sprites/spr_pixel_button_middle/spr_pixel_button_middle.yy",},},
{"id":{"name":"spr_pixel_button_left","path":"sprites/spr_pixel_button_left/spr_pixel_button_left.yy",},},
{"id":{"name":"spr_green_las","path":"sprites/spr_green_las/spr_green_las.yy",},},
{"id":{"name":"spr_ground_conv","path":"sprites/spr_ground_conv/spr_ground_conv.yy",},},
{"id":{"name":"spr_mk4_right_trim","path":"sprites/spr_mk4_right_trim/spr_mk4_right_trim.yy",},},
Expand Down
Binary file modified fonts/fnt_menu/fnt_menu.old.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified fonts/fnt_menu/fnt_menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 42 additions & 3 deletions scripts/scr_buttons/scr_buttons.gml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ function UnitButtonObject(data = false) constructor{
v_gap= 4;
label= "";
alpha= 1;
color= #50a076;
color = #50a076;
keystroke = false;
tooltip = "";
bind_method = "";
style = "standard";
font=fnt_40k_14b


static update_loc = function(){
Expand Down Expand Up @@ -107,19 +109,56 @@ function UnitButtonObject(data = false) constructor{
}
}
static draw = function(allow_click = true){
var cur_alpha = draw_get_alpha();
var cur_font = draw_get_font();
var cur_color = draw_get_color();
var cur_halign = draw_get_halign();
var cur_valign = draw_get_valign();
if (style = "standard"){
var _button_click_area = draw_unit_buttons(w > 0 ? [x1, y1, x2, y2] : [x1, y1] , label, [1,1],color,,font,alpha);
} else if (style = "pixel"){

var _widths = [sprite_get_width(spr_pixel_button_left), sprite_get_width(spr_pixel_button_middle), sprite_get_width(spr_pixel_button_right)]

var height_scale = h/sprite_get_height(spr_pixel_button_left);
_widths[0]*=height_scale;
_widths[2]*=height_scale;
draw_sprite_ext(spr_pixel_button_left, 0, x1, y1, height_scale, height_scale, 0, c_white, 1);
var _width_scale = w/_widths[1];
_widths[1] *= _width_scale;
draw_sprite_ext(spr_pixel_button_middle, 0, x1 + _widths[0], y1, _width_scale, height_scale, 0, c_white, 1);
draw_sprite_ext(spr_pixel_button_right, 0, x1 + _widths[0] + _widths[1] ,y1, height_scale, height_scale, 0, c_white, 1);
var _text_position_x = x1 + ((_widths[0] + 2) * height_scale);
_text_position_x += (_widths[1]) / 2;
draw_set_font(font);
draw_set_halign(fa_center);
draw_set_valign(fa_middle);
draw_set_color(color);
draw_text_transformed(_text_position_x, y1 + ( (h * height_scale)/2), label, 1, 1, 0);

x2 = x1 + array_sum(_widths);
y2 = y1 + h;
var _button_click_area = [x1, y1, x2, y2];
}
draw_set_alpha(cur_alpha);
draw_set_font(cur_font);
draw_set_color(cur_color);
draw_set_halign(cur_halign);
draw_set_valign(cur_valign);

if (scr_hit(x1, y1, x2, y2) && tooltip!=""){
tooltip_draw(tooltip);
}

if (allow_click){
var clicked = point_and_click(draw_unit_buttons(w > 0 ? [x1, y1, x2, y2] : [x1, y1] , label, [1,1],color,,,alpha)) || keystroke;
var clicked = point_and_click(_button_click_area) || keystroke;
if (clicked){
if (is_callable(bind_method)){
bind_method();
}
}
return clicked
} else {
draw_unit_buttons([x1, y1, x2, y2], label, [1,1],color,,,alpha);
return false;
}
}
Expand Down
19 changes: 19 additions & 0 deletions scripts/scr_controller_helpers/scr_controller_helpers.gml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,25 @@ function scr_toggle_manage(){
popup=0;
selected=0;
hide_banner=1;
management_buttons = {
squad_toggle : new UnitButtonObject({
style : "pixel",
label : "Squad View",
tooltip : "Click here or press S to toggle Squad View."
}),

profile_toggle : new UnitButtonObject({
style : "pixel",
label : "Show Profile",
tooltip : "Click here or press P to show unit profile."
}),

bio_toggle : new UnitButtonObject({
style : "pixel",
label : "Show Bio",
tooltip : "Click here or press B to Toggle Unit Biography."
}),
}
}
else if (menu==1){
menu=0;
Expand Down
Loading