無人機動兵器ダンジョン探索ゲーム JAVAベース
ソフトウェアサイズを16×16に拡大
それにともないソフトウェア編集画面をスクロール表示対応
ソフトウェア編集画面の位置だけでなく大きさも保存するように変更
@@ -43,6 +43,7 @@ | ||
43 | 43 | public static Point defaultpos; |
44 | 44 | public static Point chiptablepos; |
45 | 45 | public static Point softtablepos; |
46 | + public static Dimension softtablesz; | |
46 | 47 | public static Point hardwarepos; |
47 | 48 | public static Point stockpos; |
48 | 49 | private static Frame frame; |
@@ -77,8 +78,9 @@ | ||
77 | 78 | update_timer = 10; |
78 | 79 | dungeonpos = new Point(); |
79 | 80 | defaultpos = new Point(); |
80 | - chiptablepos = new Point(OkeSoftData.CHIPMAXX * 40 + 8 + 16, 0); | |
81 | + chiptablepos = new Point(328 + 16, 0); | |
81 | 82 | softtablepos = new Point(); |
83 | + softtablesz = new Dimension(); | |
82 | 84 | hardwarepos = new Point(); |
83 | 85 | stockpos = new Point(320, 0); |
84 | 86 | } |
@@ -449,32 +451,33 @@ | ||
449 | 451 | return bauto; |
450 | 452 | } |
451 | 453 | |
454 | + private void edit_software(int nsoft, String title, OkeSoftData sd) { | |
455 | + //build up software | |
456 | + Dialog dialog = new Dialog(frame, title, false); | |
457 | + OkeSoftPanel softpanel | |
458 | + = new OkeSoftPanel(this, frame, dialog, sd); | |
459 | + ScrollPane scrpane = new ScrollPane(ScrollPane.SCROLLBARS_ALWAYS); | |
460 | + current_edit_soft = nsoft; | |
461 | + scrpane.add(softpanel); | |
462 | + scrpane.setSize(328, 328); | |
463 | + dialog.add(scrpane); | |
464 | + dialog.pack(); | |
465 | + dialog.setLocation(softtablepos); | |
466 | + if (softtablesz.width != 0 && softtablesz.height != 0) { | |
467 | + dialog.setSize(softtablesz); | |
468 | + } | |
469 | + frame.setEnabled(false); | |
470 | + dialog.setVisible(true); | |
471 | + } | |
472 | + | |
452 | 473 | public void actionPerformed(ActionEvent e) { |
453 | 474 | String cmd = e.getActionCommand(); |
454 | 475 | if (cmd.equals("SOFTWARE") == true) { |
455 | 476 | //build up software |
456 | - Dialog dialog = new Dialog(frame, resource.getString( | |
457 | - "buttonSOFTWARE_A"), false); | |
458 | - OkeSoftPanel softpanel | |
459 | - = new OkeSoftPanel(this, frame, dialog, software); | |
460 | - current_edit_soft = 1; | |
461 | - dialog.add(softpanel); | |
462 | - dialog.pack(); | |
463 | - dialog.setLocation(softtablepos); | |
464 | - frame.setEnabled(false); | |
465 | - dialog.setVisible(true); | |
477 | + edit_software(1, resource.getString("buttonSOFTWARE_A"), software); | |
466 | 478 | } else if (cmd.equals("SOFTWARE2") == true) { |
467 | 479 | //build up software 2 |
468 | - Dialog dialog = new Dialog(frame, resource.getString( | |
469 | - "buttonSOFTWARE_B"), false); | |
470 | - OkeSoftPanel softpanel | |
471 | - = new OkeSoftPanel(this, frame, dialog, software2); | |
472 | - current_edit_soft = 2; | |
473 | - dialog.add(softpanel); | |
474 | - dialog.pack(); | |
475 | - dialog.setLocation(softtablepos); | |
476 | - frame.setEnabled(false); | |
477 | - dialog.setVisible(true); | |
480 | + edit_software(2, resource.getString("buttonSOFTWARE_B"), software2); | |
478 | 481 | } else if (cmd.equals("HARDWARE") == true) { |
479 | 482 | //build up hardware |
480 | 483 | Dialog dialog = new Dialog(frame, resource.getString( |
@@ -562,6 +565,7 @@ | ||
562 | 565 | dialog.setVisible(true); |
563 | 566 | dialog.getLocation(stockpos); |
564 | 567 | } else if (cmd.equals("EXIT") == true) { |
568 | + save_setup(); | |
565 | 569 | frame.dispose(); |
566 | 570 | } |
567 | 571 | } |
@@ -920,6 +924,10 @@ | ||
920 | 924 | int x = Integer.parseInt(field[1]); |
921 | 925 | int y = Integer.parseInt(field[2]); |
922 | 926 | softtablepos.setLocation(x, y); |
927 | + } else if (field[0].endsWith("SOFTTABLESIZE") == true) { | |
928 | + int hx = Integer.parseInt(field[1]); | |
929 | + int hy = Integer.parseInt(field[2]); | |
930 | + softtablesz.setSize(hx, hy); | |
923 | 931 | } else if (field[0].endsWith("CHIPTABLE") == true) { |
924 | 932 | int x = Integer.parseInt(field[1]); |
925 | 933 | int y = Integer.parseInt(field[2]); |
@@ -972,6 +980,10 @@ | ||
972 | 980 | wkline = "SOFTTABLE," + softtablepos.x + "," + softtablepos.y; |
973 | 981 | w.write(wkline, 0, wkline.length()); |
974 | 982 | w.newLine(); |
983 | + wkline = "SOFTTABLESIZE," + softtablesz.width + "," | |
984 | + + softtablesz.height; | |
985 | + w.write(wkline, 0, wkline.length()); | |
986 | + w.newLine(); | |
975 | 987 | wkline = "CHIPTABLE," + chiptablepos.x + "," + chiptablepos.y; |
976 | 988 | w.write(wkline, 0, wkline.length()); |
977 | 989 | w.newLine(); |
@@ -9,8 +9,8 @@ | ||
9 | 9 | */ |
10 | 10 | public class OkeSoftData { |
11 | 11 | |
12 | - static final int CHIPMAXX = 7; | |
13 | - static final int CHIPMAXY = 7; | |
12 | + static final int CHIPMAXX = 16; | |
13 | + static final int CHIPMAXY = 16; | |
14 | 14 | protected OkeSoftChip chips[][]; |
15 | 15 | String filename; |
16 | 16 |
@@ -629,6 +629,7 @@ | ||
629 | 629 | @Override |
630 | 630 | public void windowClosing(WindowEvent e) { |
631 | 631 | parent.getLocation(CarnageHack.softtablepos); |
632 | + parent.getSize(CarnageHack.softtablesz); | |
632 | 633 | chiptable.getLocation(CarnageHack.chiptablepos); |
633 | 634 | chiptable.dispose(); |
634 | 635 | mainframe.setEnabled(true); |
@@ -640,6 +641,7 @@ | ||
640 | 641 | String cmd = e.getActionCommand(); |
641 | 642 | if (cmd.equals("OK") == true) { |
642 | 643 | parent.getLocation(CarnageHack.softtablepos); |
644 | + parent.getSize(CarnageHack.softtablesz); | |
643 | 645 | chiptable.getLocation(CarnageHack.chiptablepos); |
644 | 646 | chiptable.dispose(); |
645 | 647 | mainframe.setEnabled(true); |