public override string CompInspectStringExtra() { if (!BestMixUtility.IsValidForComp(parent)) { return(null); } var ModeDisplay = BestMixUtility.GetBMixModeDisplay(CurMode); return("BestMix.CurrentMode".Translate(ModeDisplay)); }
public override IEnumerable <Gizmo> CompGetGizmosExtra() { foreach (var item in base.CompGetGizmosExtra()) { yield return(item); } if (!BestMixUtility.IsValidForComp(parent)) { yield break; } if (!parent.Spawned || parent.Faction != Faction.OfPlayer) { yield break; } var BMixIconPath = BestMixUtility.GetBMixIconPath(CurMode); yield return(new Command_Action { action = delegate { SoundDefOf.Tick_Tiny.PlayOneShotOnCamera(); DoModeSelMenu(); }, hotKey = KeyBindingDefOf.Misc1, defaultLabel = "BestMix.SelectModeLabel".Translate(), defaultDesc = "BestMix.SelectModeDesc".Translate(), icon = ContentFinder <Texture2D> .Get(BMixIconPath) }); if (!Prefs.DevMode || !Controller.Settings.DebugMaster) { yield break; } var DebugIconPath = "UI/BestMix/DebugList"; yield return(new Command_Toggle { icon = ContentFinder <Texture2D> .Get(DebugIconPath), defaultLabel = "BestMix.DebugLabel".Translate(), defaultDesc = "BestMix.DebugDesc".Translate(), isActive = () => BMixDebug, toggleAction = delegate { ToggleDebug(BMixDebug); } }); }
public static Texture2D GetBillBMTex(Thing billGiver, Bill bill) { var mode = GetBillBMMode(billGiver, bill); var TexPath = "UI/BestMix/NONIcon"; if (mode != "NON") { TexPath = BestMixUtility.GetBMixIconPath(mode); } TexPath += "Bill"; //Log.Message("TexPath: " + TexPath); var tex = ContentFinder <Texture2D> .Get(TexPath, false); return(tex); }
private void DoModeSelMenu() { var list = new List <FloatMenuOption>(); string text = "BestMix.DoNothing".Translate(); list.Add(new FloatMenuOption(text, delegate { SetBMixMode(this, null, false); }, MenuOptionPriority.Default, null, null, 29f)); foreach (var mode in BestMixUtility.BMixModes()) { text = BestMixUtility.GetBMixModeDisplay(mode); list.Add(new FloatMenuOption(text, delegate { SetBMixMode(this, mode, true); }, MenuOptionPriority.Default, null, null, 29f)); } var sortedlist = list.OrderBy(bm => bm.Label).ToList(); Find.WindowStack.Add(new FloatMenu(sortedlist)); }
public static void Prefix(List <Thing> availableThings, List <IngredientCount> ingredients, List <ThingCount> chosen, IntVec3 rootCell, ref bool alreadySorted, Bill bill = null) { BestMixUtility.Sort(availableThings, rootCell, bill); alreadySorted = true; }