Skip to content

Commit

Permalink
v1.3.0
Browse files Browse the repository at this point in the history
- added compact mode for
- added in-game translations support
  • Loading branch information
Dastan21 committed Jan 18, 2022
1 parent 211be7c commit c884c1d
Show file tree
Hide file tree
Showing 12 changed files with 89 additions and 44 deletions.
3 changes: 2 additions & 1 deletion PantheonsHitCounter/Data.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ public class GlobalData
[JsonConverter(typeof(PlayerActionSetConverter))]
public ButtonBinds buttonbinds = new ButtonBinds();

public bool anonymize;
public bool compactMode;
public bool anonymize;
public bool translated = true;
public int totalSplits = defaultSplitsNumber;
}

Expand Down
13 changes: 11 additions & 2 deletions PantheonsHitCounter/ModMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ private static Menu PrepareMenu(ModToggleDelegates toggle)
maxValue = PantheonsHitCounter.instance.globalData.compactMode ? PantheonsHitCounter.CompactSplitsCountMax : PantheonsHitCounter.DefaultSplitsCountMax,
wholeNumbers = true
},
new TextPanel("(Can be slow with lots of splits)", fontSize: 25),
new HorizontalOption(
"Counter mode",
"Interface mode of the counter",
Expand All @@ -70,7 +69,17 @@ private static Menu PrepareMenu(ModToggleDelegates toggle)
PantheonsHitCounter.instance.globalData.anonymize = anonymize == 1;
PantheonsHitCounter.instance.ToggleCurrentCounter();
},
() => PantheonsHitCounter.instance.globalData.compactMode ? 1 : 0
() => PantheonsHitCounter.instance.globalData.anonymize ? 1 : 0
),
new HorizontalOption(
"Translation",
"Enables local translation",
new []{ "Off", "On" },
translated => {
PantheonsHitCounter.instance.globalData.translated = translated == 1;
PantheonsHitCounter.instance.ToggleCurrentCounter();
},
() => PantheonsHitCounter.instance.globalData.translated ? 1 : 0
),
new MenuButton(
"Keyboard bindings",
Expand Down
1 change: 1 addition & 0 deletions PantheonsHitCounter/Pantheon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public void PreviousBoss()
[Serializable]
public class Boss
{
[JsonProperty("key")] public string key;
[JsonProperty("name")] public string name;
[JsonProperty("scene")] public string sceneName;
public int hits;
Expand Down
7 changes: 5 additions & 2 deletions PantheonsHitCounter/PantheonsHitCounter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ public class PantheonsHitCounter : Mod, IGlobalSettings<GlobalData>, ILocalSetti
private static readonly string[] CompletedScene = { "GG_End_Sequence", "End_Game_Completion" };
public const int SplitsMin = 3;
public const int DefaultSplitsCountMax = 10;
public const int CompactSplitsCountMax = 30;
public const int CompactSplitsCountMax = 22;

public PantheonsHitCounter() : base("Pantheons Hit Counter") {}
public override string GetVersion() => "1.2.0";
public override string GetVersion() => "1.3.0";
public void OnLoadGlobal(GlobalData data) => globalData = data;
public GlobalData OnSaveGlobal() => globalData;
public void OnLoadLocal(LocalData data) => _localData = data;
Expand Down Expand Up @@ -65,6 +65,8 @@ public override void Initialize()
private void OnRandomizedPantheon(On.BossSequenceDoor.orig_Start orig, BossSequenceDoor self)
{
orig(self);

if (!self.descriptionKey.StartsWith("UI_CHALLENGE_DESC_")) return;

var bossSequence = self.bossSequence;
var number = int.Parse(self.descriptionKey.Replace("UI_CHALLENGE_DESC_", ""));
Expand All @@ -79,6 +81,7 @@ private void OnRandomizedPantheon(On.BossSequenceDoor.orig_Start orig, BossSeque
var boss = pantheon.GetBossBySceneName(bossScene.sceneName);
var newBoss = new Boss
{
key = boss.key,
sceneName = bossScene.sceneName,
name = boss.name,
hitsPb = boss.hitsPb
Expand Down
105 changes: 66 additions & 39 deletions PantheonsHitCounter/UI/CounterUI.cs

Large diffs are not rendered by default.

Binary file modified PantheonsHitCounter/UI/Images/BackgroundBossCompact.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PantheonsHitCounter/UI/Images/BackgroundBottomCompact.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PantheonsHitCounter/UI/Images/BackgroundTopCompact.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added PantheonsHitCounter/UI/Images/BreakCompact.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PantheonsHitCounter/UI/Images/SelectedBossCompact.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PantheonsHitCounter/UI/Images/SplitCompact.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@ Note: If Grey Prince Zote isn't unlocked, it will not appear in the list.

<img title="Screenshot of Pantheons Hit Counter" src="https://i.imgur.com/bc3pNlu.png" width="800"/>

Compact mode + in-game translation (french here)

<img title="Screenshot of Pantheons Hit Counter" src="https://i.imgur.com/ebrAixX.png" width="200"/>

## Edit PB
Go to your saves folder (on Windows `...\AppData\LocalLow\Team Cherry\Hollow Knight\`), open the file named `userX.modded.json` (X is the number of the save) and edit the PB at the `Pantheons Hit Counter` section.

0 comments on commit c884c1d

Please sign in to comment.