mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Hide help buttons in //sel selector box.
This commit is contained in:
parent
6c21ae5c83
commit
8baf221c95
@ -619,6 +619,7 @@ public class SelectionCommands {
|
|||||||
case UNKNOWN:
|
case UNKNOWN:
|
||||||
default:
|
default:
|
||||||
CommandListBox box = new CommandListBox("Selection modes", null);
|
CommandListBox box = new CommandListBox("Selection modes", null);
|
||||||
|
box.setHidingHelp(true);
|
||||||
TextComponentProducer contents = box.getContents();
|
TextComponentProducer contents = box.getContents();
|
||||||
contents.append(SubtleFormat.wrap("Select one of the modes below:")).newline();
|
contents.append(SubtleFormat.wrap("Select one of the modes below:")).newline();
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@ import java.util.List;
|
|||||||
public class CommandListBox extends PaginationBox {
|
public class CommandListBox extends PaginationBox {
|
||||||
|
|
||||||
private List<CommandEntry> commands = Lists.newArrayList();
|
private List<CommandEntry> commands = Lists.newArrayList();
|
||||||
|
private boolean hideHelp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new box.
|
* Create a new box.
|
||||||
@ -43,7 +44,7 @@ public class CommandListBox extends PaginationBox {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Component getComponent(int number) {
|
public Component getComponent(int number) {
|
||||||
return commands.get(number).createComponent();
|
return commands.get(number).createComponent(hideHelp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -63,6 +64,14 @@ public class CommandListBox extends PaginationBox {
|
|||||||
commands.add(new CommandEntry(alias, description, insertion));
|
commands.add(new CommandEntry(alias, description, insertion));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isHidingHelp() {
|
||||||
|
return hideHelp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHidingHelp(boolean hideHelp) {
|
||||||
|
this.hideHelp = hideHelp;
|
||||||
|
}
|
||||||
|
|
||||||
private static class CommandEntry {
|
private static class CommandEntry {
|
||||||
private final String alias;
|
private final String alias;
|
||||||
private final Component description;
|
private final Component description;
|
||||||
@ -74,11 +83,13 @@ public class CommandListBox extends PaginationBox {
|
|||||||
this.insertion = insertion;
|
this.insertion = insertion;
|
||||||
}
|
}
|
||||||
|
|
||||||
Component createComponent() {
|
Component createComponent(boolean hideHelp) {
|
||||||
TextComponentProducer line = new TextComponentProducer();
|
TextComponentProducer line = new TextComponentProducer();
|
||||||
line.append(SubtleFormat.wrap("? ")
|
if (!hideHelp) {
|
||||||
.clickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "//help " + insertion))
|
line.append(SubtleFormat.wrap("? ")
|
||||||
.hoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Additional Help"))));
|
.clickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "//help " + insertion))
|
||||||
|
.hoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Additional Help"))));
|
||||||
|
}
|
||||||
TextComponent command = TextComponent.of(alias, TextColor.GOLD);
|
TextComponent command = TextComponent.of(alias, TextColor.GOLD);
|
||||||
if (insertion == null) {
|
if (insertion == null) {
|
||||||
line.append(command);
|
line.append(command);
|
||||||
|
Loading…
Reference in New Issue
Block a user