Ejemplo n.º 1
0
        private void SetMoreRange(CompQuality comp = null)
        {
            if (comp == null)
            {
                if ((comp = compQuality) == null)
                {
                    return;
                }
            }

            moreRange = ToolsQuality.FactorCapacity(Props.moreRangeBase, Props.moreRange, comp, false, false, false, prcDebug);
            //moreRange = ToolsQuality.FactorCapacity(Props.moreRangeBase, Props.moreRange, comp, false, false, false, true);
        }
Ejemplo n.º 2
0
 // Interface quality
 private void ChangeQuality(bool better = true)
 {
     ToolsQuality.ChangeQuality(building, compQuality, better);
     WeightFacilityCapacity(compQuality);
 }
Ejemplo n.º 3
0
        public override IEnumerable <Gizmo> CompGetGizmosExtra()
        {
            if (HasQuality)
            {
                Texture2D qualityMat  = ToolsGizmo.Quality2Mat(compQuality);
                float     qualitySize = ToolsGizmo.Quality2Size(compQuality);

                yield return(new Command_Action
                {
                    //icon = ContentFinder<Texture2D>.Get("UI/Commands/CancelRegistry", true),
                    icon = qualityMat,
                    iconDrawScale = qualitySize,
                    defaultLabel = "Quality matters",
                    defaultDesc = QualityLog(),
                    action = delegate
                    {
                        Tools.Warn("rip quality button", prcDebug);
                    }
                });
            }

            if (GotThePower)
            {
                {
                    Texture2D myMat   = MyGizmo.EmptyStatus2Gizmo(IsEmpty, IsFull);
                    String    myLabel = "Registry";
                    String    Grammar = ((MoreThanOne) ? ("s") : (""));
                    String    myDesc  = Tools.CapacityString(Registry.Count, FacilityCapacity) + ' ' + TpSpotName + ".";

                    if (IsEmpty || IsFull)
                    {
                        myDesc += ".Registry is " + ((IsEmpty) ? ("empty") : ("full"));
                        if (IsEmpty)
                        {
                            myDesc += "\nBuild a " + TpSpotName + " in its range.";
                        }
                        if (IsFull)
                        {
                            myDesc += "\nNo additional " + TpSpotName + " will be managed.";
                        }
                    }
                    myDesc += "\nLists " + Registry.Count + " teleporter" + Grammar;
                    yield return(new Command_Action
                    {
                        icon = myMat,
                        defaultLabel = myLabel,
                        defaultDesc = myDesc,
                        action = new Action(this.ShowReport),
                    });
                }

                if (HasSpot)
                {
                    Comp_LTF_TpSpot comp = CurrentSpot?.TryGetComp <Comp_LTF_TpSpot>();
                    if (comp != null)
                    {
                        if (comp.ValidWay)
                        {
                            String    WayName = comp.WayNaming;
                            Texture2D myGizmo = null;

                            //if (comp.StatusReady && comp.IsLinked && !comp.compTwin.StatusChillin)

                            /*
                             * if (comp.StatusReady && comp.IsLinked)
                             *  myGizmo = comp.WayGizmoing;
                             * else
                             *  myGizmo = comp.IssueGizmoing;
                             */
                            myGizmo = comp.WayGizmoing;

                            if (comp.IsLinked)
                            {
                                if (comp.compTwin.StatusChillin)
                                {
                                    myGizmo = comp.compTwin.IssueGizmoing;
                                }
                            }

                            String myLabel = "Cast " + WayName;
                            String myDesc  = comp.WayDescription;
                            //+ "\n" + comp.StatusLogNoUpdate;
                            //Action todo = ShowReport;
                            Action todo = delegate
                            {
                                Tools.Warn("rip action on no way", prcDebug);
                            };

                            if (comp.IsOrphan || comp.StatusChillin || comp.compTwin.StatusChillin)
                            {
                                if (comp.IsOrphan)
                                {
                                    myDesc = "Selected spot is orphan. You need to link it to another.";
                                }
                                else if (comp.StatusChillin)
                                {
                                    myDesc = "Selected spot has some cooldown.";
                                }
                                else if (comp.compTwin.StatusChillin)
                                {
                                    myDesc = "Selected spot twin has some cooldown.";
                                }
                            }
                            else if (comp.MyWay == Comp_LTF_TpSpot.Way.Out)
                            {
                                todo = comp.OrderOut;
                            }
                            else if (comp.MyWay == Comp_LTF_TpSpot.Way.In)
                            {
                                todo = comp.OrderIn;
                            }
                            //todo = comp.compTwin.OrderOut;
                            //todo = comp.OrderIn;
                            else if (comp.MyWay == Comp_LTF_TpSpot.Way.Swap)
                            {
                                todo = comp.OrderSwap;
                            }

                            /*
                             * else if (comp.MyWay == Comp_LTF_TpSpot.Way.No)
                             *  todo = ShowReport;
                             */

                            yield return(new Command_Action
                            {
                                icon = myGizmo,
                                defaultLabel = myLabel,
                                defaultDesc = myDesc,
                                action = new Action(todo),
                            });
                        }
                        else
                        {
                            Tools.Warn("gizmo should not be this way", prcDebug);
                        }
                    }
                    else
                    {
                        Tools.Warn("gizmo should not be this way", prcDebug);
                    }
                }

                Tools.Warn("Gizmo browse records", prcDebug);
                if (MoreThanOne)
                {
                    Texture2D myMat   = MyGizmo.NextTpGz;
                    String    myLabel = Tools.CapacityString(GizmoIndex + 1, Registry.Count) +
                                        Tools.PosStr(CurrentSpot.Position);
                    //String Grammar = ((MoreThanOne) ? ("s") : (""));
                    String myDesc = "Browse " + Registry.Count + " records";
                    yield return(new Command_Action
                    {
                        icon = myMat,
                        defaultLabel = myLabel,
                        defaultDesc = myDesc,
                        action = new Action(NextIndex),
                    });
                }
            }

            if (Prefs.DevMode)
            {
                // Debug process
                yield return(new Command_Action
                {
                    icon = ((prcDebug) ? (MyGizmo.DebugOnGz) : (MyGizmo.DebugOffGz)),
                    defaultLabel = "prc: " + Tools.DebugStatus(prcDebug),
                    defaultDesc = "process debug",
                    action = delegate
                    {
                        prcDebug = Tools.WarnBoolToggle(prcDebug, "debug " + building.Label);
                    }
                });

                // Debug gfx
                yield return(new Command_Action
                {
                    icon = ((gfxDebug) ? (MyGizmo.DebugOnGz) : (MyGizmo.DebugOffGz)),
                    defaultLabel = "gfx: " + Tools.DebugStatus(gfxDebug),
                    defaultDesc = "gfx debug",
                    action = delegate
                    {
                        gfxDebug = Tools.WarnBoolToggle(gfxDebug, "debug " + building.Label);
                    }
                });

                //debug log + hax activate
                if (prcDebug)
                {
                    yield return new Command_Action
                           {
                               //icon = ContentFinder<Texture2D>.Get("UI/Commands/HaxReady", true),
                               icon         = MyGizmo.DebugLogGz,
                               defaultLabel = "hax " + Tools.DebugStatus(Hax),
                               defaultDesc  = "$5,000 for you advert here.",
                               action       = delegate
                               {
                                   Hax = Tools.WarnBoolToggle(Hax, "hax " + building.Label);
                               }
                           }
                }
                ;
                // Hax Progress
                if (prcDebug && Hax)
                {
                }
                // Hax quality
                if (prcDebug && Hax && HasQuality)
                {
                    if (!ToolsQuality.BestQuality(compQuality))
                    {
                        yield return new Command_Action
                               {
                                   defaultLabel = compQuality.Quality.GetLabelShort() + "->" + ToolsQuality.BetterQuality(compQuality),
                                   defaultDesc  = "Better quality",
                                   //icon = ContentFinder<Texture2D>.Get("UI/Commands/HaxReady", true),
                                   icon   = MyGizmo.HaxBetterGz,
                                   action = delegate
                                   {
                                       BetterQuality();
                                   }
                               }
                    }
                    ;

                    if (!ToolsQuality.WorstQuality(compQuality))
                    {
                        yield return new Command_Action
                               {
                                   defaultDesc  = "Worse quality",
                                   defaultLabel = compQuality.Quality.GetLabelShort() + "->" + ToolsQuality.WorseQuality(compQuality),
                                   icon         = MyGizmo.HaxWorseGz,
                                   action       = delegate
                                   {
                                       WorseQuality();
                                   }
                               }
                    }
                    ;
                }
            }
        }
Ejemplo n.º 4
0
 private void WeightFacilityCapacity(CompQuality comp, bool debug = false)
 {
     Tools.Warn(">Settin Quality>" + Props.FacilityCapacityBase + ';' + Props.FacilityCapacitySpectrum + ">FacilityCapacity>" + FacilityCapacity, debug);
     FacilityCapacity = (int)ToolsQuality.WeightedCapacity(Props.FacilityCapacityBase, Props.FacilityCapacitySpectrum, comp);
 }