@@ -70,13 +70,31 @@ public OutputConfigPanel() {
7070 List .of (true , false ),
7171 bool -> _ -> {
7272 ChannelClientConfig .write (c -> c .muteAll = bool );
73+ OutputConfigPanel .this .container .getChildren ().forEach (tWidget -> {
74+ if (tWidget instanceof PlayerVolumePanel playerVolumePanel ) {
75+ playerVolumePanel .getChildren ().forEach (t -> {
76+ if (t instanceof PlayerVolumeBar playerVolumeBar ) {
77+ playerVolumeBar .update ();
78+ }
79+ });
80+ }
81+ });
7382 },
7483 entry -> entry .getContent () == cfg .muteAll
7584 ).getB ().setTooltip (Tooltip .create (Component .translatable ("channel.config.post.mute_all.tooltip" )));
7685 addOptionSplitter (Component .translatable ("channel.config.post.player_control" ));
7786 addOption (Component .empty (), new TButton (Component .translatable ("channel.config.post.player_control_clear" ), _ -> {
7887 ChannelPlayerConfig .clear ();
7988 PlayerVolumePanel .PLAYER_VOLUME .replaceAll ((_ , _ ) -> 0f );
89+ OutputConfigPanel .this .container .getChildren ().forEach (tWidget -> {
90+ if (tWidget instanceof PlayerVolumePanel playerVolumePanel ) {
91+ playerVolumePanel .getChildren ().forEach (t -> {
92+ if (t instanceof PlayerVolumeBar playerVolumeBar ) {
93+ playerVolumeBar .update ();
94+ }
95+ });
96+ }
97+ });
8098 })).getB ().setTooltip (Tooltip .create (Component .translatable ("channel.config.post.player_control_clear.tooltip" )));
8199 this .container .add (new PlayerVolumePanel ());
82100 }
@@ -190,15 +208,24 @@ public PlayerVolumeBar(UUID id, float db) {
190208 this .volume .setVisibleT (false );
191209 }
192210 });
211+ update ();
212+ muteButton .setBorder (null );
213+ muteButton .setTooltip (Tooltip .create (Component .translatable ("channel.config.post.mute.tooltip" )));
214+ this .add (muteButton );
215+ //TODO show player volume under silder
216+ }
217+
218+ protected void update () {
193219 if (ChannelPlayerConfig .muted (uuid )) {
194220 muteButton .setBorder (new Border (0xffff0000 , 1 ));
195221 muteButton .setNormalBackGround (0x80ff0000 );
196222 this .volume .setVisibleT (false );
223+ } else {
224+ muteButton .setBorder (null );
225+ muteButton .setNormalBackGround (0x0 );
226+ this .volume .setVisibleT (true );
197227 }
198- muteButton .setBorder (null );
199- muteButton .setTooltip (Tooltip .create (Component .translatable ("channel.config.post.mute.tooltip" )));
200- this .add (muteButton );
201- //TODO show player volume under silder
228+ this .volume .setAbsValueWithoutRespond (PlayerVolumePanel .PLAYER_VOLUME .getOrDefault (uuid , 0f ));
202229 }
203230
204231 @ Override
0 commit comments