Skip to content

Commit 46cf734

Browse files
Ck3.5 (#49)
- Kills directory style dumps - Skin authors can disable directory swaps by going into tools > disable directory swap to test their skins - Improved speed when dumping names.json by resuming dumps. - This skips existing files and names.json entries, authors must delete the folder to do a fresh dump, - Animated sprites can be dumped (The frame you care about MUST show up visually for it to dump), - Experimental animated sprite swapping can be done by modifiying the sprites in ck_spr_anim. - Currently this only supports shade lord. - Add support for displaying charms in some other places in the UI correctly, - Support for grimm flame UI (regenerating default skin generates the files in charms/front.png or charms/back.png), - Help text in pause menu advising about the keybind to toggle the menu - Default particle swaps to enabled in this version - Fix GH workflows
1 parent 3650137 commit 46cf734

21 files changed

+440
-131
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,13 @@ jobs:
2525
apiPath: HKManaged
2626
dependencyFilePath: ModDependencies.txt
2727
- name: Setup .NET
28-
uses: actions/setup-dotnet@v1
29-
- name: Setup ms-build
30-
run: sudo apt-get install -y nuget mono-devel mono-xbuild
28+
uses: actions/setup-dotnet@v3
3129
- name: Restore dependencies
3230
run: dotnet restore
3331
- name: Build Mod
3432
run: dotnet build -c Release
3533
- name: Upload Mod
36-
uses: actions/upload-artifact@v2
34+
uses: actions/upload-artifact@v4
3735
with:
3836
name: CustomKnightModlinks
3937
path: ./CustomKnight/bin/Release

.github/workflows/pinned.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,13 @@ jobs:
2525
apiPath: HKManaged
2626
dependencyFilePath: ModDependencies_pinned.txt
2727
- name: Setup .NET
28-
uses: actions/setup-dotnet@v1
29-
- name: Setup ms-build
30-
run: sudo apt-get install -y nuget mono-devel mono-xbuild
28+
uses: actions/setup-dotnet@v3
3129
- name: Restore dependencies
3230
run: dotnet restore
3331
- name: Build Mod
3432
run: dotnet build -c Release
3533
- name: Upload Mod
36-
uses: actions/upload-artifact@v2
34+
uses: actions/upload-artifact@v4
3735
with:
3836
name: CustomKnightPinned
3937
path: ./CustomKnight/bin/Release

CustomKnight/CustomKnight.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<OutputType>Library</OutputType>
44
<RootNamespace>CustomKnight</RootNamespace>
55
<AssemblyName>CustomKnight</AssemblyName>
6-
<AssemblyVersion>3.1.0</AssemblyVersion>
6+
<AssemblyVersion>3.5.0</AssemblyVersion>
77
<TargetFramework>net472</TargetFramework>
88
<FileAlignment>512</FileAlignment>
99
<Deterministic>true</Deterministic>

CustomKnight/GlobalUsings.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
global using HutongGames.PlayMaker.Actions;
2-
global using Modding;
3-
global using Satchel;
41
global using System;
52
global using System.Collections;
63
global using System.Collections.Generic;
4+
global using HutongGames.PlayMaker.Actions;
5+
global using Modding;
6+
global using Satchel;
77
global using UnityEngine;
88
global using UnityEngine.SceneManagement;

CustomKnight/Menu/AuthorsMenu.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ internal class AuthorsMenu
1010
internal static Menu PrepareMenu()
1111
{
1212
var menu = new Menu("Author Tools", new Element[]{
13-
new HorizontalOption(
14-
"Dump Style", "Choose dump style, Names.Json is Recommended, Directory is Faster",
15-
new string[] { "Names.Json", "Directory" },
16-
(setting) => { CustomKnight.GlobalSettings.DumpOldSwaps = setting == 1; },
17-
() => CustomKnight.GlobalSettings.DumpOldSwaps ? 1 : 0,
18-
Id:"SelectDumpOption"),
1913
new MenuButton("Dump","Dumps the sprites that Swapper supports (Expect lag)",(_)=>ToggleDumping(),Id:"DumpButton"),
14+
Blueprints.HorizontalBoolOption(
15+
"Disable directory swap","(restart required)",
16+
(v) => {
17+
CustomKnight.GlobalSettings.DisableDirectorySwaps = v;
18+
},
19+
() => CustomKnight.GlobalSettings.DisableDirectorySwaps),
2020
});
2121

2222
return menu;

CustomKnight/Menu/BetterMenu.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
using System.Linq;
12
using CustomKnight.NewUI;
23
using Satchel.BetterMenus;
3-
using System.Linq;
44

55
namespace CustomKnight
66
{

CustomKnight/NewUI/UIController.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System.Linq;
2-
using UnityEngine.UI;
1+
using UnityEngine.UI;
32

43
namespace CustomKnight.NewUI
54
{
@@ -215,6 +214,14 @@ public static void CreateUpdateGUI()
215214

216215
var title = new UIText(content, "Title", "Skin List");
217216
title.text.fontSize = 25;
217+
title.textTransform.sizeDelta = new Vector2(168f, 25f);
218+
219+
var keybind = CustomKnight.GlobalSettings.Keybinds.OpenSkinList.GetKeyOrMouseBinding().Key;
220+
var helpText = new UIText(content, "helpText", $"Press {keybind} to toggle menu");
221+
helpText.text.fontSize = 10;
222+
helpText.text.alignment = TextAnchor.UpperCenter;
223+
helpText.textTransform.sizeDelta = new Vector2(168f, 50f);
224+
218225
var favSkins = new List<string>();
219226
favSkins.AddRange(CustomKnight.GlobalSettings.FavoriteSkins);
220227
favSkins.AddRange(CustomKnight.GlobalSettings.RecentSkins);

CustomKnight/NewUI/UIText.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ internal class UIText
99
public GameObject parent;
1010
public GameObject self;
1111
public Text text;
12+
public RectTransform textTransform;
1213
public UIText(GameObject parent, string name, string value)
1314
{
1415
this.name = name;
@@ -22,7 +23,7 @@ private void Build()
2223
self = new GameObject(name);
2324
self.transform.SetParent(parent.transform, false);
2425
self.AddComponent<CanvasRenderer>();
25-
RectTransform textTransform = self.AddComponent<RectTransform>();
26+
textTransform = self.AddComponent<RectTransform>();
2627
text = self.AddComponent<Text>();
2728
text.text = this.value;
2829
text.fontStyle = FontStyle.Bold;

CustomKnight/Settings.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ public class GlobalModSettings
5757
[JsonProperty]
5858
private Dictionary<int, string> saveSkins = new Dictionary<int, string>() { { 0, SkinManager.DEFAULT_SKIN }, { 1, SkinManager.DEFAULT_SKIN }, { 2, SkinManager.DEFAULT_SKIN }, { 3, SkinManager.DEFAULT_SKIN } };
5959

60-
/// <summary>
61-
/// Option to dump swaps in the old directory style
62-
/// </summary>
63-
public bool DumpOldSwaps { get; set; } = false;
6460

6561
/// <summary>
6662
/// Option to enable the new Pause Menu
@@ -75,7 +71,12 @@ public class GlobalModSettings
7571
/// <summary>
7672
/// Option to enable swapping particles (only active when swap is enabled)
7773
/// </summary>
78-
public bool EnableParticleSwap { get; set; } = false;
74+
public bool EnableParticleSwap { get; set; } = true;
75+
76+
/// <summary>
77+
/// Option to disable loading directory swaps, makes it possible to debug skins incompatible with names.json
78+
/// </summary>
79+
public bool DisableDirectorySwaps { get; set; } = false;
7980

8081
/// <summary>
8182
/// Used to indicate to generate default skin on next restart

CustomKnight/Skin/Base/SkinManager.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using System.Drawing;
21
using System.IO;
2+
using CustomKnight.Skin.Base.SkinableItems;
33
using static Satchel.IoUtils;
44

55
namespace CustomKnight
@@ -191,6 +191,8 @@ public static class SkinManager
191191
{BrummShield.NAME,new BrummShield() },
192192
{FlowerBreak.NAME,new FlowerBreak() },
193193
{Salubra.NAME,new Salubra() },
194+
{FlameUI.FRONT,new FlameUI(FlameUI.FRONT) },
195+
{FlameUI.BACK,new FlameUI(FlameUI.BACK) },
194196
// {"PinsScarab", new Pins()}
195197
};
196198
/// <summary>
@@ -415,7 +417,8 @@ public static void SetSkinById(string id)
415417
CustomKnight.GlobalSettings.DefaultSkin = id;
416418
CustomKnight.SaveSettings.DefaultSkin = id;
417419
GlobalModSettings.SetSkinForProfileID(GameManager.instance.profileID, id);
418-
};
420+
}
421+
;
419422
if (CurrentSkin?.GetId() == Skin.GetId()) { return; }
420423
CurrentSkin = Skin;
421424
CustomKnight.GlobalSettings.AddRecentSkin(id);

0 commit comments

Comments
 (0)