Beispiel #1
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); }
        });
    }
Beispiel #2
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);
    }