Skip to content

Commit

Permalink
Updated wrappers to use BepInEx 5.4.11 instead of 5.3. This change ma…
Browse files Browse the repository at this point in the history
…y not be back compatible with 5.3!
  • Loading branch information
Biendeo committed May 20, 2021
1 parent 7a96a27 commit 4a66622
Show file tree
Hide file tree
Showing 16 changed files with 57 additions and 27 deletions.
2 changes: 1 addition & 1 deletion AccuracyIndicator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ By pressing `Ctrl + Shift + F7`, you can bring up a window that allows you to cu

## How to install
- You will need Clone Hero **v0.23.2.2**. You can use any version from the website (i.e. Win64, Win32, Mac, or Linux), but your mileage with the launcher version may vary.
- Install [BepInEx v5.3](https://github.com/BepInEx/BepInEx/releases/tag/v5.3) into your Clone Hero directory.
- Install [BepInEx v5.4.11](https://github.com/BepInEx/BepInEx/releases/tag/v5.4.11) into your Clone Hero directory.
- Download the appropriate version and extract **all** of its files into your Clone Hero directory.
- Please verify that BepInEx has initialised by running the game after extracting, and then checking that there are five folders and a `LogOutput.log` file inside the `BepInEx` folder. One of those folders will be named `plugins`, and you'll need that to run the mods.
- Go to the [Releases page](https://github.com/Biendeo/My-Clone-Hero-Tweaks/releases) and download the latest version of Accuracy Indicator you want for your version of Clone Hero.
Expand Down
2 changes: 1 addition & 1 deletion BiendeoCHLib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ The common code for all of my mods. If you're a developer, you may also use this

## How to install
- You will need Clone Hero **v0.23.2.2**. You can use any version from the website (i.e. Win64, Win32, Mac, or Linux), but your mileage with the launcher version may vary.
- Install [BepInEx v5.3](https://github.com/BepInEx/BepInEx/releases/tag/v5.3) into your Clone Hero directory.
- Install [BepInEx v5.4.11](https://github.com/BepInEx/BepInEx/releases/tag/v5.4.11) into your Clone Hero directory.
- Download the appropriate version and extract **all** of its files into your Clone Hero directory.
- Please verify that BepInEx has initialised by running the game after extracting, and then checking that there are five folders and a `LogOutput.log` file inside the `BepInEx` folder. One of those folders will be named `plugins`, and you'll need that to run the mods.
- Go to the [Releases page](https://github.com/Biendeo/My-Clone-Hero-Tweaks/releases) and download the latest version of Biendeo CH Lib you want for your version of Clone Hero.
Expand Down
4 changes: 2 additions & 2 deletions BiendeoCHLib/Wrappers/CacheWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ public int Int1 {

public CacheState State {
get => (CacheState)stateField(Cache);
set => stateField(Cache) = value;
set => stateField(Cache) = (int)value;
}
[WrapperField("\u0314\u0314\u0313\u0311\u0311\u0314\u0318\u0314\u0311\u031C\u0312")]
private static readonly AccessTools.FieldRef<object, object> stateField;
private static readonly AccessTools.FieldRef<object, int> stateField;

public string BadSongsPath {
get => badSongsPathField(Cache);
Expand Down
11 changes: 11 additions & 0 deletions BiendeoCHLib/Wrappers/GameManagerWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ public BasePlayerWrapper UnknownBasePlayer {
[WrapperField("\u0316\u031C\u0312\u0312\u031C\u0315\u0314\u0310\u031A\u0314\u0317")]
private static readonly AccessTools.FieldRef<GameManager, BasePlayer> unknownBasePlayerField;

public bool ErrorWhileLoading {
get => errorWhileLoadingField(GameManager);
set => errorWhileLoadingField(GameManager) = value;
}
[WrapperField("\u0311\u0312\u0310\u031C\u0311\u031A\u031B\u030D\u0313\u030F\u030D")]
private static readonly AccessTools.FieldRef<GameManager, bool> errorWhileLoadingField;

#endregion

#region Methods
Expand All @@ -126,6 +133,10 @@ public List<NoteWrapper> GetNotesFromChart(CHPlayerWrapper player, bool recomput
[WrapperMethod("\u0310\u030F\u0315\u030F\u0311\u0314\u0311\u0314\u0315\u0318\u0316")]
private static readonly FastInvokeHandler onControllerDisconnectedMethod;

public void LoadSong() => loadSongMethod(GameManager);
[WrapperMethod("\u0316\u0319\u0312\u031B\u0316\u0316\u031A\u0316\u030D\u0318\u0318")]
private static readonly FastInvokeHandler loadSongMethod;

#endregion
}
}
8 changes: 4 additions & 4 deletions BiendeoCHLib/Wrappers/NoteWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,17 @@ public bool IsSustaining {

public MoonNoteWrapper.NoteType NoteType {
get => (MoonNoteWrapper.NoteType)noteTypeField(Note);
set => noteTypeField(Note) = value;
set => noteTypeField(Note) = (int)value;
}
[WrapperField("\u030F\u031A\u031B\u031B\u031A\u031A\u031C\u0310\u0315\u030E\u0319")]
private static readonly AccessTools.FieldRef<object, object> noteTypeField;
private static readonly AccessTools.FieldRef<object, int> noteTypeField;

public NoteFlags Flags {
get => (NoteFlags)flagsField(Note);
set => flagsField(Note) = value;
set => flagsField(Note) = (byte)value;
}
[WrapperField("\u030E\u031B\u0316\u0314\u031C\u0311\u031C\u030D\u0312\u0317\u0316")]
private static readonly AccessTools.FieldRef<object, object> flagsField;
private static readonly AccessTools.FieldRef<object, byte> flagsField;

public uint TickPosition {
get => tickPositionField(Note);
Expand Down
20 changes: 10 additions & 10 deletions BiendeoCHLib/Wrappers/PlayerProfileWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,38 +34,38 @@ public string PlayerName {
//? Different enum, there's more fields there
public InstrumentType Instrument {
get => (InstrumentType)instrumentField(PlayerProfile);
set => instrumentField(PlayerProfile) = value;
set => instrumentField(PlayerProfile) = (sbyte)value;
}
[WrapperField("\u030E\u031C\u0314\u031B\u030E\u031A\u0313\u030D\u0314\u0310\u031A")]
private static readonly AccessTools.FieldRef<object, object> instrumentField;
private static readonly AccessTools.FieldRef<object, sbyte> instrumentField;

public Difficulty Difficulty {
get => (Difficulty)difficultyField(PlayerProfile);
set => difficultyField(PlayerProfile) = value;
set => difficultyField(PlayerProfile) = (sbyte)value;
}
[WrapperField("\u030E\u0310\u0312\u031C\u0314\u031A\u030E\u031A\u0312\u0318\u030E")]
private static readonly AccessTools.FieldRef<object, object> difficultyField;
private static readonly AccessTools.FieldRef<object, sbyte> difficultyField;

public NoteWrapper.Modifier Modifiers {
get => (NoteWrapper.Modifier)modifiersField(PlayerProfile);
set => modifiersField(PlayerProfile) = value;
set => modifiersField(PlayerProfile) = (int)value;
}
[WrapperField("\u030E\u0315\u0317\u030F\u0312\u0316\u0313\u0311\u030E\u030D\u0318")]
private static readonly AccessTools.FieldRef<object, object> modifiersField;
private static readonly AccessTools.FieldRef<object, int> modifiersField;

public SongWrapper.Instrument SongInstrument {
get => (SongWrapper.Instrument)songInstrumentField(PlayerProfile);
set => songInstrumentField(PlayerProfile) = value;
set => songInstrumentField(PlayerProfile) = (int)value;
}
[WrapperField("\u0314\u0313\u0319\u0319\u030E\u0312\u031B\u0310\u0311\u030F\u0319")]
private static readonly AccessTools.FieldRef<object, object> songInstrumentField;
private static readonly AccessTools.FieldRef<object, int> songInstrumentField;

public SongWrapper.Difficulty SongDifficulty {
get => (SongWrapper.Difficulty)songDifficultyField(PlayerProfile);
set => songDifficultyField(PlayerProfile) = value;
set => songDifficultyField(PlayerProfile) = (int)value;
}
[WrapperField("\u0310\u030F\u0312\u031A\u0311\u031A\u0310\u0316\u0316\u0316\u0318")]
private static readonly AccessTools.FieldRef<object, object> songDifficultyField;
private static readonly AccessTools.FieldRef<object, int> songDifficultyField;

public GameSettingWrapper NoteSpeed {
get => GameSettingWrapper.Wrap(noteSpeedField(PlayerProfile));
Expand Down
3 changes: 3 additions & 0 deletions BiendeoCHLib/Wrappers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ private static readonly ConstructorInfo defaultConstructor;
- Inside this region, all fields of the class must be exposed as public properties with getters and setters if non-constant.
- The type of the field properties must match the original type. If the type uses an obfuscated typename, the wrapper type must be used (with appropriate work in the wrapper property to wrap the returned value in the getter and pass in the wrapped value in the setter). If it is a collection of obfuscated objects, again, additional work must be done to ensure that a collection of wrappers is returned and passed in. If it is another class with a generic of an obfuscated type, panic because I haven't thought that far in advance.
- The name of the field **must** be PascalCase naming, and the underlying FieldInfo must be camelCase with `Field` at the end of its name.
- For the underlying `FieldRef` objects, two generic parameters must be used: `T` and `F` respectively.
- The `T` parameter must be either the wrapped type is unobfuscated, or `object` if the wrapped type is obfuscated.
- The `F` parameter must match the field type as closely as possible. If any obfuscated types would appear in this type definition, then they should be replaced with `object`. Obfuscated enumerations however should be their underlying data type (e.g. `int`), but a cast should be used to turn a wrapper enumeration into that underlying value when setting the property. Field types with no obfuscation involved should match this value exactly.
```cs
public int Int1 {
get => int1Field(Cache);
Expand Down
14 changes: 14 additions & 0 deletions BiendeoCHLib/Wrappers/SongEntryWrapper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using BiendeoCHLib.Wrappers.Attributes;
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Linq;
Expand Down Expand Up @@ -28,5 +29,18 @@ public struct SongEntryWrapper {

#endregion

#region Methods

public bool ReadMetadataForSong() => (bool)readMetadataForSongMethod(SongEntry);
[WrapperMethod("\u0319\u031B\u0312\u0317\u0316\u0319\u0316\u0318\u030F\u0314\u0314")]
private static readonly FastInvokeHandler readMetadataForSongMethod;

public SongWrapper GetSongObject(bool someBool = false) => SongWrapper.Wrap(getSongObjectMethod(SongEntry, someBool));
[WrapperMethod("\u0310\u0314\u0316\u0318\u031A\u0317\u0312\u0311\u0315\u0310\u0311")]
private static readonly FastInvokeHandler getSongObjectMethod;


#endregion

}
}
2 changes: 1 addition & 1 deletion ComboIndicator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Get that Guitar Hero 3 nostalgia by having an animated note streak indicator pop

## How to install
- You will need Clone Hero **v0.23.2.2**. You can use any version from the website (i.e. Win64, Win32, Mac, or Linux), but your mileage with the launcher version may vary.
- Install [BepInEx v5.3](https://github.com/BepInEx/BepInEx/releases/tag/v5.3) into your Clone Hero directory.
- Install [BepInEx v5.4.11](https://github.com/BepInEx/BepInEx/releases/tag/v5.4.11) into your Clone Hero directory.
- Download the appropriate version and extract **all** of its files into your Clone Hero directory.
- Please verify that BepInEx has initialised by running the game after extracting, and then checking that there are five folders and a `LogOutput.log` file inside the `BepInEx` folder. One of those folders will be named `plugins`, and you'll need that to run the mods.
- Go to the [Releases page](https://github.com/Biendeo/My-Clone-Hero-Tweaks/releases) and download the latest version of Combo Indicator you want for your version of Clone Hero.
Expand Down
2 changes: 1 addition & 1 deletion ExtraSongUI/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ With this tweak, you can now see your song progress numerical, how many points y

## How to install
- You will need Clone Hero **v0.23.2.2**. You can use any version from the website (i.e. Win64, Win32, Mac, or Linux), but your mileage with the launcher version may vary.
- Install [BepInEx v5.3](https://github.com/BepInEx/BepInEx/releases/tag/v5.3) into your Clone Hero directory.
- Install [BepInEx v5.4.11](https://github.com/BepInEx/BepInEx/releases/tag/v5.4.11) into your Clone Hero directory.
- Download the appropriate version and extract **all** of its files into your Clone Hero directory.
- Please verify that BepInEx has initialised by running the game after extracting, and then checking that there are five folders and a `LogOutput.log` file inside the `BepInEx` folder. One of those folders will be named `plugins`, and you'll need that to run the mods.
- Go to the [Releases page](https://github.com/Biendeo/My-Clone-Hero-Tweaks/releases) and download the latest version of Extra Song UI you want for your version of Clone Hero.
Expand Down
2 changes: 1 addition & 1 deletion LegacyModLoader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ An alternative mod loader for CHLoader compatible mods.

## How to install
- You will need Clone Hero **v0.23.2.2**. You can use any version from the website (i.e. Win64, Win32, Mac, or Linux), but your mileage with the launcher version may vary.
- Install [BepInEx v5.3](https://github.com/BepInEx/BepInEx/releases/tag/v5.3) into your Clone Hero directory.
- Install [BepInEx v5.4.11](https://github.com/BepInEx/BepInEx/releases/tag/v5.4.11) into your Clone Hero directory.
- Download the appropriate version and extract **all** of its files into your Clone Hero directory.
- Please verify that BepInEx has initialised by running the game after extracting, and then checking that there are five folders and a `LogOutput.log` file inside the `BepInEx` folder. One of those folders will be named `plugins`, and you'll need that to run the mods.
- Go to the [Releases page](https://github.com/Biendeo/My-Clone-Hero-Tweaks/releases) and download the latest version of Legacy Mod Loader you want for your version of Clone Hero.
Expand Down
2 changes: 2 additions & 0 deletions MyCloneHeroTweaks.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9E7FE218-A85D-4596-BAD8-B27249C1CE5A}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
appveyor.yml = appveyor.yml
LICENSE.md = LICENSE.md
README.md = README.md
versions.txt = versions.txt
EndProjectSection
Expand Down
2 changes: 1 addition & 1 deletion PerfectMode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ By pressing `Ctrl + Shift + F6`, you can bring up a window that allows you to cu

## How to install
- You will need Clone Hero **v0.23.2.2**. You can use any version from the website (i.e. Win64, Win32, Mac, or Linux), but your mileage with the launcher version may vary.
- Install [BepInEx v5.3](https://github.com/BepInEx/BepInEx/releases/tag/v5.3) into your Clone Hero directory.
- Install [BepInEx v5.4.11](https://github.com/BepInEx/BepInEx/releases/tag/v5.4.11) into your Clone Hero directory.
- Download the appropriate version and extract **all** of its files into your Clone Hero directory.
- Please verify that BepInEx has initialised by running the game after extracting, and then checking that there are five folders and a `LogOutput.log` file inside the `BepInEx` folder. One of those folders will be named `plugins`, and you'll need that to run the mods.
- Go to the [Releases page](https://github.com/Biendeo/My-Clone-Hero-Tweaks/releases) and download the latest version of Perfect Mode you want for your version of Clone Hero.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A bunch of Clone Hero tweaks I have made!

## How to install
- You will need Clone Hero **v0.23.2.2**. You can use any version from the website (i.e. Win64, Win32, Mac, or Linux), but your mileage with the launcher version may vary.
- Install [BepInEx v5.3](https://github.com/BepInEx/BepInEx/releases/tag/v5.3) into your Clone Hero directory.
- Install [BepInEx v5.4.11](https://github.com/BepInEx/BepInEx/releases/tag/v5.4.11) into your Clone Hero directory.
- Download the appropriate version and extract **all** of its files into your Clone Hero directory.
- Please verify that BepInEx has initialised by running the game after extracting, and then checking that there are five folders and a `LogOutput.log` file inside the `BepInEx` folder. One of those folders will be named `plugins`, and you'll need that to run the mods.
- Go to the [Releases page](https://github.com/Biendeo/My-Clone-Hero-Tweaks/releases) and download the latest versions of the mods you want for your version of Clone Hero.
Expand Down
2 changes: 1 addition & 1 deletion SplashTextEditor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ By pressing `Ctrl + Shift + F9`, you can bring up a window that allows you to cu

## How to install
- You will need Clone Hero **v0.23.2.2**. You can use any version from the website (i.e. Win64, Win32, Mac, or Linux), but your mileage with the launcher version may vary.
- Install [BepInEx v5.3](https://github.com/BepInEx/BepInEx/releases/tag/v5.3) into your Clone Hero directory.
- Install [BepInEx v5.4.11](https://github.com/BepInEx/BepInEx/releases/tag/v5.4.11) into your Clone Hero directory.
- Download the appropriate version and extract **all** of its files into your Clone Hero directory.
- Please verify that BepInEx has initialised by running the game after extracting, and then checking that there are five folders and a `LogOutput.log` file inside the `BepInEx` folder. One of those folders will be named `plugins`, and you'll need that to run the mods.
- Go to the [Releases page](https://github.com/Biendeo/My-Clone-Hero-Tweaks/releases) and download the latest version of Splash Text Editor you want for your version of Clone Hero.
Expand Down
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ branches:
skip_tags: true

cache:
- BepInEx-Libraries
#- BepInEx-Libraries
- CH-Libraries

install:
Expand All @@ -25,8 +25,8 @@ install:
- echo Downloading BepInEx
- ps: |
if (-not (Test-Path .\BepInEx-Libraries)) {
Start-FileDownload 'https://github.com/BepInEx/BepInEx/releases/download/v5.3/BepInEx_x64_5.3.0.0.zip'
7z x BepInEx_x64_5.3.0.0.zip
Start-FileDownload 'https://github.com/BepInEx/BepInEx/releases/download/v5.4.11/BepInEx_x64_5.4.11.0.zip'
7z x BepInEx_x64_5.4.11.0.zip
New-Item -ItemType Directory -Path 'BepInEx-Libraries'
Copy-Item -Path '.\BepInEx\core\*' -Destination 'BepInEx-Libraries' -Recurse
}
Expand Down

0 comments on commit 4a66622

Please sign in to comment.