Skip to content

Commit f35c067

Browse files
authored
Merge pull request #138 from project-fika/dev
Dev > main
2 parents 791455a + 8ed6d12 commit f35c067

File tree

215 files changed

+30650
-29061
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

215 files changed

+30650
-29061
lines changed
-298 Bytes
Binary file not shown.
-8 Bytes
Binary file not shown.

Fika.Core/Bundles/InternalBundleLoader.cs

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -8,46 +8,46 @@
88

99
namespace Fika.Core.Bundles
1010
{
11-
/// <summary>
12-
/// Created by Nexus / pandahhcorp <br/>
13-
/// Refactored by Lacyway to load bundles directly from memory
14-
/// </summary>
15-
public class InternalBundleLoader
16-
{
17-
public Dictionary<string, AssetBundleCreateRequest> _loadedBundles;
18-
public static InternalBundleLoader Instance { get; private set; }
11+
/// <summary>
12+
/// Created by Nexus / pandahhcorp <br/>
13+
/// Refactored by Lacyway to load bundles directly from memory
14+
/// </summary>
15+
public class InternalBundleLoader
16+
{
17+
public Dictionary<string, AssetBundleCreateRequest> _loadedBundles;
18+
public static InternalBundleLoader Instance { get; private set; }
1919

20-
public void Create()
21-
{
22-
Instance = this;
23-
Awake();
24-
}
20+
public void Create()
21+
{
22+
Instance = this;
23+
Awake();
24+
}
2525

26-
private void Awake()
27-
{
28-
Assembly assembly = Assembly.GetExecutingAssembly();
29-
_loadedBundles = [];
26+
private void Awake()
27+
{
28+
Assembly assembly = Assembly.GetExecutingAssembly();
29+
_loadedBundles = [];
3030

31-
assembly.GetManifestResourceNames().ToList().ForEach(name =>
32-
{
33-
using Stream stream = assembly.GetManifestResourceStream(name);
34-
using MemoryStream memoryStream = new();
35-
{
36-
string bundlename = name.Replace("Fika.Core.Bundles.Files.", "").Replace(".bundle", "");
37-
stream.CopyTo(memoryStream);
38-
_loadedBundles.Add(bundlename, AssetBundle.LoadFromMemoryAsync(memoryStream.ToArray()));
39-
}
40-
});
41-
}
31+
assembly.GetManifestResourceNames().ToList().ForEach(name =>
32+
{
33+
using Stream stream = assembly.GetManifestResourceStream(name);
34+
using MemoryStream memoryStream = new();
35+
{
36+
string bundlename = name.Replace("Fika.Core.Bundles.Files.", "").Replace(".bundle", "");
37+
stream.CopyTo(memoryStream);
38+
_loadedBundles.Add(bundlename, AssetBundle.LoadFromMemoryAsync(memoryStream.ToArray()));
39+
}
40+
});
41+
}
4242

43-
public AssetBundle GetAssetBundle(string bundleName)
44-
{
45-
if (_loadedBundles.TryGetValue(bundleName, out AssetBundleCreateRequest request) && request.isDone)
46-
{
47-
return request.assetBundle;
48-
}
43+
public AssetBundle GetAssetBundle(string bundleName)
44+
{
45+
if (_loadedBundles.TryGetValue(bundleName, out AssetBundleCreateRequest request) && request.isDone)
46+
{
47+
return request.assetBundle;
48+
}
4949

50-
return null;
51-
}
52-
}
50+
return null;
51+
}
52+
}
5353
}

Fika.Core/ConfigurationManagerAttributes.cs

Lines changed: 104 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -27,123 +27,123 @@
2727
#pragma warning disable 0169, 0414, 0649
2828
internal sealed class ConfigurationManagerAttributes
2929
{
30-
/// <summary>
31-
/// Should the setting be shown as a percentage (only use with value range settings).
32-
/// </summary>
33-
public bool? ShowRangeAsPercent;
30+
/// <summary>
31+
/// Should the setting be shown as a percentage (only use with value range settings).
32+
/// </summary>
33+
public bool? ShowRangeAsPercent;
3434

35-
/// <summary>
36-
/// Custom setting editor (OnGUI code that replaces the default editor provided by ConfigurationManager).
37-
/// See below for a deeper explanation. Using a custom drawer will cause many of the other fields to do nothing.
38-
/// </summary>
39-
public System.Action<BepInEx.Configuration.ConfigEntryBase> CustomDrawer;
35+
/// <summary>
36+
/// Custom setting editor (OnGUI code that replaces the default editor provided by ConfigurationManager).
37+
/// See below for a deeper explanation. Using a custom drawer will cause many of the other fields to do nothing.
38+
/// </summary>
39+
public System.Action<BepInEx.Configuration.ConfigEntryBase> CustomDrawer;
4040

41-
/// <summary>
42-
/// Custom setting editor that allows polling keyboard input with the Input (or UnityInput) class.
43-
/// Use either CustomDrawer or CustomHotkeyDrawer, using both at the same time leads to undefined behaviour.
44-
/// </summary>
45-
public CustomHotkeyDrawerFunc CustomHotkeyDrawer;
41+
/// <summary>
42+
/// Custom setting editor that allows polling keyboard input with the Input (or UnityInput) class.
43+
/// Use either CustomDrawer or CustomHotkeyDrawer, using both at the same time leads to undefined behaviour.
44+
/// </summary>
45+
public CustomHotkeyDrawerFunc CustomHotkeyDrawer;
4646

47-
/// <summary>
48-
/// Custom setting draw action that allows polling keyboard input with the Input class.
49-
/// Note: Make sure to focus on your UI control when you are accepting input so user doesn't type in the search box or in another setting (best to do this on every frame).
50-
/// If you don't draw any selectable UI controls You can use `GUIUtility.keyboardControl = -1;` on every frame to make sure that nothing is selected.
51-
/// </summary>
52-
/// <example>
53-
/// CustomHotkeyDrawer = (ConfigEntryBase setting, ref bool isEditing) =>
54-
/// {
55-
/// if (isEditing)
56-
/// {
57-
/// // Make sure nothing else is selected since we aren't focusing on a text box with GUI.FocusControl.
58-
/// GUIUtility.keyboardControl = -1;
59-
///
60-
/// // Use Input.GetKeyDown and others here, remember to set isEditing to false after you're done!
61-
/// // It's best to check Input.anyKeyDown and set isEditing to false immediately if it's true,
62-
/// // so that the input doesn't have a chance to propagate to the game itself.
63-
///
64-
/// if (GUILayout.Button("Stop"))
65-
/// isEditing = false;
66-
/// }
67-
/// else
68-
/// {
69-
/// if (GUILayout.Button("Start"))
70-
/// isEditing = true;
71-
/// }
72-
///
73-
/// // This will only be true when isEditing is true and you hold any key
74-
/// GUILayout.Label("Any key pressed: " + Input.anyKey);
75-
/// }
76-
/// </example>
77-
/// <param name="setting">
78-
/// Setting currently being set (if available).
79-
/// </param>
80-
/// <param name="isCurrentlyAcceptingInput">
81-
/// Set this ref parameter to true when you want the current setting drawer to receive Input events.
82-
/// The value will persist after being set, use it to see if the current instance is being edited.
83-
/// Remember to set it to false after you are done!
84-
/// </param>
85-
public delegate void CustomHotkeyDrawerFunc(BepInEx.Configuration.ConfigEntryBase setting, ref bool isCurrentlyAcceptingInput);
47+
/// <summary>
48+
/// Custom setting draw action that allows polling keyboard input with the Input class.
49+
/// Note: Make sure to focus on your UI control when you are accepting input so user doesn't type in the search box or in another setting (best to do this on every frame).
50+
/// If you don't draw any selectable UI controls You can use `GUIUtility.keyboardControl = -1;` on every frame to make sure that nothing is selected.
51+
/// </summary>
52+
/// <example>
53+
/// CustomHotkeyDrawer = (ConfigEntryBase setting, ref bool isEditing) =>
54+
/// {
55+
/// if (isEditing)
56+
/// {
57+
/// // Make sure nothing else is selected since we aren't focusing on a text box with GUI.FocusControl.
58+
/// GUIUtility.keyboardControl = -1;
59+
///
60+
/// // Use Input.GetKeyDown and others here, remember to set isEditing to false after you're done!
61+
/// // It's best to check Input.anyKeyDown and set isEditing to false immediately if it's true,
62+
/// // so that the input doesn't have a chance to propagate to the game itself.
63+
///
64+
/// if (GUILayout.Button("Stop"))
65+
/// isEditing = false;
66+
/// }
67+
/// else
68+
/// {
69+
/// if (GUILayout.Button("Start"))
70+
/// isEditing = true;
71+
/// }
72+
///
73+
/// // This will only be true when isEditing is true and you hold any key
74+
/// GUILayout.Label("Any key pressed: " + Input.anyKey);
75+
/// }
76+
/// </example>
77+
/// <param name="setting">
78+
/// Setting currently being set (if available).
79+
/// </param>
80+
/// <param name="isCurrentlyAcceptingInput">
81+
/// Set this ref parameter to true when you want the current setting drawer to receive Input events.
82+
/// The value will persist after being set, use it to see if the current instance is being edited.
83+
/// Remember to set it to false after you are done!
84+
/// </param>
85+
public delegate void CustomHotkeyDrawerFunc(BepInEx.Configuration.ConfigEntryBase setting, ref bool isCurrentlyAcceptingInput);
8686

87-
/// <summary>
88-
/// Show this setting in the settings screen at all? If false, don't show.
89-
/// </summary>
90-
public bool? Browsable;
87+
/// <summary>
88+
/// Show this setting in the settings screen at all? If false, don't show.
89+
/// </summary>
90+
public bool? Browsable;
9191

92-
/// <summary>
93-
/// Category the setting is under. Null to be directly under the plugin.
94-
/// </summary>
95-
public string Category;
92+
/// <summary>
93+
/// Category the setting is under. Null to be directly under the plugin.
94+
/// </summary>
95+
public string Category;
9696

97-
/// <summary>
98-
/// If set, a "Default" button will be shown next to the setting to allow resetting to default.
99-
/// </summary>
100-
public object DefaultValue;
97+
/// <summary>
98+
/// If set, a "Default" button will be shown next to the setting to allow resetting to default.
99+
/// </summary>
100+
public object DefaultValue;
101101

102-
/// <summary>
103-
/// Force the "Reset" button to not be displayed, even if a valid DefaultValue is available.
104-
/// </summary>
105-
public bool? HideDefaultButton;
102+
/// <summary>
103+
/// Force the "Reset" button to not be displayed, even if a valid DefaultValue is available.
104+
/// </summary>
105+
public bool? HideDefaultButton;
106106

107-
/// <summary>
108-
/// Force the setting name to not be displayed. Should only be used with a <see cref="CustomDrawer"/> to get more space.
109-
/// Can be used together with <see cref="HideDefaultButton"/> to gain even more space.
110-
/// </summary>
111-
public bool? HideSettingName;
107+
/// <summary>
108+
/// Force the setting name to not be displayed. Should only be used with a <see cref="CustomDrawer"/> to get more space.
109+
/// Can be used together with <see cref="HideDefaultButton"/> to gain even more space.
110+
/// </summary>
111+
public bool? HideSettingName;
112112

113-
/// <summary>
114-
/// Optional description shown when hovering over the setting.
115-
/// Not recommended, provide the description when creating the setting instead.
116-
/// </summary>
117-
public string Description;
113+
/// <summary>
114+
/// Optional description shown when hovering over the setting.
115+
/// Not recommended, provide the description when creating the setting instead.
116+
/// </summary>
117+
public string Description;
118118

119-
/// <summary>
120-
/// Name of the setting.
121-
/// </summary>
122-
public string DispName;
119+
/// <summary>
120+
/// Name of the setting.
121+
/// </summary>
122+
public string DispName;
123123

124-
/// <summary>
125-
/// Order of the setting on the settings list relative to other settings in a category.
126-
/// 0 by default, higher number is higher on the list.
127-
/// </summary>
128-
public int? Order;
124+
/// <summary>
125+
/// Order of the setting on the settings list relative to other settings in a category.
126+
/// 0 by default, higher number is higher on the list.
127+
/// </summary>
128+
public int? Order;
129129

130-
/// <summary>
131-
/// Only show the value, don't allow editing it.
132-
/// </summary>
133-
public bool? ReadOnly;
130+
/// <summary>
131+
/// Only show the value, don't allow editing it.
132+
/// </summary>
133+
public bool? ReadOnly;
134134

135-
/// <summary>
136-
/// If true, don't show the setting by default. User has to turn on showing advanced settings or search for it.
137-
/// </summary>
138-
public bool? IsAdvanced;
135+
/// <summary>
136+
/// If true, don't show the setting by default. User has to turn on showing advanced settings or search for it.
137+
/// </summary>
138+
public bool? IsAdvanced;
139139

140-
/// <summary>
141-
/// Custom converter from setting type to string for the built-in editor textboxes.
142-
/// </summary>
143-
public System.Func<object, string> ObjToStr;
140+
/// <summary>
141+
/// Custom converter from setting type to string for the built-in editor textboxes.
142+
/// </summary>
143+
public System.Func<object, string> ObjToStr;
144144

145-
/// <summary>
146-
/// Custom converter from string to setting type for the built-in editor textboxes.
147-
/// </summary>
148-
public System.Func<string, object> StrToObj;
145+
/// <summary>
146+
/// Custom converter from string to setting type for the built-in editor textboxes.
147+
/// </summary>
148+
public System.Func<string, object> StrToObj;
149149
}

0 commit comments

Comments
 (0)