优化了UI显示
This commit is contained in:
parent
15f19865ef
commit
1d369afc80
@ -31,7 +31,7 @@ public class DominionFlagInfo {
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
ListView view = ListView.create(6, "/dominion flag_info " + dominion.getName());
|
||||
ListView view = ListView.create(10, "/dominion flag_info " + dominion.getName());
|
||||
view.title("领地 " + dominion.getName() + " 默认权限")
|
||||
.navigator(Line.create()
|
||||
.append(Button.create("主菜单", "/dominion menu"))
|
||||
|
@ -33,7 +33,7 @@ public class DominionPrivilegeList {
|
||||
Notification.error(sender, "你不在任何领地内,请指定领地名称 /dominion privilege_list <领地名称>");
|
||||
return;
|
||||
}
|
||||
ListView view = ListView.create(5, "/dominion privilege_list " + dominion.getName());
|
||||
ListView view = ListView.create(10, "/dominion privilege_list " + dominion.getName());
|
||||
if (noAuthToManage(player, dominion)) return;
|
||||
List<PlayerPrivilegeDTO> privileges = PlayerPrivilegeDTO.select(dominion.getId());
|
||||
if (privileges.isEmpty()) {
|
||||
|
@ -19,7 +19,7 @@ public class ListDominion {
|
||||
Player player = playerOnly(sender);
|
||||
if (player == null) return;
|
||||
int page = getPage(args);
|
||||
ListView view = ListView.create(5, "/dominion list");
|
||||
ListView view = ListView.create(10, "/dominion list");
|
||||
List<String> dominions = playerDominions(sender);
|
||||
if (dominions.isEmpty()) {
|
||||
Notification.warn(sender, "你没有任何领地");
|
||||
|
@ -32,7 +32,7 @@ public class PrivilegeInfo {
|
||||
Notification.error(sender, "你不在任何领地内,请指定领地名称 /dominion privilege_info <玩家名称> [领地名称]");
|
||||
return;
|
||||
}
|
||||
ListView view = ListView.create(5, "/dominion privilege_info " + playerName + " " + dominion.getName());
|
||||
ListView view = ListView.create(10, "/dominion privilege_info " + playerName + " " + dominion.getName());
|
||||
if (noAuthToManage(player, dominion)) return;
|
||||
PlayerDTO playerDTO = PlayerDTO.select(playerName);
|
||||
if (playerDTO == null) {
|
||||
|
@ -73,6 +73,9 @@ public class ListView {
|
||||
}
|
||||
for (int i = offset; i < offset + page_size; i++) {
|
||||
if (i >= lines.size()) {
|
||||
for (int j = 0; j < page_size - lines.size() % page_size; j++) {
|
||||
view.addLine(Line.create());
|
||||
}
|
||||
break;
|
||||
}
|
||||
view.addLine(lines.get(i));
|
||||
|
@ -25,9 +25,13 @@ public class Pagination {
|
||||
componentList.add(Component.text(" 页 ", main_color));
|
||||
if (page > 1) {
|
||||
componentList.add(Button.create("上一页", command + " " + (page - 1)));
|
||||
} else {
|
||||
componentList.add(Component.text("[上一页]", sub_color));
|
||||
}
|
||||
if (page < page_count) {
|
||||
componentList.add(Button.create("下一页", command + " " + (page + 1)));
|
||||
} else {
|
||||
componentList.add(Component.text("[下一页]", sub_color));
|
||||
}
|
||||
TextComponent.Builder builder = Component.text();
|
||||
for (Component component : componentList) {
|
||||
|
Reference in New Issue
Block a user