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
107 changes: 106 additions & 1 deletion objects/obj_controller/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,6 @@ managing=0;
formating=0;
man_current=0;
man_max=0;
man_see=0;
ship_current=0;
ship_max=0;
ship_see=0;
Expand Down Expand Up @@ -1788,3 +1787,109 @@ remov=string_length(string(temp[65])+string(temp[66])+string(temp[67])+string(te
action_set_alarm(2, 0);

instance_create(0,0,obj_tooltip );

get_command_slots_data = function(){
var _command_slots_data = [
{
search_params: {},
role_group_params: {
group: "captain_candidates",
location: "",
opposite: false
},
purpose: $"{int_to_roman(managing)} Company Captain Candidates",
purpose_code: "captain_promote",
button_text: "New Captain Required",
unit_check: "captain"
},
{
search_params: {
stat: [["weapon_skill", 44, "more"]],
companies: managing
},
role_group_params: {
group: [SPECIALISTS_STANDARD, true, true],
location: "",
opposite: true
},
purpose: $"{int_to_roman(managing)} Company Champion Candidates",
purpose_code: "champion_promote",
button_text: "Champion Required",
unit_check: "champion"
},
{
search_params: {
companies: managing
},
role_group_params: {
group: [SPECIALISTS_STANDARD, true, true],
location: "",
opposite: true
},
purpose: $"{int_to_roman(managing)} Company Ancient Candidates",
purpose_code: "ancient_promote",
button_text: "Ancient Required",
unit_check: "ancient"
},
{
search_params: {
companies: [managing, 0]
},
role_group_params: {
group: [SPECIALISTS_CHAPLAINS, false, false],
location: "",
opposite: false
},
purpose: $"{int_to_roman(managing)} Company Chaplain Candidates",
purpose_code: "chaplain_promote",
button_text: "Chaplain Required",
unit_check: "chaplain"
},
{
search_params: {
companies: [managing, 0]
},
role_group_params: {
group: [SPECIALISTS_APOTHECARIES, false, false],
location: "",
opposite: false
},
purpose: $"{int_to_roman(managing)} Company Apothecary Candidates",
purpose_code: "apothecary_promote",
button_text: "Apothecary Required",
unit_check: "apothecary"
},
{
search_params: {
companies: [managing, 0]
},
role_group_params: {
group: [SPECIALISTS_TECHS, false, false],
location: "",
opposite: false
},
purpose: $"{int_to_roman(managing)} Company Tech Marine Candidates",
purpose_code: "tech_marine_promote",
button_text: "Tech Marine Required",
unit_check: "tech_marine"
},
{
search_params: {
companies: [managing, 0]
},
role_group_params: {
group: [SPECIALISTS_LIBRARIANS, false, false],
location: "",
opposite: false
},
purpose: $"{int_to_roman(managing)} Company Librarian Candidates",
purpose_code: "librarian_promote",
button_text: "Librarian Required",
unit_check: "lib"
}
];

return _command_slots_data;
}

command_slots_count=array_length(get_command_slots_data());
10 changes: 5 additions & 5 deletions objects/obj_controller/Mouse_61.gml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
var __b__ = action_if_number(obj_popup, 0, 0);
if (__b__){
if (menu==1) and (managing>0 || managing=-1) and (man_max>0){
if ((man_current+man_see+1)<man_max) then man_current+=1;
if ((man_current+man_see+1)<man_max) then man_current+=1;
if ((man_current+MANAGE_MAN_SEE+1)<man_max) then man_current+=1;
if ((man_current+MANAGE_MAN_SEE+1)<man_max) then man_current+=1;
}
if (menu==30) and (managing>0) and (man_max>=10){
if ((ship_current+ship_see+1)<ship_max) then ship_current+=1;
Expand All @@ -13,8 +13,8 @@ if (__b__){
if ((ship_current+ship_see+1)<ship_max) then ship_current+=1;
if ((ship_current+ship_see+1)<ship_max) then ship_current+=1;
}
if (menu==16) and (man_max>34){
if ((man_current+man_see+1)<man_max) then man_current+=1;
if ((man_current+man_see+1)<man_max) then man_current+=1;
if (menu==16) and (man_max>MANAGE_MAN_SEE){
if ((man_current+MANAGE_MAN_SEE+1)<man_max) then man_current+=1;
if ((man_current+MANAGE_MAN_SEE+1)<man_max) then man_current+=1;
}
}
3 changes: 1 addition & 2 deletions scripts/is_specialist/is_specialist.gml
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,7 @@ function group_selection(group, selection_data) {
}
other_manage_data();
man_current = 0;
man_max = array_length(display_unit) + 2;
man_see = 38 - 4;
man_max = MANAGE_MAN_MAX;
}
} catch (_exception) {
//handle and send player back to map
Expand Down
2 changes: 2 additions & 0 deletions scripts/macros/macros.gml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#macro TIME_1 $"{format_time(current_hour)}:{format_time(current_minute)}:{format_time(current_second)}"
#macro CM_GREEN_COLOR #34bc75
#macro CM_RED_COLOR #bf4040
#macro MANAGE_MAN_SEE 34
#macro MANAGE_MAN_MAX array_length(obj_controller.display_unit) + obj_controller.command_slots_count

enum luck {
bad = -1,
Expand Down
3 changes: 1 addition & 2 deletions scripts/scr_company_view/scr_company_view.gml
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,7 @@ function scr_company_view(company) {
}

man_current = 0;
man_max = array_length(display_unit) + 2;
man_see = 38 - 4;
man_max = MANAGE_MAN_MAX;
other_manage_data();
}

Expand Down
6 changes: 3 additions & 3 deletions scripts/scr_manage_task_selector/scr_manage_task_selector.gml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// https://help.yoyogames.com/hc/en-us/articles/360005277377 for more information
function scr_manage_task_selector(){
if (exit_button.draw_shutter(xx+400,yy+70, "Exit", 0.5, true)){
if (selection_data.purpose_code=="captain_promote"){
if (is_real(selection_data.system) && selection_data.system <= 10 && selection_data.system >= 0){
managing = selection_data.system;
update_general_manage_view();
} else {
Expand Down Expand Up @@ -65,7 +65,7 @@ function scr_manage_task_selector(){
scr_company_order(unit.company);
}

managing = unit.company;
managing = selection_data.system;
update_general_manage_view();
exit;
break;
Expand All @@ -79,7 +79,7 @@ function scr_manage_task_selector(){
scr_company_order(unit.company);
}

managing = unit.company;
managing = selection_data.system;
update_general_manage_view();
exit;
break;
Expand Down
31 changes: 28 additions & 3 deletions scripts/scr_roman_numerals/scr_roman_numerals.gml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function scr_roman_numerals(){
var romanNumerals = [
var roman_numerals = [
"I",
"II",
"III",
Expand All @@ -12,5 +12,30 @@ function scr_roman_numerals(){
"X"
];

return romanNumerals;
}
return roman_numerals;
}

function int_to_roman(_num) {
if (_num < 1 || _num > 100) {
return "";
}

var _roman_numerals = [
100, "C", 90, "XC", 50, "L", 40, "XL",
10, "X", 9, "IX", 5, "V", 4, "IV", 1, "I"
];

var _result = "";
var i = 0;

while (_num > 0) {
if (_num >= _roman_numerals[i]) {
_result += _roman_numerals[i + 1];
_num -= _roman_numerals[i];
} else {
i += 2;
}
}

return _result;
}
6 changes: 3 additions & 3 deletions scripts/scr_scrollbar/scr_scrollbar.gml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ function scr_scrollbar(argument0, argument1, argument2, argument3, argument4, ar
if (obj_controller.mouse_left=1) and (mouse_x>=xx+argument0) and (mouse_y>=yy+argument1) and (mouse_x<xx+argument2) and (mouse_y<yy+argument3) then obj_controller.scrollbar_engaged=1;


if (obj_controller.managing>0 || obj_controller.managing=-1) and (obj_controller.menu!=30) and (obj_controller.man_max-obj_controller.man_see>-1){checka=1;}
if (instance_exists(obj_popup)){if (obj_popup.type=8) and (obj_popup.target_comp>=0){if (obj_controller.man_max-obj_controller.man_see>-1){checka=1;}}}
if (obj_controller.managing>0 || obj_controller.managing=-1) and (obj_controller.menu!=30) and (obj_controller.man_max-MANAGE_MAN_SEE>-1){checka=1;}
if (instance_exists(obj_popup)){if (obj_popup.type=8) and (obj_popup.target_comp>=0){if (obj_controller.man_max-MANAGE_MAN_SEE>-1){checka=1;}}}


if (obj_controller.scrollbar_engaged=1) and (checka>0){
Expand All @@ -104,7 +104,7 @@ function scr_scrollbar(argument0, argument1, argument2, argument3, argument4, ar
if (checka=1){
obj_controller.man_current=floor((obj_controller.man_max)*ratio);

if (obj_controller.man_current>(obj_controller.man_max-obj_controller.man_see)) then obj_controller.man_current=(obj_controller.man_max-obj_controller.man_see);
if (obj_controller.man_current>(obj_controller.man_max-MANAGE_MAN_SEE)) then obj_controller.man_current=(obj_controller.man_max-MANAGE_MAN_SEE);

if (obj_controller.man_current<0) then obj_controller.man_current=0;
}
Expand Down
4 changes: 1 addition & 3 deletions scripts/scr_special_view/scr_special_view.gml
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,7 @@ function scr_special_view(command_group) {
}

man_current=0;
man_max=array_length(display_unit)+2;
man_see=38-4;
if (man_max>=man_see) then man_max+=2;
man_max=MANAGE_MAN_MAX;
// if (command_group=13) then man_max+=2;


Expand Down
Loading