simplified the README and split parts of it into docs

This commit is contained in:
2026-09-19 15:50:11 +01:00
parent 3449f141fa
commit ad77d042de
4 changed files with 96 additions and 276 deletions
+35
View File
@@ -0,0 +1,35 @@
# Common Issues
## dnSpy Import Project
When trying to load a disassembled project that was then reassembled with dnSpy into Visual Studio you'll encounter the error:
`A numeric comparison was attempted on "$(_TargetFrameworkVersionWithoutV)" that evaluates to "" instead of a number, in condition "('$(TargetFrameworkIdentifier)' != '.NETCoreApp'`
This is because the project file generated by dnSpy is adding a v to <TargetFrameworkVersion> and as well as not including _TargetFrameworkVersionWithoutV. To fix this:
1. Open the .csproj file in a text editor.
2. Near the top you'll see these two lines:
```xml
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
<TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
```
Modify the first line (remove the "v"), and insert the second line, so it looks like this:
```xml
<TargetFrameworkVersion>5.0</TargetFrameworkVersion>
<_TargetFrameworkVersionWithoutV>5.0</_TargetFrameworkVersionWithoutV>
<TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
```
Load the project as you were, and it should work.
Mileage may vary with different versions of Visual Studio and .NET SDK, but this is the general fix for the issue.
[Source](https://www.clearhat.org/post/how-fix-numeric-comparison-was-attempted-_targetframeworkversionwithoutv-evaluates-instead-number-condition-targetframeworkidentifier-netcoreapp)
## Encoding issues in BepInEx Console
"—" always shows as ΓòÉ on BepInEx Console. Use the regular hyphen "-" instead.
+57
View File
@@ -0,0 +1,57 @@
# Snippets
## Periodic Timer
```csharp
private static float _timer;
private const float INTERVAL = 10f;
private static void UpdatePostfix()
{
_timer += UnityEngine.Time.deltaTime;
if (_timer < INTERVAL) return;
_timer = 0f;
// Do something every 10 seconds
}
```
## Singleton Access
```csharp
// Most game managers use the Singleton pattern
var instance = ManagerType.GetProperty("Instance").GetValue(null);
```
## Safe Reflection
```csharp
try
{
var method = type.GetMethod("MethodName");
if (method == null)
{
Log.LogWarning("Method not found!");
return;
}
method.Invoke(instance, args);
}
catch (Exception ex)
{
Log.LogError($"Reflection error: {ex.Message}");
}
```
## Patch All Overloads
```csharp
var methods = targetType.GetMethods(BindingFlags.Public | BindingFlags.Instance);
foreach (var method in methods)
{
if (method.Name == "TargetMethod")
{
_harmony.Patch(method, prefix: myPrefix);
}
}
```
+13
View File
@@ -0,0 +1,13 @@
Task list placeholders:
- [ ] Split mission automation into separate files in a project subfolder
- [ ] Add mission discovery service placeholder
- [ ] Add mission claim executor placeholder
- [ ] Add mission claim cache placeholder
- [ ] Add mission eligibility rules placeholder
- [ ] Add free daily currency handler cleanup placeholder
- [ ] Review reflection helper reuse across handlers
Notes:
- Replace placeholders with concrete implementation tasks.
- Keep tasks short and actionable.