@@ -20,6 +20,7 @@ public class CommandHudSet extends AHudCommand {
2020 this .add ("enable" );
2121 this .add ("pos" );
2222 this .add ("dir" );
23+ this .add ("alpha" );
2324 this .add ("reset" );
2425 }};
2526 private static final List <String > pic = new ArrayList <String >() {{
@@ -42,6 +43,7 @@ public CommandHudSet(HudType type) {
4243 commandList .put ("enable" , new HudEnable (type ));
4344 commandList .put ("reset" , new HudReset (type ));
4445 commandList .put ("pos" , new HudPos (type ));
46+ commandList .put ("alpha" , new HudAlpha (type ));
4547 commandList .put ("dir" , new HudDir (type ));
4648 if (type == HudType .PIC ) {
4749 commandList .put ("size" , new PicSize ());
@@ -148,8 +150,35 @@ public void execute(Object sender, String name, String[] args) {
148150
149151 AllMusic .side .sendMessageTask (sender , AllMusic .getMessage ().hud .set
150152 .replace (ARG .hud , AllMusic .getMessage ().hudList .getHud (type ))
151- .replace (ARG .x , args [3 ])
152- .replace (ARG .y , args [4 ]));
153+ .replace (ARG .x , String .valueOf (obj .x ))
154+ .replace (ARG .y , String .valueOf (obj .y )));
155+ } catch (Exception e ) {
156+ AllMusic .side .sendMessage (sender , AllMusic .getMessage ().command .error );
157+ }
158+ }
159+ }
160+
161+ private static class HudAlpha extends AHudCommand {
162+ public HudAlpha (HudType type ) {
163+ super (type );
164+ }
165+
166+ @ Override
167+ public void execute (Object sender , String name , String [] args ) {
168+ try {
169+ if (args .length != 4 ) {
170+ AllMusic .side .sendMessage (sender , AllMusic .getMessage ().command .error );
171+ return ;
172+ }
173+ HudItemPosObj obj = HudUtils .setHudAlpha (name , type , args [3 ]);
174+ if (obj == null ) {
175+ AllMusic .side .sendMessageTask (sender , AllMusic .getMessage ().command .error );
176+ return ;
177+ }
178+
179+ AllMusic .side .sendMessageTask (sender , AllMusic .getMessage ().hud .set4
180+ .replace (ARG .hud , AllMusic .getMessage ().hudList .getHud (type ))
181+ .replace (ARG .alpha , String .valueOf (obj .alpha )));
153182 } catch (Exception e ) {
154183 AllMusic .side .sendMessage (sender , AllMusic .getMessage ().command .error );
155184 }
0 commit comments