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
3 changes: 3 additions & 0 deletions ChapterMaster.yyp
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,7 @@
{"id":{"name":"scr_load","path":"scripts/scr_load/scr_load.yy",},},
{"id":{"name":"scr_log","path":"scripts/scr_log/scr_log.yy",},},
{"id":{"name":"scr_loyalty","path":"scripts/scr_loyalty/scr_loyalty.yy",},},
{"id":{"name":"scr_manage_tags","path":"scripts/scr_manage_tags/scr_manage_tags.yy",},},
{"id":{"name":"scr_manage_task_selector","path":"scripts/scr_manage_task_selector/scr_manage_task_selector.yy",},},
{"id":{"name":"scr_management","path":"scripts/scr_management/scr_management.yy",},},
{"id":{"name":"scr_map_and_warp_functions","path":"scripts/scr_map_and_warp_functions/scr_map_and_warp_functions.yy",},},
Expand Down Expand Up @@ -1588,7 +1589,9 @@
{"id":{"name":"spr_skull_on_chain","path":"sprites/spr_skull_on_chain/spr_skull_on_chain.yy",},},
{"id":{"name":"spr_skulls_belt","path":"sprites/spr_skulls_belt/spr_skulls_belt.yy",},},
{"id":{"name":"spr_slate_2","path":"sprites/spr_slate_2/spr_slate_2.yy",},},
{"id":{"name":"spr_slate_featureless","path":"sprites/spr_slate_featureless/spr_slate_featureless.yy",},},
{"id":{"name":"spr_slate_side","path":"sprites/spr_slate_side/spr_slate_side.yy",},},
{"id":{"name":"spr_slate_top","path":"sprites/spr_slate_top/spr_slate_top.yy",},},
{"id":{"name":"spr_sororitas1","path":"sprites/spr_sororitas1/spr_sororitas1.yy",},},
{"id":{"name":"spr_space_bg","path":"sprites/spr_space_bg/spr_space_bg.yy",},},
{"id":{"name":"spr_special_helm","path":"sprites/spr_special_helm/spr_special_helm.yy",},},
Expand Down
2 changes: 2 additions & 0 deletions objects/obj_controller/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -437,11 +437,13 @@ company_report=false;
company_data = {};
obj_controller.unit_focus = false;
filter_mode = false;
manage_tags = [];
pauldron_trim=0;
last_unit=[0,0];
ui_coloring="";
ui_melee_penalty=0;
ui_ranged_penalty=0;
management_tags = [];

// ** Sets default mouse vars **
current_target=false;
Expand Down
3 changes: 3 additions & 0 deletions objects/obj_controller/Draw_64.gml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ if (menu == 1) {
if (managing == -1){
scr_manage_task_selector();
}
if (managing > 0){
company_specific_management();
}

} else if (menu == MENU.Armamentarium) {
scr_draw_armentarium_gui();
Expand Down
1 change: 1 addition & 0 deletions objects/obj_controller/Step_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,7 @@ try {
}
// Check if fleet is minimized or not
if (instance_exists(obj_popup)) {
allow_shortcuts = false;
if (obj_popup.type == 99) {
fleet_minimized = 1;
}
Expand Down
2 changes: 2 additions & 0 deletions objects/obj_popup/Draw_64.gml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@
draw_gift_items_popup();
} else if (type == POPUP_TYPE.ARTIFACT_EQUIP){
equip_artifact_popup_draw();
} else if (type == POPUP_TYPE.ADD_TAGS){
draw_tag_manager();
}
19 changes: 18 additions & 1 deletion scripts/scr_DataSlate/scr_DataSlate.gml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ function DataSlate(data={}) constructor{
percent_cut=0;
set_width = false;

top_anchor = [340, 14];

style = "default";

tooltip_drawing = [];
Expand All @@ -19,6 +21,11 @@ function DataSlate(data={}) constructor{

move_data_to_current_scope(data, true);

draw_top_piece = true;

top_piece_style = "aquila";


static entered = function(){
return (scr_hit(
XX-4,
Expand Down Expand Up @@ -53,9 +60,11 @@ function DataSlate(data={}) constructor{
height = 850*scale_y;
}

decoration_scale = min(scale_x, scale_y)

switch (style){
case "default":
draw_sprite_ext(spr_data_slate,1, XX,YY, scale_x, scale_y, 0, c_white, 1);
draw_sprite_ext(spr_slate_featureless,1, XX,YY, scale_x, scale_y, 0, c_white, 1);
break;
case "decorated":
draw_sprite_stretched(spr_data_slate_back, 0, XX,YY, width, height);
Expand Down Expand Up @@ -103,6 +112,14 @@ function DataSlate(data={}) constructor{
var _slate_scaley = height/sprite_get_height(spr_slate_side);
draw_sprite(spr_data_slate_corner_decoration, 0,XX+width - (70*_slate_scalex), YY + (7*_slate_scaley));
break;
case "default":
if (draw_top_piece){
if (top_piece_style == "aquila"){
draw_sprite_ext(spr_slate_top,1, XX+(top_anchor[0]*scale_x),YY + (top_anchor[1] * scale_y ), decoration_scale, decoration_scale, 0, c_white, 1);
}

}
break;

}
x2 = XX+width;
Expand Down
16 changes: 16 additions & 0 deletions scripts/scr_array_functions/scr_array_functions.gml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,22 @@ function array_delete_value(choice_array, value){
array_delete(choice_array, i, 1);
}
}

return choice_array;
}

function array_delete_values(choice_array, values){
for (var i = array_length(choice_array) - 1; i >= 0; i--) {
for (var s=0;s<array_length(values);s++){
var _val = values[s];
if (choice_array[i] == _val) {
array_delete(choice_array, i, 1);
break;
}
}
}

return choice_array;
}

function array_random_element(choice_array){
Expand Down
64 changes: 42 additions & 22 deletions scripts/scr_buttons/scr_buttons.gml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ function UnitButtonObject(data = false) constructor{
label= "";
alpha= 1;
color = #50a076;
inactive_col = c_gray;
keystroke = false;
tooltip = "";
bind_method = "";
Expand Down Expand Up @@ -293,11 +294,13 @@ function TextBarArea(XX,YY,Max_width = 400, requires_input = false) constructor{
max_width = Max_width;
draw_col = c_gray;
cooloff=0
background = new DataSlate();
background.draw_top_piece = false;

// Draw BG
current_text = ""
static draw = function(string_area){
add_draw_return_values();
var old_font = draw_get_font();
var old_halign = draw_get_halign();

if (cooloff>0) then cooloff--;
if (allow_input){
Expand All @@ -311,15 +314,21 @@ function TextBarArea(XX,YY,Max_width = 400, requires_input = false) constructor{
var bar_wid=max_width,click_check, string_h;
draw_set_alpha(0.25);
if (string_area!=""){
bar_wid=max(max_width,string_width(string_hash_to_newline(string_area)));
bar_wid=max(max_width,string_width(string_area));
} else {
if (requires_input){
draw_set_color(c_red);
draw_set_color(CM_RED_COLOR);
} else {
draw_set_color(CM_GREEN_COLOR)
}
}
string_h = string_height("LOL");
var rect = [xx-(bar_wid/2),yy,xx+(bar_wid/2),yy-8+string_h]
draw_rectangle(rect[0],rect[1],rect[2],rect[3],1);
background.XX = rect[0];
background.YY = rect[1];
background.width = rect[2] - rect[0];
background.height = rect[3] - rect[1];

click_check = point_and_click(rect);
obj_cursor.image_index=0;
if (cooloff==0){
Expand All @@ -337,17 +346,18 @@ function TextBarArea(XX,YY,Max_width = 400, requires_input = false) constructor{
draw_set_alpha(1);

draw_set_font(fnt_fancy);
if (!allow_input) then draw_text(xx,yy+2,string_hash_to_newline("''"+string(string_area)+"'' "));
if (allow_input){
obj_cursor.image_index=2;
draw_text(xx,yy+2,$"''{string_area}|''")
};

draw_set_font(old_font);
draw_set_halign(old_halign);

current_text = string_area;
background.inside_method = function(){
draw_set_valign(fa_top);
if (!allow_input) then draw_text(xx,yy+2,$"''{current_text}'' ");
if (allow_input){
obj_cursor.image_index=2;
draw_text(xx,yy+2,$"''{current_text}|''")
};
}
background.draw_with_dimensions();
pop_draw_return_values();
return string_area;
pop_draw_return_values();
}
}

Expand Down Expand Up @@ -390,7 +400,7 @@ function drop_down(selection, draw_x, draw_y, options,open_marker){
pop_draw_return_values();
}

function multi_select(options_array, title)constructor{
function multi_select(options_array, title, data = {})constructor{
self.title = title;
x_gap = 10;
y_gap = 5;
Expand All @@ -400,7 +410,7 @@ function multi_select(options_array, title)constructor{
y2 = 0;
on_change = false;
active_col = #009500;
innactive_col = c_gray;
inactive_col = c_gray;
max_width = 0;
max_height = 0;
toggles = [];
Expand All @@ -410,7 +420,10 @@ function multi_select(options_array, title)constructor{
array_push(toggles, _next_tog);
}
static update = item_data_updater
static draw = function(){

update(data);

static draw = function(allow_changes = true){
add_draw_return_values();
var _change_method = is_callable(on_change);
draw_text(x1, y1, title);
Expand All @@ -423,12 +436,12 @@ function multi_select(options_array, title)constructor{
_cur_opt.x1 = _prev_x;
_cur_opt.y1 = _prev_y;
_cur_opt.update()
if (_cur_opt.clicked()){
if (_cur_opt.clicked() && allow_changes){
if (_change_method){
on_change();
}
}
_cur_opt.button_color = _cur_opt.active ? active_col: innactive_col;
_cur_opt.button_color = _cur_opt.active ? active_col: inactive_col;
_cur_opt.draw();
items_on_row++

Expand Down Expand Up @@ -458,6 +471,13 @@ function multi_select(options_array, title)constructor{
}
}
}

static deselect_all = function(){
for (var i=0;i<array_length(toggles);i++){
var _cur_opt = toggles[i];
_cur_opt.active = false;
}
}
static selections = function(){
var _selecs = [];
for (var i=0;i<array_length(toggles);i++){
Expand All @@ -481,7 +501,7 @@ function radio_set(options_array, title, data = {})constructor{
current_selection = 0;
self.title = title;
active_col = #009500;
innactive_col = c_gray;
inactive_col = c_gray;
allow_changes = true;
x_gap = 10;
y_gap = 5;
Expand Down Expand Up @@ -524,7 +544,7 @@ function radio_set(options_array, title, data = {})constructor{
_cur_opt.y1 = _prev_y;
_cur_opt.update()
_cur_opt.active = i==current_selection;
_cur_opt.button_color = _cur_opt.active ? active_col: innactive_col;
_cur_opt.button_color = _cur_opt.active ? active_col: inactive_col;
_cur_opt.draw();
items_on_row++

Expand Down
4 changes: 2 additions & 2 deletions scripts/scr_clean/scr_clean.gml
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ function damage_infantry(_damage_data, _shots, _damage) {
// Check if marine is dead
if (check_dead_marines(marine, marine_index)) {
// Remove dead infantry from further hits
array_delete_value(valid_marines, marine_index);
valid_marines = array_delete_value(valid_marines, marine_index);
_damage_data.units_lost++;
}
}
Expand Down Expand Up @@ -300,7 +300,7 @@ function damage_vehicles(_damage_data, _shots, _damage) {
}

// Remove dead vehicles from further hits
array_delete_value(valid_vehicles, veh_index);
valid_vehicles = array_delete_value(valid_vehicles, veh_index);
}
}

Expand Down
5 changes: 3 additions & 2 deletions scripts/scr_company_view/scr_company_view.gml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function reset_manage_arrays() {
ma_view = [];
squad = [];
}
manage_tags = [];
reset_ship_manage_arrays();
}

Expand Down Expand Up @@ -493,13 +494,13 @@ function company_manage_actions(){
unit_profile=false;
}
// Previous company
if (point_and_click([xx+424, yy+80,xx+496,yy+128]) || keyboard_check_pressed(ord(string("N")))){
if (point_and_click([xx+424, yy+80,xx+496,yy+128]) || (keyboard_check_pressed(ord(string("N"))) && allow_shortcuts)){
var new_view = managing == 1 ? 15 : managing-1;
switch_view_company(new_view)
}

// Next company
if (point_and_click([xx+1105, yy+80,xx+1178,yy+128]) || keyboard_check_pressed(ord(string("M")))){
if (point_and_click([xx+1105, yy+80,xx+1178,yy+128]) || (keyboard_check_pressed(ord(string("M"))) && allow_shortcuts)){
var new_view = managing == 15 ? 1 : managing+1;
switch_view_company(new_view)
}
Expand Down
4 changes: 3 additions & 1 deletion scripts/scr_controller_helpers/scr_controller_helpers.gml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ function basic_manage_settings() {
popup = 0;
selected = 0;
diplomacy = 0;
allow_shortcuts = true;
management_buttons = {
squad_toggle: new UnitButtonObject({
style: "pixel",
Expand All @@ -165,7 +166,8 @@ function basic_manage_settings() {
style: "pixel",
label: "Show Bio",
tooltip: "Click here or press B to Toggle Unit Biography."
})
}),
company_namer : new TextBarArea(800, 108, 600, false),
};
}

Expand Down
Loading