Skip to content

Commit 7bb1526

Browse files
committed
Fix item tooltips not getting parsed a second time
Localisation got hands. Never bugfix on a sunday 1am. My bad. :(
1 parent 830679c commit 7bb1526

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

Patches/LocalisationPatches.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ private static bool GetTootipData(Item __instance, ref IEnumerable<IHaveUIData>
5757
string parsedTip = ParseTip(__instance, tip, out IMKbPromptProvider provider, out List<ControllerGlyphs.GlyphType> glyphType);
5858
ret.Add(new ItemKeyTooltip(parsedTip, provider, glyphType));
5959
}
60+
// FIX: don't write the new array to the item, assuming it to be set via SetDefaultTooltips
6061
// Set localised tooltips back as a failsafe
61-
__instance.Tooltips = ret;
62+
//__instance.Tooltips = ret;
6263
__result = ret;
6364
return false;
6465
}

ShopApiPlugin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class ShopApiPlugin
1717
{
1818
public const string MOD_GUID = "xerren.cwshopapi";
1919
public const string MOD_NAME = "ShopAPI";
20-
public const string MOD_VER = "1.0.1";
20+
public const string MOD_VER = "1.0.2";
2121

2222
#if STEAM
2323
static ShopApiPlugin()

ShopLocalisation.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using ShopAPI.Patches;
2-
using UnityEngine;
1+
using UnityEngine;
32
using UnityEngine.Localization.Settings;
43

54
namespace ContentWarningShop.Localisation

publish/thunderstore/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
All notable changes will be documented in this file.
44
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
55

6+
## 1.0.2
7+
- Fix tooltips not being parsed correctly when using the fallback
8+
69
## 1.0.1
710
- Fix `GetTootipData` patch exception when null tooltips are set on the Item, and no localised strings were provided.
811
- 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.

publish/thunderstore/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ShopAPI",
3-
"version_number": "1.0.1",
3+
"version_number": "1.0.2",
44
"website_url": "https://github.com/Xerren09/ContentWarningShopAPI",
55
"description": "Exposes an easy-to-use API to add custom items to the in-game shop.",
66
"dependencies": [

0 commit comments

Comments
 (0)