Skip to content
Closed
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
98 changes: 98 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Top-most EditorConfig file
root = true

# Global settings
[*]
charset = utf-8-bom
end_of_line = crlf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4
tab_width = 4

# C# code style settings
[*.cs]
csharp_new_line_before_members_in_object_initializers = false
csharp_style_prefer_utf8_string_literals = true:suggestion
csharp_style_var_elsewhere = false:suggestion
csharp_style_var_for_built_in_types = false:suggestion
csharp_style_var_when_type_is_apparent = false:suggestion

# Enforce enforce these warnings during build
dotnet_diagnostic.IDE0008.severity = warning
dotnet_diagnostic.IDE0040.severity = warning

# .NET code style settings
dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:none
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:none
dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:none
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion
dotnet_style_qualification_for_event = false:suggestion
dotnet_style_qualification_for_field = false:suggestion
dotnet_style_qualification_for_method = false:suggestion
dotnet_style_qualification_for_property = false:suggestion
dotnet_style_require_accessibility_modifiers = always:warning
dotnet_sort_system_directives_first = false

# ReSharper formatting settings
resharper_autodetect_indent_settings = true
resharper_blank_lines_after_block_statements = 0
resharper_blank_lines_after_start_comment = 0
resharper_blank_lines_after_using_list = 0
resharper_blank_lines_around_auto_property = 0
resharper_braces_for_ifelse = not_required
resharper_braces_redundant = false
resharper_constructor_or_destructor_body = expression_body
resharper_csharp_blank_lines_around_invocable = 0
resharper_csharp_empty_block_style = together_same_line
resharper_csharp_insert_final_newline = true
resharper_csharp_max_line_length = 194
resharper_csharp_remove_blank_lines_near_braces_in_code = false
resharper_csharp_remove_blank_lines_near_braces_in_declarations = false
resharper_default_private_modifier = implicit
resharper_formatter_off_tag = @formatter:off
resharper_formatter_on_tag = @formatter:on
resharper_formatter_tags_enabled = true
resharper_indent_preprocessor_directives = normal
resharper_instance_members_qualify_declared_in =
resharper_method_or_operator_body = expression_body
resharper_object_creation_when_type_not_evident = target_typed
resharper_parentheses_redundancy_style = remove
resharper_place_expr_accessor_on_single_line = true
resharper_place_expr_method_on_single_line = false
resharper_place_expr_property_on_single_line = false
resharper_place_field_attribute_on_same_line = false
resharper_place_simple_embedded_statement_on_same_line = false
resharper_show_autodetect_configure_formatting_tip = false
resharper_use_indent_from_vs = false

# ReSharper inspection severities
resharper_arrange_redundant_parentheses_highlighting = hint
resharper_arrange_this_qualifier_highlighting = hint
resharper_built_in_type_reference_style_for_member_access_highlighting = hint
resharper_built_in_type_reference_style_highlighting = hint
resharper_check_namespace_highlighting = none
resharper_condition_is_always_true_or_false_according_to_nullable_api_contract_highlighting = none
resharper_localizable_element_highlighting = none
resharper_mvc_action_not_resolved_highlighting = warning
resharper_mvc_area_not_resolved_highlighting = warning
resharper_mvc_controller_not_resolved_highlighting = warning
resharper_mvc_masterpage_not_resolved_highlighting = warning
resharper_mvc_partial_view_not_resolved_highlighting = warning
resharper_mvc_template_not_resolved_highlighting = warning
resharper_mvc_view_component_not_resolved_highlighting = warning
resharper_mvc_view_component_view_not_resolved_highlighting = warning
resharper_mvc_view_not_resolved_highlighting = warning
resharper_razor_assembly_not_resolved_highlighting = warning
resharper_redundant_base_qualifier_highlighting = warning
resharper_suggest_var_or_type_built_in_types_highlighting = hint
resharper_suggest_var_or_type_elsewhere_highlighting = hint
resharper_suggest_var_or_type_simple_types_highlighting = hint
resharper_unity_performance_critical_code_camera_main_highlighting = none
resharper_unity_performance_critical_code_invocation_highlighting = none
resharper_unreachable_switch_case_due_to_integer_analysis_highlighting = none
resharper_web_config_module_not_resolved_highlighting = warning
resharper_web_config_type_not_resolved_highlighting = warning
resharper_web_config_wrong_module_highlighting = warning
7 changes: 5 additions & 2 deletions S1API/Dialogues/DialogueInjector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private static System.Collections.IEnumerator WaitForNPCsAndInject()
for (int i = _pendingInjections.Count - 1; i >= 0; i--)
{
DialogueInjection? injection = _pendingInjections[i];
var npcs = Object.FindObjectsOfType<NPC>();
NPC[]? npcs = Object.FindObjectsOfType<NPC>();
NPC? target = null;

foreach (NPC npc in npcs)
Expand Down Expand Up @@ -115,8 +115,11 @@ private static System.Collections.IEnumerator WaitForNPCsAndInject()
/// </summary>
/// <param name="injection">The dialogue injection object containing the data for the choice to inject.</param>
/// <param name="npc">The NPC that will have the dialogue choice injected.</param>
private static void TryInject(DialogueInjection injection, NPC npc)
private static void TryInject(DialogueInjection injection, NPC? npc)
{
if (npc == null)
return;

DialogueHandler handler = npc.GetComponent<DialogueHandler>();
NPCEvent_LocationDialogue dialogueEvent = npc.GetComponentInChildren<NPCEvent_LocationDialogue>(true);
if (!dialogueEvent || !dialogueEvent.DialogueOverride)
Expand Down
2 changes: 2 additions & 0 deletions S1API/Entities/Appearances/AccessoryFields/Bottom.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using S1API.Entities.Appearances.Base;
using System.Reflection;

#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
namespace S1API.Entities.Appearances.AccessoryFields
{
/// <summary>
Expand All @@ -12,3 +13,4 @@ public class Bottom : BaseAccessoryAppearance
public const string MediumSkirt = "Avatar/Accessories/Bottom/MediumSkirt/MediumSkirt";
}
}
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
2 changes: 2 additions & 0 deletions S1API/Entities/Appearances/AccessoryFields/Chest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using S1API.Entities.Appearances.Base;

#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
namespace S1API.Entities.Appearances.AccessoryFields
{
/// <summary>
Expand All @@ -14,3 +15,4 @@ public class Chest : BaseAccessoryAppearance
public const string OpenVest = "Avatar/Accessories/Chest/OpenVest/OpenVest";
}
}
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
2 changes: 2 additions & 0 deletions S1API/Entities/Appearances/AccessoryFields/Feet.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using S1API.Entities.Appearances.Base;

#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
namespace S1API.Entities.Appearances.AccessoryFields
{
/// <summary>
Expand All @@ -14,3 +15,4 @@ public class Feet : BaseAccessoryAppearance
public const string Sneakers = "Avatar/Accessories/Feet/Sneakers/Sneakers";
}
}
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
2 changes: 2 additions & 0 deletions S1API/Entities/Appearances/AccessoryFields/Hands.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using S1API.Entities.Appearances.Base;

#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
namespace S1API.Entities.Appearances.AccessoryFields
{
/// <summary>
Expand All @@ -10,3 +11,4 @@ public class Hands : BaseAccessoryAppearance
public const string Polex = "Avatar/Accessories/Hands/Polex/Polex";
}
}
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
2 changes: 2 additions & 0 deletions S1API/Entities/Appearances/AccessoryFields/Head.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using S1API.Entities.Appearances.Base;

#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
namespace S1API.Entities.Appearances.AccessoryFields
{
/// <summary>
Expand All @@ -23,3 +24,4 @@ public class Head : BaseAccessoryAppearance
public const string SmallRoundGlasses = "Avatar/Accessories/Head/SmallRoundGlasses/SmallRoundGlasses";
}
}
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
2 changes: 2 additions & 0 deletions S1API/Entities/Appearances/AccessoryFields/Neck.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using S1API.Entities.Appearances.Base;

#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
namespace S1API.Entities.Appearances.AccessoryFields
{
/// <summary>
Expand All @@ -10,3 +11,4 @@ public class Neck : BaseAccessoryAppearance
public const string GoldChain = "Avatar/Accessories/Neck/GoldChain/GoldChain";
}
}
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
2 changes: 2 additions & 0 deletions S1API/Entities/Appearances/AccessoryFields/Waist.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using S1API.Entities.Appearances.Base;

#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
namespace S1API.Entities.Appearances.AccessoryFields
{
/// <summary>
Expand All @@ -14,3 +15,4 @@ public class Waist : BaseAccessoryAppearance
public const string PriestGown = "Avatar/Accessories/Neck/PriestGown/PriestGown";
}
}
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
2 changes: 2 additions & 0 deletions S1API/Entities/Appearances/BodyLayerFields/Pants.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using S1API.Entities.Appearances.Base;

#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
namespace S1API.Entities.Appearances.BodyLayerFields
{
/// <summary>
Expand All @@ -14,3 +15,4 @@ public class Pants : BaseBodyAppearance
public const string MaleUnderwear = "Avatar/Layers/Bottom/MaleUnderwear";
}
}
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
2 changes: 2 additions & 0 deletions S1API/Entities/Appearances/BodyLayerFields/Shirt.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using S1API.Entities.Appearances.Base;

#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
namespace S1API.Entities.Appearances.BodyLayerFields
{
/// <summary>
Expand All @@ -22,3 +23,4 @@ public class Shirts : BaseBodyAppearance
public const string VNeck = "Avatar/Layers/Top/V-Neck";
}
}
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
2 changes: 2 additions & 0 deletions S1API/Entities/Appearances/CustomizationFields/HairStyle.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using S1API.Entities.Appearances.Base;

#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
namespace S1API.Entities.Appearances.CustomizationFields
{
/// <summary>
Expand Down Expand Up @@ -35,3 +36,4 @@ public class HairStyle : BaseAppearance
public const string Spiky = "Avatar/Hair/spiky/Spiky";
}
}
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
2 changes: 2 additions & 0 deletions S1API/Entities/Appearances/FaceLayerFields/Eyes.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using S1API.Entities.Appearances.Base;

#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
namespace S1API.Entities.Appearances.FaceLayerFields
{
/// <summary>
Expand All @@ -13,3 +14,4 @@ public class Eyes : BaseFaceAppearance
public const string TiredEyes = "Avatar/Layers/Face/TiredEyes";
}
}
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
2 changes: 2 additions & 0 deletions S1API/Entities/Appearances/FaceLayerFields/Face.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using S1API.Entities.Appearances.Base;

#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
namespace S1API.Entities.Appearances.FaceLayerFields
{
/// <summary>
Expand All @@ -21,3 +22,4 @@ public class Face : BaseFaceAppearance
public const string Surprised = "Avatar/Layers/Face/Face_Surprised";
}
}
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
2 changes: 2 additions & 0 deletions S1API/Entities/Appearances/FaceLayerFields/FacialHair.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using S1API.Entities.Appearances.Base;

#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
namespace S1API.Entities.Appearances.FaceLayerFields
{
/// <summary>
Expand All @@ -12,3 +13,4 @@ public class FacialHair : BaseFaceAppearance
public const string Swirl = "Avatar/Layers/Face/FacialHair_Swirl";
}
}
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
33 changes: 31 additions & 2 deletions S1API/GameTime/GameDateTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,21 @@
using S1GameDateTimeData = ScheduleOne.Persistence.Datas.GameDateTimeData;
#endif

using System;

namespace S1API.GameTime
{
/// <summary>
/// Represents an in-game datetime (elapsed days and 24-hour time).
/// </summary>
public struct GameDateTime
{
/// <summary>
/// The number of days that have elapsed since a reference point.
/// </summary>
public int ElapsedDays;

/// <summary>
/// The time of day in 24-hour format (e.g., 1330 for 1:30 PM).
/// </summary>
public int Time;

/// <summary>
Expand Down Expand Up @@ -127,21 +132,45 @@ public override string ToString()
return $"Day {ElapsedDays}, {GetFormattedTime()}";
}

/// <summary>
/// Adds two GameDateTime instances by summing their total minutes.
/// </summary>
/// <param name="a">The first GameDateTime.</param>
/// <param name="b">The second GameDateTime.</param>
/// <returns>A new GameDateTime representing the total.</returns>
public static GameDateTime operator +(GameDateTime a, GameDateTime b)
{
return new GameDateTime(a.GetMinSum() + b.GetMinSum());
}

/// <summary>
/// Subtracts one GameDateTime from another by their total minutes.
/// </summary>
/// <param name="a">The GameDateTime to subtract from.</param>
/// <param name="b">The GameDateTime to subtract.</param>
/// <returns>The difference as a new GameDateTime.</returns>
public static GameDateTime operator -(GameDateTime a, GameDateTime b)
{
return new GameDateTime(a.GetMinSum() - b.GetMinSum());
}

/// <summary>
/// Determines whether one GameDateTime is later than another.
/// </summary>
/// <param name="a">The first GameDateTime.</param>
/// <param name="b">The second GameDateTime.</param>
/// <returns><c>true</c> if a is later than b; otherwise, <c>false</c>.</returns>
public static bool operator >(GameDateTime a, GameDateTime b)
{
return a.GetMinSum() > b.GetMinSum();
}

/// <summary>
/// Determines whether one GameDateTime is earlier than another.
/// </summary>
/// <param name="a">The first GameDateTime.</param>
/// <param name="b">The second GameDateTime.</param>
/// <returns><c>true</c> if a is earlier than b; otherwise, <c>false</c>.</returns>
public static bool operator <(GameDateTime a, GameDateTime b)
{
return a.GetMinSum() < b.GetMinSum();
Expand Down
10 changes: 10 additions & 0 deletions S1API/PhoneCalls/Constants/EvaluationType.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
namespace S1API.PhoneCalls.Constants
{
/// <summary>
/// Represents the result condition that determines whether an evaluation passes.
/// </summary>
public enum EvaluationType
{
/// <summary>
/// The evaluation passes when the condition evaluates to true.
/// </summary>
PassOnTrue,

/// <summary>
/// The evaluation passes when the condition evaluates to false.
/// </summary>
PassOnFalse
}
}
10 changes: 10 additions & 0 deletions S1API/PhoneCalls/Constants/SystemTriggerType.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
namespace S1API.PhoneCalls.Constants
{
/// <summary>
/// Specifies system-level triggers used during a phone call sequence.
/// </summary>
public enum SystemTriggerType
{
/// <summary>
/// Trigger that activates at the start of a sequence.
/// </summary>
StartTrigger,

/// <summary>
/// Trigger that activates upon completion of a sequence.
/// </summary>
DoneTrigger
}
}
4 changes: 4 additions & 0 deletions S1API/PhoneCalls/PhoneCallDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@

namespace S1API.PhoneCalls
{
/// <summary>
/// Base class for defining a scripted phone call, including caller information and stage entries.
/// This is a wrapper around the game's internal <see cref="S1ScriptableObjects.PhoneCallData"/>.
/// </summary>
public abstract class PhoneCallDefinition
{
// ReSharper disable once MemberCanBePrivate.Global
Expand Down
Loading