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); }
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); }