Example #1
0
        public static void CreateTerminalControls()
        {
            if (controls_created)
            {
                return;
            }
            controls_created = true;
            if (ComboListBox == null)
            {
                ComboListBox                        = MyAPIGateway.TerminalControls.CreateControl <IMyTerminalControlCombobox, IMyTextPanel>("Script List");
                ComboListBox.Enabled                = ControlEnabled;
                ComboListBox.Title                  = MyStringId.GetOrCompute("Channel List");
                ComboListBox.Visible                = ControlVisible;
                ComboListBox.ComboBoxContent        = (x) => GetContent(x);
                ComboListBox.SupportsMultipleBlocks = SupportsMultipleBlocks;
                ComboListBox.Setter                 = Setter;
                ComboListBox.Getter                 = (x) => Getter(x);
                MyAPIGateway.TerminalControls.AddControl <IMyTextPanel>(ComboListBox);

                var LineItem = new MyTerminalControlComboBoxItem();
                LineItem.Key   = 0;
                LineItem.Value = None;
                Obj.Add(LineItem);
                SteamIdGetter.Add(LineItem.Key, 0);
                LineGetter.Add(0, LineItem.Key);
            }
        }
Example #2
0
 private void TextPanel_ChannelChanged(IMyTerminalBlock obj)
 {
     if (obj == null)
     {
         return;
     }
     if (Selected == -1)
     {
         if (CurrentBuffer == 1)
         {
             Selected = 0;
         }
         else
         {
         }
     }
     if (Selected == 0)
     {
         //if(Script != null)
         //{
         //	Script.DeletePlayer();
         //}
         CurrentBuffer = 1;
         return;
     }
     if (Selected < Obj.Count)
     {
         //if(Script == null)
         //	Script = new VideoPlayerScript(this.Entity as IMyTextPanel);
         ulong channel;
         if (SteamIdGetter.TryGetValue(Selected, out channel))
         {
             MyAPIGateway.Utilities.ShowMessage("Player", $"Selected Channel {channel}");
             CurrentBuffer = channel;
         }
     }
 }