密猟オンラインクライアントプログラム JAVAベース
メインビューソースを整形
コマンドプレフィックスキー入力の処理方法を改善
メッセージ入力領域へ移行するプレフィックスを追加
@@ -203,19 +203,23 @@ | ||
203 | 203 | if (playEffect > 0) { |
204 | 204 | Color c = null; |
205 | 205 | switch (playEffect) { |
206 | - case 1: /* for damage */ | |
206 | + case 1: | |
207 | + /* for damage */ | |
207 | 208 | |
208 | 209 | c = Color.pink; |
209 | 210 | break; |
210 | - case 2: /* for death */ | |
211 | + case 2: | |
212 | + /* for death */ | |
211 | 213 | |
212 | 214 | c = Color.red; |
213 | 215 | break; |
214 | - case 3: /* for digging */ | |
216 | + case 3: | |
217 | + /* for digging */ | |
215 | 218 | |
216 | 219 | c = Color.gray; |
217 | 220 | break; |
218 | - case 4: /* for fall in hole */ | |
221 | + case 4: | |
222 | + /* for fall in hole */ | |
219 | 223 | |
220 | 224 | c = Color.blue; |
221 | 225 | break; |
@@ -568,7 +572,8 @@ | ||
568 | 572 | case Hunt.HCLIT_PLAYER_S: |
569 | 573 | img = ovImgHunter[np]; |
570 | 574 | switch (statbuffer[idx]) { |
571 | - case 1: /* crime less than 1000 */ | |
575 | + case 1: | |
576 | + /* crime less than 1000 */ | |
572 | 577 | |
573 | 578 | if (viewbuffer[idx] != 0) { |
574 | 579 | bgcolor = Color.gray; |
@@ -576,15 +581,18 @@ | ||
576 | 581 | bgcolor = Color.darkGray; |
577 | 582 | } |
578 | 583 | break; |
579 | - case 2: /* crime less than 5000 */ | |
584 | + case 2: | |
585 | + /* crime less than 5000 */ | |
580 | 586 | |
581 | 587 | bgcolor = Color.magenta; |
582 | 588 | break; |
583 | - case 3: /* murder ! */ | |
589 | + case 3: | |
590 | + /* murder ! */ | |
584 | 591 | |
585 | 592 | bgcolor = Color.red; |
586 | 593 | break; |
587 | - case 4: /* friendly */ | |
594 | + case 4: | |
595 | + /* friendly */ | |
588 | 596 | |
589 | 597 | bgcolor = Color.cyan; |
590 | 598 | break; |
@@ -648,23 +656,28 @@ | ||
648 | 656 | case Hunt.HCLIT_MAP_ANIMAL: |
649 | 657 | img = ovImgObject[8]; |
650 | 658 | switch (statbuffer[idx]) { |
651 | - case 1: /* stun */ | |
659 | + case 1: | |
660 | + /* stun */ | |
652 | 661 | |
653 | 662 | bgcolor = Color.darkGray; |
654 | 663 | break; |
655 | - case 2: /* panic */ | |
664 | + case 2: | |
665 | + /* panic */ | |
656 | 666 | |
657 | 667 | bgcolor = Color.yellow; |
658 | 668 | break; |
659 | - case 3: /* charm */ | |
669 | + case 3: | |
670 | + /* charm */ | |
660 | 671 | |
661 | 672 | bgcolor = Color.green; |
662 | 673 | break; |
663 | - case 4: /* angry */ | |
674 | + case 4: | |
675 | + /* angry */ | |
664 | 676 | |
665 | 677 | bgcolor = Color.red; |
666 | 678 | break; |
667 | - case 5: /* friendly */ | |
679 | + case 5: | |
680 | + /* friendly */ | |
668 | 681 | |
669 | 682 | bgcolor = Color.cyan; |
670 | 683 | break; |
@@ -722,13 +735,11 @@ | ||
722 | 735 | vtimer = new HuntMainViewTimer(this, nspan); |
723 | 736 | vtimer.start(); |
724 | 737 | } |
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(); | |
732 | 743 | } |
733 | 744 | } |
734 | 745 |
@@ -825,10 +836,6 @@ | ||
825 | 836 | case KeyEvent.VK_Z: |
826 | 837 | Hunt.getSendTask().doFire(2); |
827 | 838 | break; |
828 | - case KeyEvent.VK_SLASH: | |
829 | - hview = (HuntMessageView) Hunt.getMessageView(); | |
830 | - hview.setFocus("/"); | |
831 | - break; | |
832 | 839 | case KeyEvent.VK_ENTER: |
833 | 840 | hview = (HuntMessageView) Hunt.getMessageView(); |
834 | 841 | hview.setFocus(); |
@@ -835,6 +842,23 @@ | ||
835 | 842 | break; |
836 | 843 | } |
837 | 844 | } |
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 | + } | |
838 | 862 | } |
839 | 863 | |
840 | 864 | /* EOF */ |