边缘世界 RimWorld

边缘世界 RimWorld

Psychology (unofficial) v1.1-1.6
Cedaro 2023 年 8 月 18 日 上午 1:13
Inspector tab disappear
When changing pawn's backstory using Character Editor, the Psyche tab will disappear until reload the save.

This is because Psychology is using an unsafe approach to inject inspector tab dynamically.

The problem is at Psychology.SpeciesHelper:AddInspectorTabToDefAndCorpseDef, codes in this form:

if (t.inspectorTabsResolved == null) { t.inspectorTabsResolved = new List<InspectTabBase>(1); } t.inspectorTabsResolved.AddDistinct(InspectTabManager.GetSharedInstance(typeof(ITab_Pawn_Psyche)));

Directly touching inspectorTabsResolved is unsafe, changes will be overwrited at any time when others resolve it again.

Here's a better approach:

if (t.inspectorTabs == null) { t.inspectorTabs = new List<Type>(1); } t.inspectorTabs.Add(typeof(ITab_Pawn_Psyche)); t.ResolveReferences();
最后由 Cedaro 编辑于; 2023 年 8 月 18 日 上午 1:15
< >
正在显示第 1 - 1 条,共 1 条留言
che_lovek  [开发者] 2024 年 2 月 8 日 上午 8:21 
I've tested this and it does indeed seem to fix a couple of tab telated issues.
Thank you for the suggestion!
< >
正在显示第 1 - 1 条,共 1 条留言
每页显示数: 1530 50