Compare commits

..

7 commits
0.41.1 ... main

Author SHA1 Message Date
Ell
c0cc18b0a0 only save the options to disk
when they get removed from the ui
2024-06-27 20:54:03 +02:00
Ell
3da4807b57 0.42.4 2024-06-19 12:57:19 +02:00
Ell
eb19f848e0 0.42.3 2024-06-17 22:36:54 +02:00
Ell
0922ecefc5 0.42.2 2024-06-15 12:48:45 +02:00
Ell
977ad2d401 0.42.1 2024-06-09 20:51:37 +02:00
Ell
c963a9781c 0.42.0 2024-06-09 17:07:26 +02:00
Ell
339411aed6 0.41.2 2024-05-01 17:59:47 +02:00
2 changed files with 4 additions and 6 deletions

View file

@ -34,7 +34,7 @@ public class ExampleMod : Mod {
public override string Description => "This is the example mod for Tiny Life!"; public override string Description => "This is the example mod for Tiny Life!";
public override TextureRegion Icon => this.uiTextures[new Point(0, 0)]; public override TextureRegion Icon => this.uiTextures[new Point(0, 0)];
public override string IssueTrackerUrl => "https://github.com/Ellpeck/TinyLifeExampleMod/issues"; public override string IssueTrackerUrl => "https://github.com/Ellpeck/TinyLifeExampleMod/issues";
public override string TestedVersionRange => "[0.41.0,0.41.1]"; public override string TestedVersionRange => "[0.42.0,0.42.4]";
private Dictionary<Point, TextureRegion> customTops; private Dictionary<Point, TextureRegion> customTops;
private Dictionary<Point, TextureRegion> customHairs; private Dictionary<Point, TextureRegion> customHairs;
@ -152,11 +152,9 @@ public class ExampleMod : Mod {
group.AddChild(new Paragraph(Anchor.AutoLeft, 1, _ => $"{Localization.Get(LnCategory.Ui, "ExampleMod.DarkShirtSpeedOption")}: {ExampleMod.Options.DarkShirtSpeedIncrease}")); group.AddChild(new Paragraph(Anchor.AutoLeft, 1, _ => $"{Localization.Get(LnCategory.Ui, "ExampleMod.DarkShirtSpeedOption")}: {ExampleMod.Options.DarkShirtSpeedIncrease}"));
group.AddChild(new Slider(Anchor.AutoLeft, new Vector2(1, 10), 5, 5) { group.AddChild(new Slider(Anchor.AutoLeft, new Vector2(1, 10), 5, 5) {
CurrentValue = ExampleMod.Options.DarkShirtSpeedIncrease, CurrentValue = ExampleMod.Options.DarkShirtSpeedIncrease,
OnValueChanged = (_, v) => { OnValueChanged = (_, v) => ExampleMod.Options.DarkShirtSpeedIncrease = v
ExampleMod.Options.DarkShirtSpeedIncrease = v;
info.SaveOptions(ExampleMod.Options);
}
}); });
group.OnRemovedFromUi += _ => info.SaveOptions(ExampleMod.Options);
} }
} }

View file

@ -5,7 +5,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="TinyLifeApi" Version="0.41.1" /> <PackageReference Include="TinyLifeApi" Version="0.42.4" />
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.1.303" /> <PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.1.303" />
<PackageReference Include="Lib.Harmony" Version="2.2.2" /> <PackageReference Include="Lib.Harmony" Version="2.2.2" />