Example #1
0
 private void ShowNodes(Godot.Collections.Array Nodes)
 {
     foreach (Node ToShow in Nodes)
     {
         if (ToShow is CanvasItem)
         {
             ((CanvasItem)ToShow).Show();
         }
         ShowNodes(ToShow.GetChildren());
     }
 }
 public override void Show()
 {
     ToShow?.Invoke();
 }
Example #3
0
 // Used by map reroll
 public static void OpenOnMapSettings()
 {
     toShow = ToShow.None;
 }
Example #4
0
        public void DoWindowContents(Rect rect)
        {
            if (WorldSettings == null)
            {
                WorldSettings = new WorldSettings();
            }
            if (MapSettings == null)
            {
                MapSettings = new MapSettings();
            }
            if (CurrentSettings == null)
            {
                CurrentSettings = new CurrentSettings();
            }

            string label;

            if (toShow == ToShow.None)
            {
                label = "WorldChooseButton".Translate();
            }
            else if (toShow == ToShow.World)
            {
                label = WorldSettings.Name;
            }
            else
            {
                label = MapSettings.Name;
            }

            if (Widgets.ButtonText(new Rect(rect.x, rect.y, 300, 28), label))
            {
                List <FloatMenuOption> l = new List <FloatMenuOption>(3)
                {
                    new FloatMenuOption(WorldSettings.Name, () => { toShow = ToShow.World; }),
                    new FloatMenuOption(MapSettings.Name, () => { toShow = ToShow.Map; })
                };
                if (Current.Game != null)
                {
                    l.Add(new FloatMenuOption(CurrentSettings.Name, () => { toShow = ToShow.CurrentGame; }));
                }
                Find.WindowStack.Add(new FloatMenu(l));
            }
            rect.y += 30f;
            if (toShow == ToShow.World)
            {
                if (wsFieldValues == null)
                {
                    wsFieldValues = WorldSettings.GetFieldValues();
                }
                WorldSettings.DoWindowContents(rect, wsFieldValues);
            }
            else if (toShow == ToShow.Map)
            {
                if (msFieldValues == null)
                {
                    msFieldValues = MapSettings.GetFieldValues();
                }
                MapSettings.DoWindowContents(rect, msFieldValues);
            }
            else if (toShow == ToShow.CurrentGame)
            {
                if (cgFieldValues == null)
                {
                    cgFieldValues = CurrentSettings.GetFieldValues();
                }
                CurrentSettings.DoWindowContents(rect, cgFieldValues);
            }
        }
Example #5
0
 private void Form1_Load(object sender, EventArgs e)
 {
     this.voDelShowTime = new ToShow(this.mUpdateTime);
     this.voDelShowStkP = new ToShow(this.mUpdateStockPrice);
 }