ZeroRyuk Posted March 14, 2020 Share Posted March 14, 2020 For some reason the ui for my baby critter isn't working, I don't know why and what's wrong with it. The mob looks ok ingame only the UI isn't appearing in the database and I keep getting a warning. [WARNING] baby_lagoo_kanim ui placeSymbol [ 0x0 ] is missing I already tried replacing it multiple times and even tried using the adult's kanim and even the egg's, and those two seem to work just fine. Also tried copying exactly the placement with the adult mob's UI and still get the same problem. I also made a making a separate kanim with just the UI and that seem to work, I just don't know how to load a sprite outside if I'm just gonna make a seperate kanim for it. This is how I implement the UI. My reference for it is rollersnake's https://github.com/daviscook477/ONI-Mods/blob/master/src/RollerSnake/RollerSnakePatches.cs private static void Action(Tag speciesTag, string name, Dictionary<string, CodexEntry> results) { List<GameObject> brains = Assets.GetPrefabsWithComponent<CreatureBrain>(); CodexEntry entry = new CodexEntry("CREATURES", new List<ContentContainer>() { new ContentContainer(new List<ICodexWidget>() { new CodexSpacer(), new CodexSpacer() }, ContentContainer.ContentLayout.Vertical) }, name); entry.parentId = "CREATURES"; CodexCache.AddEntry(speciesTag.ToString(), entry, null); results.Add(speciesTag.ToString(), entry); foreach (GameObject gameObject in brains) { if (gameObject.GetDef<BabyMonitor.Def>() == null) { Sprite sprite = null; GameObject prefab = Assets.TryGetPrefab((LagooConfig.BabyId)); string maindir = Directory.GetParent(Assembly.GetExecutingAssembly().Location).ToString() + Path.DirectorySeparatorChar.ToString(); CreatureBrain component = gameObject.GetComponent<CreatureBrain>(); string symbolPrefix = component.symbolPrefix; if (prefab != null) { sprite = Def.GetUISprite(prefab, symbolPrefix + "ui", false).first; } if (component.species == speciesTag) { List<ContentContainer> contentContainerList = new List<ContentContainer>(); Sprite first = Def.GetUISprite(gameObject, symbolPrefix + "ui", false).first; if ((bool)((Object)sprite)) { Traverse.Create(typeof(CodexEntryGenerator)).Method("GenerateImageContainers", new[] { typeof(Sprite[]), typeof(List<ContentContainer>), typeof(ContentContainer.ContentLayout) }) .GetValue(new Sprite[2] { first, sprite }, contentContainerList, ContentContainer.ContentLayout.Horizontal); } else { contentContainerList.Add(new ContentContainer(new List<ICodexWidget>() { new CodexImage(128, 128, first) }, ContentContainer.ContentLayout.Vertical)); } Traverse.Create(typeof(CodexEntryGenerator)).Method("GenerateCreatureDescriptionContainers", new[] { typeof(GameObject), typeof(List<ContentContainer>) }).GetValue(gameObject, contentContainerList); entry.subEntries.Add(new SubEntry(component.PrefabID().ToString(), speciesTag.ToString(), contentContainerList, component.GetProperName()) { icon = first, iconColor = Color.white }); } } } Asset.rar Link to comment Share on other sites More sharing options...
ZeroRyuk Posted March 18, 2020 Author Share Posted March 18, 2020 [Solved it somehow?] I used an older version of kanimal (1.3.0). I made a copy of the sprite and keep them both at the same folder when compiling, it still doesn't work when only one image is avail. I have no idea why it needs 2 and somehow just works. In case someone else has a problem with UI hope this helps. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.