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
8 changes: 1 addition & 7 deletions ChapterMaster.yyp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

269 changes: 134 additions & 135 deletions objects/obj_controller/Create_0.gml

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions objects/obj_controller/Draw_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@
try{
scr_ui_manage();
} catch(_exception){
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in general while messing around would be best to sling these in try_and_report_loop maybe?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in general while messing around would be best to sling these in try_and_report_loop maybe?

I think try/catch and handle_exception combo should do the same thing.
I've created handle_exception as a light version of try_and_report_loop, for cases where you don't need custom functions to run on catch. It's just more compact, but works mostly the same way, I think?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i guess that's true, i suppose i was mostly just thinking that try_and_report_loop("ui Manage"), scr_ui_manage) is just less lines and coudl have as you say a custom catch function, but it's probably outside of scope for this pr

show_debug_message(_exception);
handle_exception(_exception);
manage = 0;
menu = 0;

}
try{
scr_ui_advisors();
} catch(_exception){
show_debug_message(_exception);
handle_exception(_exception);
manage = 0;
menu = 0;
}
try{
scr_ui_diplomacy();
} catch(_exception){
show_debug_message(_exception);
handle_exception(_exception);
manage = 0;
menu = 0;
}
try{
scr_ui_settings();
} catch(_exception){
show_debug_message(_exception);
handle_exception(_exception);
manage = 0;
menu = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion objects/obj_star/Draw_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ if (!global.load && (obj_controller.zoomed || in_camera_view(star_box_shape())))
var faction_sprite = obj_img.force[owner];
draw_sprite_ext(faction_sprite,faction_index,xx+(panel_width/2)-30,yy+25, 0.60, 0.60, 0, c_white, 1);
} catch(_exception){
show_debug_message("{0}", _exception);
handle_exception(_exception);
}
} else {
draw_sprite_ext(faction_sprite,faction_index,xx+(panel_width/2)-30,yy+25, 0.60, 0.60, 0, c_white, 1);
Expand Down
4 changes: 2 additions & 2 deletions scripts/JsonFileListLoader/JsonFileListLoader.gml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ function JsonFileListLoader() constructor {
result.is_success = true;

debugl($"Successfully loaded {item_total} values from {relative_file_path}");
} catch (_ex) {
debugl($"Could not load data from {relative_file_path}: {_ex.message}.");
} catch (_exception) {
handle_exception(_exception);
result.values = {}; // do not return incomplete/invalid data
} finally {
if (is_undefined(file_buffer) == false) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/UIRenderComponents/UIRenderComponents.gml
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function UISpriteRendererComponent(owner, name) : UIRenderComponent(owner, name)
alpha
)
} catch(_exception){
show_debug_message(_exception.message);
handle_exception(_exception);
}
img_index = (img_index + img_speed) % __spr_frames;
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/scr_add_artifact/scr_add_artifact.gml
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ function corrupt_artifact_collectors(last_artifact){
}
}
catch( _exception){
show_debug_message(_exception.message);
handle_exception(_exception);
}
}

Expand Down
29 changes: 28 additions & 1 deletion scripts/scr_array_functions/scr_array_functions.gml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,31 @@ function array_to_string_list(_array) {
}
}
return _string_list;
}
}

/// @function array_to_string_order
/// @description Converts an array into a string, with "," after each member and "and" before the last one.
/// @param {array} _strings_array An array of strings.
/// @return {string}
function array_to_string_order(_strings_array) {
var result = "";
var length = array_length(_strings_array);

// Loop through the array
for (var i = 0; i < length; i++) {
// Append the current string
result += _strings_array[i];

// Check if it's the last string
if (i < length - 1) {
// If it's the second last item, add " and " before the last one
if (i == length - 2) {
result += " and ";
} else {
result += ", ";
}
}
}

return result;
}
3 changes: 0 additions & 3 deletions scripts/scr_cheatcode/scr_cheatcode.gml
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,6 @@ function scr_cheatcode(argument0) {
}
}
} catch(_exception) {
log_into_file(_exception.longMessage);
log_into_file(_exception.script);
log_into_file(_exception.stacktrace);
show_debug_message(_exception.longMessage);
}
}
2 changes: 1 addition & 1 deletion scripts/scr_company_order/scr_company_order.gml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function temp_marine_variables(co, unit_num){
break;
}
} catch( _exception) {
show_debug_message("{0}",_exception);
handle_exception(_exception);
unit.squad="none";
}
}
Expand Down
15 changes: 0 additions & 15 deletions scripts/scr_convert_to_string/scr_convert_to_string.gml

This file was deleted.

11 changes: 0 additions & 11 deletions scripts/scr_convert_to_string/scr_convert_to_string.yy

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/scr_has_adv/scr_has_adv.gml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function scr_has_adv(advantage){
result = array_contains(obj_ini.adv, advantage);
}
} catch (_exception){
show_debug_message(_exception);
handle_exception(_exception);
result = false;
}
return result;
Expand Down
2 changes: 1 addition & 1 deletion scripts/scr_has_disadv/scr_has_disadv.gml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function scr_has_disadv(disadvantage){
result = array_contains(obj_ini.dis, disadvantage);
}
} catch (_exception){
show_debug_message(_exception);
handle_exception(_exception);
result = false;
}
return result;
Expand Down
2 changes: 1 addition & 1 deletion scripts/scr_librarium/scr_librarium.gml
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ function scr_librarium(){
try{
artif_descr = obj_ini.artifact_struct[menu_artifact].description();
} catch( _exception){
show_debug_message(_exception.message);
handle_exception(_exception);
}
tooltip = "";
tooltip_other = "";
Expand Down
2 changes: 1 addition & 1 deletion scripts/scr_random_event/scr_random_event.gml
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ function scr_random_event(execute_now) {
evented = true;
}
catch(_exception){
show_debug_message("{0} \n hulk error",_exception);
handle_exception(_exception);
}
}
}
Expand Down
26 changes: 0 additions & 26 deletions scripts/scr_string/scr_string.gml

This file was deleted.

11 changes: 0 additions & 11 deletions scripts/scr_string/scr_string.yy

This file was deleted.

Loading