@@ -12,10 +12,59 @@ import { ShareActionForm } from "./actions/ShareAction";
1212import { MemberActionForm } from "./actions/MemberAction" ;
1313import { LikeActionForm } from "./actions/LikeAction" ;
1414import { ChatActionForm } from "./actions/ChatAction" ;
15+ //給Twitch忠誠點數兌換觸發用的事件(依據花費點數量觸發)
16+ import { REActionForm } from "./actions/RewardAction" ;
1517/**
1618 * A map of player names in-game with a TNTCoinGUI instance.
1719 */
1820export const INGAME_PLAYERS = new Map ( ) ;
21+
22+
23+
24+ export class EventA {
25+ _player ;
26+ _game ;
27+
28+ constructor ( player , game ) {
29+ this . _player = player ;
30+ this . _game = game
31+ this . showActionFormPage1 = this . showActionFormPage1 . bind ( this ) ;
32+ this . showActionFormPage2 = this . showActionFormPage2 . bind ( this ) ;
33+ }
34+ // Page 1
35+ showActionFormPage1 ( ) {
36+
37+ const giftAction = new GiftActionForm ( this . _player , this . _game . giftActionManager ) ;
38+ const likeAction = new LikeActionForm ( this . _player , this . _game . likeActionManager ) ;
39+ const memberAction = new MemberActionForm ( this . _player , this . _game . memberActionManager ) ;
40+ const followAction = new FollowActionForm ( this . _player , this . _game . followActionManager ) ;
41+
42+
43+
44+ new ActionForm ( this . _player , 'Event Actions - Page 1' )
45+ . button ( 'Gift Actions' , giftAction . show . bind ( giftAction ) , 'textures/tnt-coin/gui/buttons/gift.png' ) // 可以跳頁
46+ . button ( 'Like Actions' , likeAction . show . bind ( likeAction ) , 'textures/tnt-coin/gui/buttons/heart.png' )
47+ . button ( 'Member Actions' , memberAction . show . bind ( memberAction ) , 'textures/tnt-coin/gui/buttons/member.png' )
48+ . button ( 'Follow Actions' , followAction . show . bind ( followAction ) , 'textures/tnt-coin/gui/buttons/follow.png' )
49+ . button ( 'Next Page' , this . showActionFormPage2 . bind ( this ) ) // 可以跳頁
50+ . show ( ) ;
51+ }
52+
53+ // Page 2
54+ showActionFormPage2 ( ) {
55+ const shareAction = new ShareActionForm ( this . _player , this . _game . shareActionManager ) ;
56+ const chatAction = new ChatActionForm ( this . _player , this . _game . chatActionManager ) ;
57+ const rewardAction = new REActionForm ( this . _player , this . _game . rewardActionManager ) ;
58+
59+ new ActionForm ( this . _player , 'Event Actions - Page 2' )
60+ . button ( 'Chat Actions' , chatAction . show . bind ( chatAction ) , 'textures/tnt-coin/gui/buttons/chat.png' )
61+ . button ( 'Share Actions' , shareAction . show . bind ( shareAction ) , 'textures/tnt-coin/gui/buttons/share.png' )
62+ . button ( 'Reward Actions' , rewardAction . show . bind ( rewardAction ) , 'textures/tnt-coin/gui/buttons/reward.png' )
63+ . button ( 'Back' , this . showActionFormPage1 . bind ( this ) ) // 返回上一頁
64+ . show ( ) ;
65+ }
66+
67+ }
1968/**
2069 * Represents a TNTCoin game instance with a GUI.
2170 */
@@ -185,7 +234,11 @@ export class TNTCoinGUI {
185234 /**
186235 * Shows the in-game form to the player.
187236 */
237+
238+
239+
188240 showInGameForm ( ) {
241+ const EGUI = new EventA ( this . _player , this . _game ) ;
189242 const wins = this . _game . winManager . getCurrentWins ( ) ;
190243 const maxWin = this . _game . winManager . getMaxWins ( ) ;
191244 let maxfillblock = this . _structure . airBlockLocations . length + this . _structure . filledBlockLocations . size
@@ -206,29 +259,17 @@ export class TNTCoinGUI {
206259 . button ( 'Teleport' , ( ) => this . _game . teleportPlayer ( this . _structure . structureHeight ) , 'textures/tnt-coin/gui/buttons/ender_pearl.png' )
207260 . button ( 'Timer' , this . showTimerForm . bind ( this ) , 'textures/tnt-coin/gui/buttons/clock.png' )
208261 . button ( 'Gift Goal' , this . showGiftGoalForm . bind ( this ) , 'textures/tnt-coin/gui/buttons/goals.png' )
209- . button ( '§2§kii§r§8Event Actions§2§kii§r' , this . showEventActionsForm . bind ( this ) , 'textures/tnt-coin/gui/buttons/events.png' )
262+ . button ( '§2§kii§r§8Event Actions§2§kii§r' , EGUI . showActionFormPage1 . bind ( this ) , 'textures/tnt-coin/gui/buttons/events.png' )
210263 . button ( '§2§kii§r§8Events§2§kii§r' , this . showEventsForm . bind ( this ) , 'textures/tnt-coin/gui/buttons/bell.png' )
211264 . button ( 'Settings' , this . showInGameSettingsForm . bind ( this ) , 'textures/tnt-coin/gui/buttons/settings.png' )
212265 . button ( 'Reload' , this . _game . loadGame . bind ( this . _game ) , 'textures/tnt-coin/gui/buttons/reload.png' )
213266 . button ( 'Quit' , this . _game . quitGame . bind ( this . _game ) , 'textures/tnt-coin/gui/buttons/left.png' )
214267 . show ( ) ;
215268 }
216- showEventActionsForm ( ) {
217- const giftAction = new GiftActionForm ( this . _player , this . _game . giftActionManager ) ;
218- const followAction = new FollowActionForm ( this . _player , this . _game . followActionManager ) ;
219- const shareAction = new ShareActionForm ( this . _player , this . _game . shareActionManager ) ;
220- const memberAction = new MemberActionForm ( this . _player , this . _game . memberActionManager ) ;
221- const likeAction = new LikeActionForm ( this . _player , this . _game . likeActionManager ) ;
222- const chatAction = new ChatActionForm ( this . _player , this . _game . chatActionManager ) ;
223- new ActionForm ( this . _player , 'Event Actions' )
224- . button ( 'Gift Actions' , giftAction . show . bind ( giftAction ) , 'textures/tnt-coin/gui/buttons/gift.png' )
225- . button ( 'Like Actions' , likeAction . show . bind ( likeAction ) , 'textures/tnt-coin/gui/buttons/heart.png' )
226- . button ( 'Member Actions' , memberAction . show . bind ( memberAction ) , 'textures/tnt-coin/gui/buttons/member.png' )
227- . button ( 'Follow Actions' , followAction . show . bind ( followAction ) , 'textures/tnt-coin/gui/buttons/follow.png' )
228- . button ( 'Chat Actions' , chatAction . show . bind ( chatAction ) , 'textures/tnt-coin/gui/buttons/chat.png' )
229- . button ( 'Share Actions' , shareAction . show . bind ( shareAction ) , 'textures/tnt-coin/gui/buttons/share.png' )
230- . show ( ) ;
231- }
269+
270+
271+
272+
232273 /**
233274 * Shows the form to set up or modify the gift goal.
234275 */
@@ -309,7 +350,8 @@ export class TNTCoinGUI {
309350 . textField ( "number" , "[§eFILL§r] Delay in Ticks:" , "Enter the delay in ticks to fill blocks" , oldSettings . fillSettings . tickInterval . toString ( ) , ( updatedValue ) => newSettings . fillSettings . tickInterval = updatedValue )
310351 . textField ( "number" , "[§eFILL§r] Amount of Blocks per tick:" , 'Enter the amount of blocks to fill per tick' , oldSettings . fillSettings . blocksPerTick . toString ( ) , ( updatedValue ) => newSettings . fillSettings . blocksPerTick = updatedValue )
311352 . textField ( "number" , "[§eFILL§r] 方塊容錯:" , '允許方塊容錯數' , this . _game . structure . allowAmount . toString ( ) , ( updatedValue ) => this . _game . structure . allowAmount = updatedValue )
312-
353+ . textField ( "number" , "[§eDetectTick§r] 框架方塊保護檢測間隔:" , 'Tick延遲' , this . _game . structure . detectTick . toString ( ) , ( updatedValue ) => this . _game . structure . detectTick = updatedValue )
354+
313355 . submitButton ( '§2Update Settings§r' )
314356 . show ( ( ) => {
315357 const isSettingsChanged = JSON . stringify ( oldSettings ) !== JSON . stringify ( newSettings ) ;
0 commit comments