From 501253d13aafcd2a069a33925b145f0128d25697 Mon Sep 17 00:00:00 2001 From: Blockzilla101 <48705529+Blockzilla101@users.noreply.github.com> Date: Sun, 12 Apr 2020 07:52:05 -0700 Subject: [PATCH] added name of player to ban/kick/vote-kick/un-admin/admin confirmation dialog (#1846) * added name of player to baning/kicking/vote-kicking/admining * slight tweaks * fixed redundant things --- core/assets/bundles/bundle.properties | 10 +++++----- .../src/mindustry/ui/fragments/PlayerListFragment.java | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index fda8e0fb9e..5982b5e943 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -198,12 +198,12 @@ server.outdated = [crimson]Outdated Server![] server.outdated.client = [crimson]Outdated Client![] server.version = [gray]v{0} {1} server.custombuild = [accent]Custom Build -confirmban = Are you sure you want to ban this player? -confirmkick = Are you sure you want to kick this player? -confirmvotekick = Are you sure you want to vote-kick this player? +confirmban = Are you sure you want to ban "{0}[white]"? +confirmkick = Are you sure you want to kick "{0}[white]"? +confirmvotekick = Are you sure you want to vote-kick "{0}[white]"? confirmunban = Are you sure you want to unban this player? -confirmadmin = Are you sure you want to make this player an admin? -confirmunadmin = Are you sure you want to remove admin status from this player? +confirmadmin = Are you sure you want to make "{0}[white]" an admin? +confirmunadmin = Are you sure you want to remove admin status from "{0}[white]"? joingame.title = Join Game joingame.ip = Address: disconnect = Disconnected. diff --git a/core/src/mindustry/ui/fragments/PlayerListFragment.java b/core/src/mindustry/ui/fragments/PlayerListFragment.java index 1693b85e7c..340714f51a 100644 --- a/core/src/mindustry/ui/fragments/PlayerListFragment.java +++ b/core/src/mindustry/ui/fragments/PlayerListFragment.java @@ -113,9 +113,9 @@ public class PlayerListFragment extends Fragment{ t.defaults().size(bs); t.addImageButton(Icon.hammer, Styles.clearPartiali, - () -> ui.showConfirm("$confirm", "$confirmban", () -> Call.onAdminRequest(user, AdminAction.ban))); + () -> ui.showConfirm("$confirm", Core.bundle.format("confirmban", user.name), () -> Call.onAdminRequest(user, AdminAction.ban))); t.addImageButton(Icon.cancel, Styles.clearPartiali, - () -> ui.showConfirm("$confirm", "$confirmkick", () -> Call.onAdminRequest(user, AdminAction.kick))); + () -> ui.showConfirm("$confirm", Core.bundle.format("confirmkick", user.name), () -> Call.onAdminRequest(user, AdminAction.kick))); t.row(); @@ -125,9 +125,9 @@ public class PlayerListFragment extends Fragment{ String id = user.uuid; if(netServer.admins.isAdmin(id, connection.address)){ - ui.showConfirm("$confirm", "$confirmunadmin", () -> netServer.admins.unAdminPlayer(id)); + ui.showConfirm("$confirm", Core.bundle.format("confirmunadmin", user.name), () -> netServer.admins.unAdminPlayer(id)); }else{ - ui.showConfirm("$confirm", "$confirmadmin", () -> netServer.admins.adminPlayer(id, user.usid)); + ui.showConfirm("$confirm", Core.bundle.format("confirmadmin", user.name), () -> netServer.admins.adminPlayer(id, user.usid)); } }) .update(b -> b.setChecked(user.isAdmin)) @@ -142,7 +142,7 @@ public class PlayerListFragment extends Fragment{ button.add().growY(); button.addImageButton(Icon.hammer, Styles.clearPartiali, - () -> ui.showConfirm("$confirm", "$confirmvotekick", () -> Call.sendChatMessage("/votekick " + user.name))).size(h); + () -> ui.showConfirm("$confirm", Core.bundle.format("confirmvotekick", user.name), () -> Call.sendChatMessage("/votekick " + user.name))).size(h); } content.add(button).padBottom(-6).width(350f).maxHeight(h + 14);