Beispiel #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;
            }
        }
Beispiel #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();
     }
 }
Beispiel #4
0
        private void OnNewWorldCreateClicked(Entity entity)
        {
            generationSettings.name = newWorldName;
            generationSettings.seed = 0;
            generationSettings.size = newWorldSize;

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

            networkSettings.isHost = true;

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

            Config.Multiplayer = false;

            RefreshWorldSelectList();
        }
Beispiel #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;
     }
 }
Beispiel #10
0
 private void OnConnectClicked(Entity entity)
 {
     NextScene("");
 }
Beispiel #11
0
        private void OnIpToJoinChanged(Entity entity)
        {
            TextInput text = (TextInput)entity;

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

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