• R/O
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

密猟オンラインクライアントプログラム JAVAベース


Commit MetaInfo

Revision18 (tree)
Time2016-12-23 22:39:00
Authormanjihq

Log Message

メインビューソースを整形
コマンドプレフィックスキー入力の処理方法を改善
メッセージ入力領域へ移行するプレフィックスを追加

Change Summary

Incremental Difference

--- trunk/src/hunton/HuntMainView.java (revision 17)
+++ trunk/src/hunton/HuntMainView.java (revision 18)
@@ -203,19 +203,23 @@
203203 if (playEffect > 0) {
204204 Color c = null;
205205 switch (playEffect) {
206- case 1: /* for damage */
206+ case 1:
207+ /* for damage */
207208
208209 c = Color.pink;
209210 break;
210- case 2: /* for death */
211+ case 2:
212+ /* for death */
211213
212214 c = Color.red;
213215 break;
214- case 3: /* for digging */
216+ case 3:
217+ /* for digging */
215218
216219 c = Color.gray;
217220 break;
218- case 4: /* for fall in hole */
221+ case 4:
222+ /* for fall in hole */
219223
220224 c = Color.blue;
221225 break;
@@ -568,7 +572,8 @@
568572 case Hunt.HCLIT_PLAYER_S:
569573 img = ovImgHunter[np];
570574 switch (statbuffer[idx]) {
571- case 1: /* crime less than 1000 */
575+ case 1:
576+ /* crime less than 1000 */
572577
573578 if (viewbuffer[idx] != 0) {
574579 bgcolor = Color.gray;
@@ -576,15 +581,18 @@
576581 bgcolor = Color.darkGray;
577582 }
578583 break;
579- case 2: /* crime less than 5000 */
584+ case 2:
585+ /* crime less than 5000 */
580586
581587 bgcolor = Color.magenta;
582588 break;
583- case 3: /* murder ! */
589+ case 3:
590+ /* murder ! */
584591
585592 bgcolor = Color.red;
586593 break;
587- case 4: /* friendly */
594+ case 4:
595+ /* friendly */
588596
589597 bgcolor = Color.cyan;
590598 break;
@@ -648,23 +656,28 @@
648656 case Hunt.HCLIT_MAP_ANIMAL:
649657 img = ovImgObject[8];
650658 switch (statbuffer[idx]) {
651- case 1: /* stun */
659+ case 1:
660+ /* stun */
652661
653662 bgcolor = Color.darkGray;
654663 break;
655- case 2: /* panic */
664+ case 2:
665+ /* panic */
656666
657667 bgcolor = Color.yellow;
658668 break;
659- case 3: /* charm */
669+ case 3:
670+ /* charm */
660671
661672 bgcolor = Color.green;
662673 break;
663- case 4: /* angry */
674+ case 4:
675+ /* angry */
664676
665677 bgcolor = Color.red;
666678 break;
667- case 5: /* friendly */
679+ case 5:
680+ /* friendly */
668681
669682 bgcolor = Color.cyan;
670683 break;
@@ -722,13 +735,11 @@
722735 vtimer = new HuntMainViewTimer(this, nspan);
723736 vtimer.start();
724737 }
725- } else {
726- if (playEffect == 0) {
727- playEffect = n;
728- repaint();
729- vtimer = new HuntMainViewTimer(this, nspan);
730- vtimer.start();
731- }
738+ } else if (playEffect == 0) {
739+ playEffect = n;
740+ repaint();
741+ vtimer = new HuntMainViewTimer(this, nspan);
742+ vtimer.start();
732743 }
733744 }
734745
@@ -825,10 +836,6 @@
825836 case KeyEvent.VK_Z:
826837 Hunt.getSendTask().doFire(2);
827838 break;
828- case KeyEvent.VK_SLASH:
829- hview = (HuntMessageView) Hunt.getMessageView();
830- hview.setFocus("/");
831- break;
832839 case KeyEvent.VK_ENTER:
833840 hview = (HuntMessageView) Hunt.getMessageView();
834841 hview.setFocus();
@@ -835,6 +842,23 @@
835842 break;
836843 }
837844 }
845+
846+ @Override
847+ public void keyTyped(KeyEvent e) {
848+ HuntMessageView hview;
849+ hview = (HuntMessageView) Hunt.getMessageView();
850+ switch (e.getKeyChar()) {
851+ case '/':
852+ hview.setFocus("/");
853+ break;
854+ case '!':
855+ hview.setFocus("!");
856+ break;
857+ default:
858+ break;
859+ }
860+ super.keyTyped(e);
861+ }
838862 }
839863
840864 /* EOF */