@@ -8,8 +8,9 @@ export class REActionForm extends EventActionFormBase {
88 show ( ) {
99 const chatEvents = this . _eventActionForm . actionManager . getAllEvents ( ) ;
1010 const form = new ActionForm ( this . _player , 'Reward Actions' ) ;
11+
1112 chatEvents . forEach ( ( actions , eventKey ) => {
12- form . button ( `§2§kii§r§e${ eventKey } §8Chat §2§kii§r\n§2Actions: [${ actions . length } ]` , ( ) => {
13+ form . button ( `§2§kii§r§e${ eventKey } : ${ actions [ 0 ] . type } §2§kii§r\n§2Actions: [${ actions . length } ]` , ( ) => {
1314 this . showRActionsForm ( eventKey , `Actions for ${ eventKey } Reward` , actions ) ;
1415 } ) ;
1516 } ) ;
@@ -20,20 +21,31 @@ export class REActionForm extends EventActionFormBase {
2021 showCreateNewActionForm ( ) {
2122 new ModalForm ( this . _player , 'Create New Reward Action' )
2223 . textField ( 'number' , 'Enter the number for action' , "50" , "100" )
24+ . dropdown ( 'Type' , [ 'Bits' , 'Reward' ] , 0 )
2325 . submitButton ( 'Continue' )
2426 . show ( response => {
2527 const chat = response [ 0 ] ;
28+ const typeIndex = response [ 1 ] ; // 選單的索引
29+ const types = [ 'Bits' , 'Reward' ] ;
30+ const chat2 = types [ typeIndex ] ; // 真正的 type 值
31+
2632 this . _eventActionForm . showCreateActionForm ( {
2733 eventKey : chat ,
28- chat
34+ type : chat2
2935 } , this . _actionOptions ) ;
3036 } ) ;
3137 }
3238 showRActionsForm ( eventKey , formTitle , chatActions ) {
3339 const form = new ActionForm ( this . _player , formTitle ) ;
34- form . body ( `§2§kii§r§fTotal Actions: §d${ chatActions . length } §2§kii§r\nUse Point: §e${ eventKey } §f.` ) ;
40+ console . log ( JSON . stringify ( chatActions , null , 4 ) )
41+
42+ let typelist = chatActions . map ( action => action . type )
43+ form . body ( `§2§kii§r§fTotal Actions: §d${ chatActions . length } §2§kii§r\nUse Point: §e${ eventKey } §f\nType:${ typelist } ` ) ;
3544 chatActions . forEach ( ( action , index ) => {
3645 let text = '' ;
46+ if ( action . type ) {
47+ text += ` - ${ action . type } `
48+ }
3749 if ( action . actionType === 'Summon' ) {
3850 text += ` - ${ action . summonOptions . entityName . toUpperCase ( ) } x${ action . summonOptions ?. amount } ` ;
3951 }
0 commit comments