無人機動兵器ダンジョン探索ゲーム JAVAベース
ハードウェア設計画面の調整
ステータス表示のソフトチップ部分で例外が発生するのを修正
| @@ -84,8 +84,8 @@ | ||
| 84 | 84 | for (y = 0; y < OkeSoftData.CHIPMAXY; y++) { |
| 85 | 85 | for (x = 0; x < OkeSoftData.CHIPMAXX; x++) { |
| 86 | 86 | OkeSoftChip chip = software.get(x, y); |
| 87 | - if (chip.nullchip() == false) { | |
| 88 | - offg.setColor(software.get(x, y).is_condchip() | |
| 87 | + if (chip != null && chip.nullchip() == false) { | |
| 88 | + offg.setColor(chip.is_condchip() | |
| 89 | 89 | ? condCodeColor : normalCodeColor); |
| 90 | 90 | offg.fillRect(x * viewChipWidth + 2 + 1, |
| 91 | 91 | y * viewChipHeight + 2 + 1, |
| @@ -63,12 +63,14 @@ | ||
| 63 | 63 | setLayout(layout); |
| 64 | 64 | |
| 65 | 65 | gbc.fill = GridBagConstraints.BOTH; |
| 66 | + gbc.ipadx = 4; | |
| 67 | + gbc.gridwidth = 1; | |
| 66 | 68 | gbc.weightx = 1.0; |
| 67 | 69 | label = new Label( |
| 68 | 70 | CarnageHack.resource.getString("hardwareMAIN_WEAPON")); |
| 69 | 71 | layout.setConstraints(label, gbc); |
| 70 | 72 | add(label); |
| 71 | - gbc.weightx = 1.0; | |
| 73 | + gbc.anchor = GridBagConstraints.WEST; | |
| 72 | 74 | choice = new Choice(); |
| 73 | 75 | choice.addItemListener(new OkeHardPanelChoiceEvent(this, |
| 74 | 76 | "MAINWEAPON")); |
| @@ -77,16 +79,18 @@ | ||
| 77 | 79 | set_combo(choice, main_weapon_list); |
| 78 | 80 | main_bullette_max = hardware.get_main_bullette(); |
| 79 | 81 | gbc.gridwidth = GridBagConstraints.REMAINDER; |
| 80 | - gbc.weightx = 1.0; | |
| 82 | + gbc.anchor = GridBagConstraints.CENTER; | |
| 83 | + gbc.weightx = 0; | |
| 81 | 84 | main_weapon_status = new Label(); |
| 82 | 85 | layout.setConstraints(main_weapon_status, gbc); |
| 83 | 86 | add(main_weapon_status); |
| 84 | 87 | gbc.gridwidth = 1; |
| 88 | + gbc.weightx = 1.0; | |
| 85 | 89 | label = new Label(CarnageHack.resource.getString("hardwareBULLETTE")); |
| 86 | 90 | layout.setConstraints(label, gbc); |
| 87 | 91 | add(label); |
| 88 | 92 | gbc.gridwidth = GridBagConstraints.REMAINDER; |
| 89 | - gbc.weightx = 1.0; | |
| 93 | + gbc.weightx = 0; | |
| 90 | 94 | gbc.fill = GridBagConstraints.NONE; |
| 91 | 95 | gbc.anchor = GridBagConstraints.WEST; |
| 92 | 96 | text = new TextField(Integer.toString(main_bullette_max), 5); |
| @@ -103,11 +107,10 @@ | ||
| 103 | 107 | gbc.weightx = 1.0; |
| 104 | 108 | gbc.fill = GridBagConstraints.BOTH; |
| 105 | 109 | gbc.anchor = GridBagConstraints.CENTER; |
| 106 | - label | |
| 107 | - = new Label(CarnageHack.resource.getString("hardwareSUB_WEAPON")); | |
| 110 | + label = new Label(CarnageHack.resource.getString("hardwareSUB_WEAPON")); | |
| 108 | 111 | layout.setConstraints(label, gbc); |
| 109 | 112 | add(label); |
| 110 | - gbc.weightx = 1.0; | |
| 113 | + gbc.anchor = GridBagConstraints.WEST; | |
| 111 | 114 | choice = new Choice(); |
| 112 | 115 | choice.addItemListener(new OkeHardPanelChoiceEvent(this, |
| 113 | 116 | "SUBWEAPON")); |
| @@ -116,16 +119,18 @@ | ||
| 116 | 119 | set_combo(choice, sub_weapon_list); |
| 117 | 120 | sub_bullette_max = hardware.get_sub_bullette(); |
| 118 | 121 | gbc.gridwidth = GridBagConstraints.REMAINDER; |
| 119 | - gbc.weightx = 1.0; | |
| 122 | + gbc.anchor = GridBagConstraints.CENTER; | |
| 123 | + gbc.weightx = 0; | |
| 120 | 124 | sub_weapon_status = new Label(); |
| 121 | 125 | layout.setConstraints(sub_weapon_status, gbc); |
| 122 | 126 | add(sub_weapon_status); |
| 123 | 127 | gbc.gridwidth = 1; |
| 128 | + gbc.weightx = 1.0; | |
| 124 | 129 | label = new Label(CarnageHack.resource.getString("hardwareBULLETTE")); |
| 125 | 130 | layout.setConstraints(label, gbc); |
| 126 | 131 | add(label); |
| 127 | 132 | gbc.gridwidth = GridBagConstraints.REMAINDER; |
| 128 | - gbc.weightx = 1.0; | |
| 133 | + gbc.weightx = 0; | |
| 129 | 134 | gbc.fill = GridBagConstraints.NONE; |
| 130 | 135 | gbc.anchor = GridBagConstraints.WEST; |
| 131 | 136 | text = new TextField(Integer.toString(sub_bullette_max), 5); |
| @@ -145,7 +150,7 @@ | ||
| 145 | 150 | label = new Label(CarnageHack.resource.getString("hardwareCPU")); |
| 146 | 151 | layout.setConstraints(label, gbc); |
| 147 | 152 | add(label); |
| 148 | - gbc.weightx = 1.0; | |
| 153 | + gbc.anchor = GridBagConstraints.WEST; | |
| 149 | 154 | choice = new Choice(); |
| 150 | 155 | choice.addItemListener(new OkeHardPanelChoiceEvent(this, "CPU")); |
| 151 | 156 | layout.setConstraints(choice, gbc); |
| @@ -152,7 +157,8 @@ | ||
| 152 | 157 | add(choice); |
| 153 | 158 | set_combo(choice, cpu_list); |
| 154 | 159 | gbc.gridwidth = GridBagConstraints.REMAINDER; |
| 155 | - gbc.weightx = 1.0; | |
| 160 | + gbc.weightx = 0; | |
| 161 | + gbc.anchor = GridBagConstraints.CENTER; | |
| 156 | 162 | cpu_status = new Label(); |
| 157 | 163 | layout.setConstraints(cpu_status, gbc); |
| 158 | 164 | add(cpu_status); |
| @@ -165,7 +171,7 @@ | ||
| 165 | 171 | label = new Label(CarnageHack.resource.getString("hardwareENGINE")); |
| 166 | 172 | layout.setConstraints(label, gbc); |
| 167 | 173 | add(label); |
| 168 | - gbc.weightx = 1.0; | |
| 174 | + gbc.anchor = GridBagConstraints.WEST; | |
| 169 | 175 | choice = new Choice(); |
| 170 | 176 | choice.addItemListener(new OkeHardPanelChoiceEvent(this, "ENGINE")); |
| 171 | 177 | layout.setConstraints(choice, gbc); |
| @@ -172,7 +178,8 @@ | ||
| 172 | 178 | add(choice); |
| 173 | 179 | set_combo(choice, engine_list); |
| 174 | 180 | gbc.gridwidth = GridBagConstraints.REMAINDER; |
| 175 | - gbc.weightx = 1.0; | |
| 181 | + gbc.weightx = 0; | |
| 182 | + gbc.anchor = GridBagConstraints.CENTER; | |
| 176 | 183 | engine_status = new Label(); |
| 177 | 184 | layout.setConstraints(engine_status, gbc); |
| 178 | 185 | add(engine_status); |
| @@ -185,7 +192,7 @@ | ||
| 185 | 192 | label = new Label(CarnageHack.resource.getString("hardwareARMOR")); |
| 186 | 193 | layout.setConstraints(label, gbc); |
| 187 | 194 | add(label); |
| 188 | - gbc.weightx = 1.0; | |
| 195 | + gbc.anchor = GridBagConstraints.WEST; | |
| 189 | 196 | choice = new Choice(); |
| 190 | 197 | choice.addItemListener(new OkeHardPanelChoiceEvent(this, "ARMOR")); |
| 191 | 198 | layout.setConstraints(choice, gbc); |
| @@ -192,7 +199,8 @@ | ||
| 192 | 199 | add(choice); |
| 193 | 200 | set_combo(choice, armor_list); |
| 194 | 201 | gbc.gridwidth = GridBagConstraints.REMAINDER; |
| 195 | - gbc.weightx = 1.0; | |
| 202 | + gbc.weightx = 0; | |
| 203 | + gbc.anchor = GridBagConstraints.CENTER; | |
| 196 | 204 | armor_status = new Label(); |
| 197 | 205 | layout.setConstraints(armor_status, gbc); |
| 198 | 206 | add(armor_status); |
| @@ -205,7 +213,7 @@ | ||
| 205 | 213 | label = new Label(CarnageHack.resource.getString("hardwareFUELTANK")); |
| 206 | 214 | layout.setConstraints(label, gbc); |
| 207 | 215 | add(label); |
| 208 | - gbc.weightx = 1.0; | |
| 216 | + gbc.anchor = GridBagConstraints.WEST; | |
| 209 | 217 | choice = new Choice(); |
| 210 | 218 | choice.addItemListener(new OkeHardPanelChoiceEvent(this, "FUELTANK")); |
| 211 | 219 | layout.setConstraints(choice, gbc); |
| @@ -212,7 +220,8 @@ | ||
| 212 | 220 | add(choice); |
| 213 | 221 | set_combo(choice, fueltank_list); |
| 214 | 222 | gbc.gridwidth = GridBagConstraints.REMAINDER; |
| 215 | - gbc.weightx = 1.0; | |
| 223 | + gbc.weightx = 0; | |
| 224 | + gbc.anchor = GridBagConstraints.CENTER; | |
| 216 | 225 | fueltank_status = new Label(); |
| 217 | 226 | layout.setConstraints(fueltank_status, gbc); |
| 218 | 227 | add(fueltank_status); |
| @@ -225,7 +234,7 @@ | ||
| 225 | 234 | label = new Label(CarnageHack.resource.getString("hardwareOPTION")); |
| 226 | 235 | layout.setConstraints(label, gbc); |
| 227 | 236 | add(label); |
| 228 | - gbc.weightx = 1.0; | |
| 237 | + gbc.anchor = GridBagConstraints.WEST; | |
| 229 | 238 | choice = new Choice(); |
| 230 | 239 | choice.addItemListener(new OkeHardPanelChoiceEvent(this, "OPTION")); |
| 231 | 240 | layout.setConstraints(choice, gbc); |
| @@ -232,7 +241,8 @@ | ||
| 232 | 241 | add(choice); |
| 233 | 242 | set_combo(choice, option_list); |
| 234 | 243 | gbc.gridwidth = GridBagConstraints.REMAINDER; |
| 235 | - gbc.weightx = 1.0; | |
| 244 | + gbc.weightx = 0; | |
| 245 | + gbc.anchor = GridBagConstraints.CENTER; | |
| 236 | 246 | option_status = new Label(); |
| 237 | 247 | layout.setConstraints(option_status, gbc); |
| 238 | 248 | add(option_status); |
| @@ -271,8 +281,6 @@ | ||
| 271 | 281 | layout.setConstraints(dummy, gbc); |
| 272 | 282 | add(dummy); |
| 273 | 283 | |
| 274 | - gbc.gridwidth = GridBagConstraints.REMAINDER; | |
| 275 | - gbc.weightx = 0.0; | |
| 276 | 284 | dummy = new Panel(); //ダミー |
| 277 | 285 | layout.setConstraints(dummy, gbc); |
| 278 | 286 | add(dummy); |
| @@ -417,9 +425,6 @@ | ||
| 417 | 425 | wk += "(" |
| 418 | 426 | + CarnageHack.resource.getString("hardwareMOBILTY") |
| 419 | 427 | + nspeed + ")"; |
| 420 | - for (i = wk.length(); i <= 80; i++) { | |
| 421 | - wk += " "; | |
| 422 | - } | |
| 423 | 428 | total_weight.setText(wk); |
| 424 | 429 | } |
| 425 | 430 | } |
| @@ -610,6 +615,9 @@ | ||
| 610 | 615 | } |
| 611 | 616 | } |
| 612 | 617 | update_total_weight(); |
| 618 | + if (getParent() != null) { | |
| 619 | + getParent().validate(); | |
| 620 | + } | |
| 613 | 621 | } |
| 614 | 622 | |
| 615 | 623 | public void action(TextField text, String cmd) { |