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

        var ModeDisplay = BestMixUtility.GetBMixModeDisplay(CurMode);

        return("BestMix.CurrentMode".Translate(ModeDisplay));
    }
Ejemplo 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); }
        });
    }