Skip to content

Commit

Permalink
Fix item tooltips not getting parsed a second time
Browse files Browse the repository at this point in the history
Localisation got hands. Never bugfix on a sunday 1am. My bad. :(
  • Loading branch information
Xerren09 committed Jan 19, 2025
1 parent 830679c commit 7bb1526
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Patches/LocalisationPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ private static bool GetTootipData(Item __instance, ref IEnumerable<IHaveUIData>
string parsedTip = ParseTip(__instance, tip, out IMKbPromptProvider provider, out List<ControllerGlyphs.GlyphType> glyphType);
ret.Add(new ItemKeyTooltip(parsedTip, provider, glyphType));
}
// FIX: don't write the new array to the item, assuming it to be set via SetDefaultTooltips
// Set localised tooltips back as a failsafe
__instance.Tooltips = ret;
//__instance.Tooltips = ret;
__result = ret;
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion ShopApiPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class ShopApiPlugin
{
public const string MOD_GUID = "xerren.cwshopapi";
public const string MOD_NAME = "ShopAPI";
public const string MOD_VER = "1.0.1";
public const string MOD_VER = "1.0.2";

#if STEAM
static ShopApiPlugin()
Expand Down
3 changes: 1 addition & 2 deletions ShopLocalisation.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using ShopAPI.Patches;
using UnityEngine;
using UnityEngine;
using UnityEngine.Localization.Settings;

namespace ContentWarningShop.Localisation
Expand Down
3 changes: 3 additions & 0 deletions publish/thunderstore/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
All notable changes will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 1.0.2
- Fix tooltips not being parsed correctly when using the fallback

## 1.0.1
- Fix `GetTootipData` patch exception when null tooltips are set on the Item, and no localised strings were provided.
- This is unity's fault. Tooltips should be serialised correctly on Item resources, but they aren't loaded, so the count is correct but the text is null.
Expand Down
2 changes: 1 addition & 1 deletion publish/thunderstore/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ShopAPI",
"version_number": "1.0.1",
"version_number": "1.0.2",
"website_url": "https://github.com/Xerren09/ContentWarningShopAPI",
"description": "Exposes an easy-to-use API to add custom items to the in-game shop.",
"dependencies": [
Expand Down

0 comments on commit 7bb1526

Please sign in to comment.