예제 #1
0
        private static HudWidget GetNeedWidget(PawnModel model, string defName)
        {
            var def = DefDatabase <NeedDef> .GetNamed(defName, false);

            if (def != null)
            {
                return((HudWidget)HudBar.FromModel(new NeedModel(model, def), Theme.RegularTextStyle) ?? HudBlank.GetEmpty);
            }

            Mod.ErrorOnce($"Invalid HUD Widget, Need def '{defName}' not found", "InvalidNeedDefName" + defName);
            return(HudBlank.GetEmpty);
        }
예제 #2
0
        private static HudWidgetBase GetNeedWidget(PawnModel model, string defName)
        {
            var def = DefDatabase <NeedDef> .GetNamed(defName, false);

            if (def != null)
            {
                return((HudWidgetBase)HudBar.FromModel(new NeedModel(model, def), Theme.RegularTextStyle) ?? HudBlank.GetEmpty);
            }

            Mod.Warning($"Invalid HUD Widget, Need def '{defName}' not found, resetting layout to default");
            RequiredReset();
            return(HudBlank.GetEmpty);
        }