• R/O
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythongamewindowsbathyscaphephpguic翻訳omegattwitterframeworktestbtronarduinovb.net計画中(planning stage)directxpreviewerゲームエンジンdom

無人機動兵器ダンジョン探索ゲーム JAVAベース


Commit MetaInfo

Revisão47 (tree)
Hora2015-07-28 18:03:57
Autormanjihq

Mensagem de Log

ソフトウェアサイズを16×16に拡大
それにともないソフトウェア編集画面をスクロール表示対応
ソフトウェア編集画面の位置だけでなく大きさも保存するように変更

Mudança Sumário

Diff

--- CarnageHack2/trunk/src/CarnageHack/CarnageHack.java (revision 46)
+++ CarnageHack2/trunk/src/CarnageHack/CarnageHack.java (revision 47)
@@ -43,6 +43,7 @@
4343 public static Point defaultpos;
4444 public static Point chiptablepos;
4545 public static Point softtablepos;
46+ public static Dimension softtablesz;
4647 public static Point hardwarepos;
4748 public static Point stockpos;
4849 private static Frame frame;
@@ -77,8 +78,9 @@
7778 update_timer = 10;
7879 dungeonpos = new Point();
7980 defaultpos = new Point();
80- chiptablepos = new Point(OkeSoftData.CHIPMAXX * 40 + 8 + 16, 0);
81+ chiptablepos = new Point(328 + 16, 0);
8182 softtablepos = new Point();
83+ softtablesz = new Dimension();
8284 hardwarepos = new Point();
8385 stockpos = new Point(320, 0);
8486 }
@@ -449,32 +451,33 @@
449451 return bauto;
450452 }
451453
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+
452473 public void actionPerformed(ActionEvent e) {
453474 String cmd = e.getActionCommand();
454475 if (cmd.equals("SOFTWARE") == true) {
455476 //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);
466478 } else if (cmd.equals("SOFTWARE2") == true) {
467479 //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);
478481 } else if (cmd.equals("HARDWARE") == true) {
479482 //build up hardware
480483 Dialog dialog = new Dialog(frame, resource.getString(
@@ -562,6 +565,7 @@
562565 dialog.setVisible(true);
563566 dialog.getLocation(stockpos);
564567 } else if (cmd.equals("EXIT") == true) {
568+ save_setup();
565569 frame.dispose();
566570 }
567571 }
@@ -920,6 +924,10 @@
920924 int x = Integer.parseInt(field[1]);
921925 int y = Integer.parseInt(field[2]);
922926 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);
923931 } else if (field[0].endsWith("CHIPTABLE") == true) {
924932 int x = Integer.parseInt(field[1]);
925933 int y = Integer.parseInt(field[2]);
@@ -972,6 +980,10 @@
972980 wkline = "SOFTTABLE," + softtablepos.x + "," + softtablepos.y;
973981 w.write(wkline, 0, wkline.length());
974982 w.newLine();
983+ wkline = "SOFTTABLESIZE," + softtablesz.width + ","
984+ + softtablesz.height;
985+ w.write(wkline, 0, wkline.length());
986+ w.newLine();
975987 wkline = "CHIPTABLE," + chiptablepos.x + "," + chiptablepos.y;
976988 w.write(wkline, 0, wkline.length());
977989 w.newLine();
--- CarnageHack2/trunk/src/CarnageHack/OkeSoftData.java (revision 46)
+++ CarnageHack2/trunk/src/CarnageHack/OkeSoftData.java (revision 47)
@@ -9,8 +9,8 @@
99 */
1010 public class OkeSoftData {
1111
12- static final int CHIPMAXX = 7;
13- static final int CHIPMAXY = 7;
12+ static final int CHIPMAXX = 16;
13+ static final int CHIPMAXY = 16;
1414 protected OkeSoftChip chips[][];
1515 String filename;
1616
--- CarnageHack2/trunk/src/CarnageHack/OkeSoftPanel.java (revision 46)
+++ CarnageHack2/trunk/src/CarnageHack/OkeSoftPanel.java (revision 47)
@@ -629,6 +629,7 @@
629629 @Override
630630 public void windowClosing(WindowEvent e) {
631631 parent.getLocation(CarnageHack.softtablepos);
632+ parent.getSize(CarnageHack.softtablesz);
632633 chiptable.getLocation(CarnageHack.chiptablepos);
633634 chiptable.dispose();
634635 mainframe.setEnabled(true);
@@ -640,6 +641,7 @@
640641 String cmd = e.getActionCommand();
641642 if (cmd.equals("OK") == true) {
642643 parent.getLocation(CarnageHack.softtablepos);
644+ parent.getSize(CarnageHack.softtablesz);
643645 chiptable.getLocation(CarnageHack.chiptablepos);
644646 chiptable.dispose();
645647 mainframe.setEnabled(true);