Exemplo n.º 1
0
    public override string CompInspectStringExtra()
    {
        if (!BestMixUtility.IsValidForComp(parent))
        {
            return(null);
        }

        var ModeDisplay = BestMixUtility.GetBMixModeDisplay(CurMode);

        return("BestMix.CurrentMode".Translate(ModeDisplay));
    }
Exemplo n.º 2
0
    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); }
        });
    }
Exemplo n.º 3
0
    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);
    }
Exemplo n.º 4
0
    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));
    }
Exemplo n.º 5
0
 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;
 }