diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 00000000..2f7c3c53
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,141 @@
+[*]
+charset = utf-8-bom
+end_of_line = crlf
+trim_trailing_whitespace = true
+insert_final_newline = true
+indent_style = space
+indent_size = 2
+
+# Microsoft .NET properties
+csharp_preferred_modifier_order = public, private, protected, internal, file, new, static, abstract, virtual, sealed, readonly, override, extern, unsafe, volatile, async, required:suggestion
+csharp_style_prefer_utf8_string_literals = true:suggestion
+csharp_style_var_elsewhere = false:none
+csharp_style_var_for_built_in_types = false:suggestion
+dotnet_naming_rule.property_rule.import_to_resharper = as_predefined
+dotnet_naming_rule.property_rule.resharper_style = AaBb, Show + AaBb
+dotnet_naming_rule.property_rule.severity = warning
+dotnet_naming_rule.property_rule.style = upper_camel_case_style
+dotnet_naming_rule.property_rule.symbols = property_symbols
+dotnet_naming_rule.unity_serialized_field_rule.import_to_resharper = True
+dotnet_naming_rule.unity_serialized_field_rule.resharper_description = Unity serialized field
+dotnet_naming_rule.unity_serialized_field_rule.resharper_guid = 5f0fdb63-c892-4d2c-9324-15c80b22a7ef
+dotnet_naming_rule.unity_serialized_field_rule.severity = warning
+dotnet_naming_rule.unity_serialized_field_rule.style = lower_camel_case_style
+dotnet_naming_rule.unity_serialized_field_rule.symbols = unity_serialized_field_symbols
+dotnet_naming_rule.unity_serialized_field_rule_1.import_to_resharper = True
+dotnet_naming_rule.unity_serialized_field_rule_1.resharper_description = Unity serialized field
+dotnet_naming_rule.unity_serialized_field_rule_1.resharper_guid = 5f0fdb63-c892-4d2c-9324-15c80b22a7ef
+dotnet_naming_rule.unity_serialized_field_rule_1.severity = warning
+dotnet_naming_rule.unity_serialized_field_rule_1.style = lower_camel_case_style
+dotnet_naming_rule.unity_serialized_field_rule_1.symbols = unity_serialized_field_symbols_1
+dotnet_naming_rule.unity_serialized_field_rule_2.import_to_resharper = True
+dotnet_naming_rule.unity_serialized_field_rule_2.resharper_description = Unity serialized field
+dotnet_naming_rule.unity_serialized_field_rule_2.resharper_guid = 5f0fdb63-c892-4d2c-9324-15c80b22a7ef
+dotnet_naming_rule.unity_serialized_field_rule_2.severity = warning
+dotnet_naming_rule.unity_serialized_field_rule_2.style = lower_camel_case_style
+dotnet_naming_rule.unity_serialized_field_rule_2.symbols = unity_serialized_field_symbols_2
+dotnet_naming_rule.unity_serialized_field_rule_3.import_to_resharper = True
+dotnet_naming_rule.unity_serialized_field_rule_3.resharper_description = Unity serialized field
+dotnet_naming_rule.unity_serialized_field_rule_3.resharper_guid = 5f0fdb63-c892-4d2c-9324-15c80b22a7ef
+dotnet_naming_rule.unity_serialized_field_rule_3.severity = warning
+dotnet_naming_rule.unity_serialized_field_rule_3.style = lower_camel_case_style
+dotnet_naming_rule.unity_serialized_field_rule_3.symbols = unity_serialized_field_symbols_3
+dotnet_naming_style.lower_camel_case_style.capitalization = camel_case
+dotnet_naming_style.upper_camel_case_style.capitalization = pascal_case
+dotnet_naming_symbols.property_symbols.applicable_accessibilities = *
+dotnet_naming_symbols.property_symbols.applicable_kinds = property
+dotnet_naming_symbols.unity_serialized_field_symbols.applicable_accessibilities = *
+dotnet_naming_symbols.unity_serialized_field_symbols.applicable_kinds =
+dotnet_naming_symbols.unity_serialized_field_symbols.resharper_applicable_kinds = unity_serialised_field
+dotnet_naming_symbols.unity_serialized_field_symbols.resharper_required_modifiers = instance
+dotnet_naming_symbols.unity_serialized_field_symbols_1.applicable_accessibilities = *
+dotnet_naming_symbols.unity_serialized_field_symbols_1.applicable_kinds =
+dotnet_naming_symbols.unity_serialized_field_symbols_1.resharper_applicable_kinds = unity_serialised_field
+dotnet_naming_symbols.unity_serialized_field_symbols_1.resharper_required_modifiers = instance
+dotnet_naming_symbols.unity_serialized_field_symbols_2.applicable_accessibilities = *
+dotnet_naming_symbols.unity_serialized_field_symbols_2.applicable_kinds =
+dotnet_naming_symbols.unity_serialized_field_symbols_2.resharper_applicable_kinds = unity_serialised_field
+dotnet_naming_symbols.unity_serialized_field_symbols_2.resharper_required_modifiers = instance
+dotnet_naming_symbols.unity_serialized_field_symbols_3.applicable_accessibilities = *
+dotnet_naming_symbols.unity_serialized_field_symbols_3.applicable_kinds =
+dotnet_naming_symbols.unity_serialized_field_symbols_3.resharper_applicable_kinds = unity_serialised_field
+dotnet_naming_symbols.unity_serialized_field_symbols_3.resharper_required_modifiers = instance
+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 = for_non_interface_members:suggestion
+
+# ReSharper properties
+resharper_align_linq_query = true
+resharper_align_multiline_argument = true
+resharper_align_multiline_calls_chain = true
+resharper_align_multiline_extends_list = true
+resharper_align_multiline_parameter = true
+resharper_align_multiple_declaration = true
+resharper_align_multline_type_parameter_constrains = true
+resharper_align_multline_type_parameter_list = true
+resharper_align_tuple_components = true
+resharper_autodetect_indent_settings = true
+resharper_braces_for_for = required
+resharper_braces_for_foreach = required
+resharper_braces_for_ifelse = required
+resharper_braces_for_while = required
+resharper_csharp_blank_lines_inside_region = 0
+resharper_csharp_empty_block_style = together_same_line
+resharper_csharp_int_align_comments = true
+resharper_csharp_wrap_after_declaration_lpar = true
+resharper_csharp_wrap_after_invocation_lpar = true
+resharper_csharp_wrap_arguments_style = chop_if_long
+resharper_csharp_wrap_before_declaration_rpar = true
+resharper_csharp_wrap_before_invocation_rpar = true
+resharper_csharp_wrap_parameters_style = chop_if_long
+resharper_enforce_line_ending_style = true
+resharper_formatter_off_tag = @formatter:off
+resharper_formatter_on_tag = @formatter:on
+resharper_formatter_tags_enabled = true
+resharper_for_built_in_types = use_var_when_evident
+resharper_indent_preprocessor_region = outdent
+resharper_keep_existing_embedded_arrangement = false
+resharper_keep_existing_expr_member_arrangement = false
+resharper_keep_existing_initializer_arrangement = false
+resharper_keep_existing_linebreaks = false
+resharper_outdent_statement_labels = true
+resharper_place_simple_embedded_statement_on_same_line = false
+resharper_use_indent_from_vs = false
+resharper_wrap_array_initializer_style = chop_if_long
+resharper_wrap_before_first_method_call = false
+resharper_wrap_before_primary_constructor_declaration_rpar = true
+resharper_wrap_chained_binary_expressions = chop_if_long
+resharper_wrap_chained_binary_patterns = chop_if_long
+resharper_wrap_chained_method_calls = chop_if_long
+resharper_wrap_list_pattern = chop_if_long
+
+# ReSharper inspection severities
+resharper_arrange_redundant_parentheses_highlighting = hint
+resharper_arrange_this_qualifier_highlighting = hint
+resharper_arrange_type_member_modifiers_highlighting = hint
+resharper_arrange_type_modifiers_highlighting = hint
+resharper_built_in_type_reference_style_for_member_access_highlighting = hint
+resharper_built_in_type_reference_style_highlighting = hint
+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_web_config_module_not_resolved_highlighting = warning
+resharper_web_config_type_not_resolved_highlighting = warning
+resharper_web_config_wrong_module_highlighting = warning
+
+[{*.har,*.jsb2,*.jsb3,*.json,*.jsonc,*.postman_collection,*.postman_collection.json,*.postman_environment,*.postman_environment.json,.babelrc,.eslintrc,.prettierrc,.stylelintrc,bowerrc,jest.config}]
+indent_style = space
+indent_size = 2
+
+[*.{appxmanifest,asax,ascx,aspx,axaml,build,c,c++,c++m,cc,ccm,cginc,compute,cp,cpp,cppm,cs,cshtml,cu,cuh,cxx,cxxm,dtd,fs,fsi,fsscript,fsx,fx,fxh,h,hh,hlsl,hlsli,hlslinc,hpp,hxx,inc,inl,ino,ipp,ixx,master,ml,mli,mpp,mq4,mq5,mqh,mxx,nuspec,paml,razor,resw,resx,shader,skin,tpp,usf,ush,uxml,vb,xaml,xamlx,xoml,xsd}]
+indent_style = space
+indent_size = 2
+tab_width = 2
diff --git a/UIInfoSuite2.sln.DotSettings b/UIInfoSuite2.sln.DotSettings
new file mode 100644
index 00000000..8e565a9e
--- /dev/null
+++ b/UIInfoSuite2.sln.DotSettings
@@ -0,0 +1,20 @@
+
+ True
+ True
+ True
+ True
+ True
+ True
+ True
+ True
+ True
+ 0
+ TOGETHER_SAME_LINE
+ OUTDENT
+ True
+ True
+ CHOP_IF_LONG
+ True
+ True
+ True
+ True
\ No newline at end of file
diff --git a/UIInfoSuite2/AdditionalFeatures/SkipIntro.cs b/UIInfoSuite2/AdditionalFeatures/SkipIntro.cs
index 12aaa16d..f0987e30 100644
--- a/UIInfoSuite2/AdditionalFeatures/SkipIntro.cs
+++ b/UIInfoSuite2/AdditionalFeatures/SkipIntro.cs
@@ -6,31 +6,32 @@
namespace UIInfoSuite2.AdditionalFeatures
{
- public class SkipIntro
- {
- private readonly IModEvents _events;
+ public class SkipIntro
+ {
+ private readonly IModEvents _events;
- public SkipIntro(IModEvents events)
- {
- _events = events;
+ public SkipIntro(IModEvents events)
+ {
+ _events = events;
- events.Input.ButtonPressed += OnButtonPressed;
- events.GameLoop.SaveLoaded += OnSaveLoaded;
- }
+ events.Input.ButtonPressed += OnButtonPressed;
+ events.GameLoop.SaveLoaded += OnSaveLoaded;
+ }
- private void OnSaveLoaded(object sender, EventArgs e)
- {
- _events.Input.ButtonPressed -= OnButtonPressed;
- _events.GameLoop.SaveLoaded -= OnSaveLoaded;
- }
+ private void OnSaveLoaded(object sender, EventArgs e)
+ {
+ _events.Input.ButtonPressed -= OnButtonPressed;
+ _events.GameLoop.SaveLoaded -= OnSaveLoaded;
+ }
- private void OnButtonPressed(object sender, ButtonPressedEventArgs e)
- {
- if (Game1.activeClickableMenu is TitleMenu menu && (e.Button == SButton.Escape || e.Button == SButton.ControllerStart))
- {
- menu.skipToTitleButtons();
- _events.Input.ButtonPressed -= OnButtonPressed;
- }
- }
+ private void OnButtonPressed(object sender, ButtonPressedEventArgs e)
+ {
+ if (Game1.activeClickableMenu is TitleMenu menu &&
+ (e.Button == SButton.Escape || e.Button == SButton.ControllerStart))
+ {
+ menu.skipToTitleButtons();
+ _events.Input.ButtonPressed -= OnButtonPressed;
+ }
}
+ }
}
diff --git a/UIInfoSuite2/Compatibility/DynamicGameAssetHelper.cs b/UIInfoSuite2/Compatibility/DynamicGameAssetHelper.cs
index 2eec7f88..b603ecf9 100644
--- a/UIInfoSuite2/Compatibility/DynamicGameAssetHelper.cs
+++ b/UIInfoSuite2/Compatibility/DynamicGameAssetHelper.cs
@@ -3,273 +3,321 @@
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
-using StardewValley;
+using Netcode;
using StardewModdingAPI;
using StardewModdingAPI.Events;
+using StardewValley;
+using StardewValley.Menus;
+using StardewValley.Network;
using UIInfoSuite2.Infrastructure.Reflection;
using SObject = StardewValley.Object;
namespace UIInfoSuite2.Compatibility
{
- public class DynamicGameAssetsHelper
+ public class DynamicGameAssetsHelper
+ {
+ private Assembly? _dgaAssembly;
+
+ private DgaFakeIdRetriever? _dgaFakeId;
+
+ private IReflectedMethod? _modFindMethod;
+
+ public DynamicGameAssetsHelper(IDynamicGameAssetsApi api, IModHelper helper, IMonitor monitor)
{
- public IDynamicGameAssetsApi Api { get; init; }
- private IReflectionHelper Reflection { get; init; }
- private IModEvents ModEvents { get; init; }
- private IMonitor Monitor { get; init; }
- private Reflector Reflector { get; init; }
+ Api = api;
+ Reflection = helper.Reflection;
+ ModEvents = helper.Events;
+ Monitor = monitor;
+ Reflector = new Reflector();
- private Assembly? _dgaAssembly;
+ ModEvents.GameLoop.DayEnding += OnDayEnding;
+ }
- private DgaFakeIdRetriever? _dgaFakeId;
- private DgaFakeIdRetriever DgaFakeId {
- get => _dgaFakeId ??= new DgaFakeIdRetriever(this);
- }
+ public IDynamicGameAssetsApi Api { get; init; }
+ private IReflectionHelper Reflection { get; }
+ private IModEvents ModEvents { get; }
+ private IMonitor Monitor { get; }
+ private Reflector Reflector { get; }
- private IReflectedMethod? _modFindMethod;
+ private DgaFakeIdRetriever DgaFakeId => _dgaFakeId ??= new DgaFakeIdRetriever(this);
- public DynamicGameAssetsHelper(IDynamicGameAssetsApi api, IModHelper helper, IMonitor monitor)
- {
- this.Api = api;
- this.Reflection = helper.Reflection;
- this.ModEvents = helper.Events;
- this.Monitor = monitor;
- this.Reflector = new Reflector();
+ /// Inject an object of any DGA type to get a reference to the DGA Assembly
+ /// The initialized .
+ public DynamicGameAssetsHelper InjectDga(object dga)
+ {
+ if (_dgaAssembly == null)
+ {
+ _dgaAssembly = dga.GetType().Assembly;
+ Monitor.Log(
+ $"{GetType().Name}: Retrieved reference to DGA assemby using DGA class instance of {dga.GetType().FullName}."
+ );
+ }
+
+ return this;
+ }
- this.ModEvents.GameLoop.DayEnding += OnDayEnding;
- }
+ public void Dispose()
+ {
+ ModEvents.GameLoop.DayEnding -= OnDayEnding;
+ }
- /// Inject an object of any DGA type to get a reference to the DGA Assembly
- /// The initialized .
- public DynamicGameAssetsHelper InjectDga(object dga)
+ private void OnDayEnding(object? sender, DayEndingEventArgs e)
+ {
+ Reflector.NewCacheInterval();
+ }
+
+ /// Mod.Find()
+ public object? FindPackData(string fullId)
+ {
+ IReflectedMethod? modFind = GetModFindMethod();
+ if (modFind == null)
+ {
+ throw new Exception("Could not load DynamicGameAssets.Mod.Find");
+ }
+
+ return modFind.Invoke