diff --git a/MekHQ/resources/mekhq/resources/CustomizeScenarioDialog.properties b/MekHQ/resources/mekhq/resources/CustomizeScenarioDialog.properties index 2a3cdffc5f..f80ba4ee7d 100644 --- a/MekHQ/resources/mekhq/resources/CustomizeScenarioDialog.properties +++ b/MekHQ/resources/mekhq/resources/CustomizeScenarioDialog.properties @@ -1,3 +1,6 @@ +panTab.basic=Basic Information +panTab.rewards=Objectives and Rewards +panTab.otherforces=Other Forces btnCancel.text=Cancel btnOkay.text=Done lblName.text=Scenario Name: diff --git a/MekHQ/src/mekhq/gui/dialog/CustomizeScenarioDialog.java b/MekHQ/src/mekhq/gui/dialog/CustomizeScenarioDialog.java index 8ba9906957..17e2c8792d 100644 --- a/MekHQ/src/mekhq/gui/dialog/CustomizeScenarioDialog.java +++ b/MekHQ/src/mekhq/gui/dialog/CustomizeScenarioDialog.java @@ -206,7 +206,11 @@ private void initComponents() { setTitle(resourceMap.getString("title")); } - JPanel panMain = new JPanel(new GridBagLayout()); + JTabbedPane panTabs = new JTabbedPane(); + + JPanel panBasic = new JPanel(new GridBagLayout()); + JPanel panRewards = new JPanel(new GridLayout(2, 0)); + JPanel panInfo = new JPanel(new GridBagLayout()); JPanel panWrite = new JPanel(new GridBagLayout()); JPanel panBtn = new JPanel(new FlowLayout()); @@ -215,7 +219,7 @@ private void initComponents() { gbc.gridx = 0; gbc.gridy = 0; gbc.gridwidth = 1; - gbc.anchor = GridBagConstraints.WEST; + gbc.anchor = GridBagConstraints.NORTHWEST; gbc.insets = new Insets(5, 5, 5, 5); panInfo.add(new JLabel(resourceMap.getString("lblName.text")), gbc); @@ -314,6 +318,7 @@ public Component getListCellRendererComponent(final JList list, final Object initMapPanel(resourceMap); gbc.gridy++; + gbc.weighty = 1.0; panInfo.add(panMap, gbc); initObjectivesPanel(resourceMap); @@ -331,11 +336,8 @@ public Component getListCellRendererComponent(final JList list, final Object BorderFactory.createEmptyBorder(5,5,5,5))); initOtherForcesPanel(resourceMap); - panOtherForces.setBorder(BorderFactory.createCompoundBorder( - BorderFactory.createEmptyBorder(0, 0, 10, 0), - BorderFactory.createTitledBorder(resourceMap.getString("panOtherForces.title")))); - panOtherForces.setPreferredSize(new Dimension(600,250)); - panOtherForces.setMinimumSize(new Dimension(600,250)); + panOtherForces.setPreferredSize(new Dimension(600,300)); + panOtherForces.setMinimumSize(new Dimension(600,300)); txtDesc = new MarkdownEditorPanel(resourceMap.getString("txtDesc.title")); txtDesc.setText(scenario.getDescription()); @@ -396,43 +398,28 @@ public Component getListCellRendererComponent(final JList list, final Object btnClose.addActionListener(this::btnCloseActionPerformed); panBtn.add(btnClose); - getContentPane().add(panMain, BorderLayout.CENTER); - getContentPane().add(panBtn, BorderLayout.PAGE_END); - - JPanel panNW = new JPanel(new GridBagLayout()); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; - gbc.gridheight = 2; - gbc.anchor = GridBagConstraints.NORTHWEST; - gbc.fill = GridBagConstraints.HORIZONTAL; - gbc.weightx = 1.0; + gbc.weightx = 0.0; gbc.weighty = 1.0; - panNW.add(panInfo, gbc); - gbc.gridx = 1; - gbc.gridheight = 1; - gbc.fill = GridBagConstraints.BOTH; - panNW.add(panObjectives, gbc); - gbc.gridy = 1; - panNW.add(panLoot, gbc); - - gbc = new GridBagConstraints(); - gbc.gridx = 0; - gbc.gridy = 0; - gbc.weightx = 1.0; - gbc.weighty = 0.0; gbc.anchor = GridBagConstraints.NORTHWEST; gbc.fill = GridBagConstraints.BOTH; - panMain.add(panNW, gbc); + panBasic.add(panInfo, gbc); gbc.gridx = 1; gbc.gridy = 0; - gbc.gridheight = 2; - gbc.weighty = 1.0; - panMain.add(panWrite, gbc); - gbc.gridx = 0; - gbc.gridy = 1; - gbc.gridheight = 1; - panMain.add(panOtherForces, gbc); + gbc.weightx = 1.0; + panBasic.add(panWrite, gbc); + + panRewards.add(panObjectives); + panRewards.add(panLoot); + + panTabs.add(resourceMap.getString("panTab.basic"), panBasic); + panTabs.add(resourceMap.getString("panTab.rewards"), panRewards); + panTabs.add(resourceMap.getString("panTab.otherforces"), panOtherForces); + + getContentPane().add(panTabs, BorderLayout.CENTER); + getContentPane().add(panBtn, BorderLayout.PAGE_END); pack(); } diff --git a/MekHQ/src/mekhq/gui/dialog/CustomizeScenarioObjectiveDialog.java b/MekHQ/src/mekhq/gui/dialog/CustomizeScenarioObjectiveDialog.java index 9b4fc6acdc..e0790860ec 100644 --- a/MekHQ/src/mekhq/gui/dialog/CustomizeScenarioObjectiveDialog.java +++ b/MekHQ/src/mekhq/gui/dialog/CustomizeScenarioObjectiveDialog.java @@ -399,7 +399,7 @@ private void initObjectiveEffectPanel(ResourceBundle resourceMap) { panObjectiveEffect.add(btnAdd, gbcLeft); JLabel lblSuccessEffects = new JLabel(resourceMap.getString("lblSuccessEffects.text")); - JLabel lblFailureEffects = new JLabel(resourceMap.getString("lblSuccessEffects.text")); + JLabel lblFailureEffects = new JLabel(resourceMap.getString("lblFailureEffects.text")); successEffects = new JList<>(successEffectsModel); successEffects.addListSelectionListener(e -> btnRemoveSuccess.setEnabled(!successEffects.getSelectedValuesList().isEmpty()));