Esempio n. 1
0
        private void OnWorldSizeValueChanged(Entity entity)
        {
            RadioButton selectedOption = (RadioButton)entity;

            string value = selectedOption.TextParagraph.Text.ToLower();

            switch (value)
            {
            case "small":
                newWorldSize = WorldSize.TINY;
                break;

            case "medium":
                newWorldSize = WorldSize.MEDIUM;
                break;

            case "large":
                newWorldSize = WorldSize.LARGE;
                break;

            default:
                newWorldSize = WorldSize.SMALL;
                break;
            }
        }
Esempio n. 2
0
        private void OnMultiplayerClicked(Entity entity)
        {
            mainPanel.Visible        = false;
            multiplayerPanel.Visible = true;

            Config.Multiplayer = true;
        }
 public void StartHost(GBEntity btn)
 {
     if (OnHost != null)
     {
         OnHost();
     }
 }
Esempio n. 4
0
        private void OnNewWorldCreateClicked(Entity entity)
        {
            generationSettings.name = newWorldName;
            generationSettings.seed = 0;
            generationSettings.size = newWorldSize;

            application.SwitchScene(new GenerationScreen(application, generationSettings));
        }
Esempio n. 5
0
        private void OnHostClicked(Entity entity)
        {
            multiplayerPanel.Visible = false;
            worldSelectPanel.Visible = true;

            networkSettings.isHost = true;

            RefreshWorldSelectList();
        }
Esempio n. 6
0
        private void OnSingleplayerClicked(Entity entity)
        {
            mainPanel.Visible        = false;
            worldSelectPanel.Visible = true;

            Config.Multiplayer = false;

            RefreshWorldSelectList();
        }
Esempio n. 7
0
        private void OnWorldSelected(Entity entity)
        {
            Button selectedWorld = (Button)entity;

            if (selectedWorld == null)
            {
                return;
            }
            NextScene(selectedWorld.ButtonParagraph.Text);
        }
 public void ConnectToHost(GBEntity btn)
 {
     if (OnConnect != null)
     {
         string ipAdress = input.Value;
         if (ipAdress == string.Empty)
         {
             ipAdress = "127.0.0.1";
         }
         OnConnect(ipAdress);
     }
 }
 public void OpenInventory(GBEntity entity)
 {
     if (inventoryButton.Checked)
     {
         if (OnInventory != null)
         {
             OnInventory(inventoryPanel);
         }
         inventoryPanel.Visible = true;
     }
     else
     {
         inventoryPanel.Visible = false;
     }
 }
Esempio n. 10
0
 private void OnConnectClicked(Entity entity)
 {
     NextScene("");
 }
Esempio n. 11
0
        private void OnIpToJoinChanged(Entity entity)
        {
            TextInput text = (TextInput)entity;

            networkSettings.address = text?.Value;
        }
Esempio n. 12
0
 private void OnJoinClicked(Entity entity)
 {
     joinGamePanel.Visible    = true;
     multiplayerPanel.Visible = false;
 }
Esempio n. 13
0
 private void OnNewWorldBackClicked(Entity entity)
 {
     mainPanel.Visible        = false;
     worldSelectPanel.Visible = true;
     newWorldPanel.Visible    = false;
 }
Esempio n. 14
0
        private void OnWorldNameValueChanged(Entity entity)
        {
            TextInput text = (TextInput)entity;

            newWorldName = text?.Value;
        }
Esempio n. 15
0
 private void OnMultiplayerBackClicked(Entity entity)
 {
     mainPanel.Visible        = true;
     multiplayerPanel.Visible = false;
 }
Esempio n. 16
0
 private void OnQuitClicked(Entity entity)
 {
     application.Quit();
 }