Skip to content

Commit

Permalink
Add bundle for !count command
Browse files Browse the repository at this point in the history
Removed extra bundle strings from uk_UA
  • Loading branch information
buthed010203 committed May 18, 2024
1 parent b7913e2 commit ce9ac94
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 15 deletions.
6 changes: 6 additions & 0 deletions core/assets/bundles/bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ client.command.help.description = Lists all client commands
client.command.unit.description = Swap to specified unit
client.command.unitcursor.description = Swap to closest specified unit to cursor
client.command.count.description = Counts how many of a certain unit are alive
client.command.count.success = [accent]{0}:\
Total(Cap): {1}({2})\
Free(Free Flagged): {3}({4})\
Flagged(Unflagged): {5}({6})\
Players(Command): {7}({8})\
Logic(Logic Flagged): {9}({10})
client.command.coordsinvalid = [scarlet]Invalid coordinates, format is [x] [y] Eg: "{0} 10 300" or "{0}"
client.command.spawn.description = Spawns unit(s) at the specified position. Set the team to "me" to spawn on your team, x and y can be set to "c" to spawn on cursor
client.command.go.description = Navigates to (x, y) or the last coordinates posted to chat
Expand Down
4 changes: 1 addition & 3 deletions core/assets/bundles/bundle_uk_UA.properties
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ client.command.gamelosetext.description = Встановлює текст, як
client.command.gamelosetext.clear = [accent]Очищено gamelosetext, оскільки не було надано тексту.
client.command.gamelosetext.success = [accent]gamelosetext текст встановлено як "{0}"
client.command.text.description = Встановлює спеціальний персональний текст.\n Використайте [accent]!text edit/e <name> <text...>[] щоб створити/редагувати текс. Не вводіть текст щоб очистити text.\n Використайте [accent]!text say/s <name>[] щоб надіслати створене повідомлення у чат.\n Використайте [accent]!text list/l[] щоб побаити усі створени тексти.\n Використайте [accent]!text js/j <name>[] щоб запустити text як js команду.
client.command.text.noselected = [scarlet]Не надано ім'я для {0}.
client.command.text.say.noselected = [scarlet]Не обрано тексту щоб надіслати.
client.command.text.run.noselected = [scarlet]Не обрано тексту щоб запустити.
client.command.text.notext = [accent]Текст не встановлено для "{0}".
Expand Down Expand Up @@ -1465,7 +1464,6 @@ setting.selectionsizeoncursor.name = Відображати розмір вид
setting.drawselectionvanilla.name = Ванільна область виділення
setting.drawselectionvanilla.description = Малює контур при виділенні ділянки (схеми, перебудова, руйнування).
setting.drawcursors.name = Малювати курсори гравців
setting.unitranges.name = Показувати дальність дії одиниць, якщо ввімкнено дальність дії вежі
setting.tracelogicunits.name = Малювати одиниці контрольовані процессором
setting.tracelogicunits.description = Малювати прямі від наведеного процесора до його контрольованих одиниць
setting.enemyunitranges.name = Показувати радіус дії ворожнечих одиниць, коли радіус дії турелей увімкнений
Expand Down Expand Up @@ -1507,7 +1505,7 @@ setting.keybind1altcommand.name = Клавіша+Alt
setting.keybind1altcommand.description = Ця команда буде виконуватися при натисканні Alt+U. Щоб запустити JS напишить !js <js>
setting.keybind1command.name = Клавіша
setting.keybind1command.description = Ця команда буде виконуватися при натисканні U. Щоб запустити JS напишить !js <js>
setting.automapvote = Автоматична оцінка мапи
setting.automapvote.name = Автоматична оцінка мапи
setting.updateurl.name = Репозиторій для оновлень
setting.pingexecutorthreads.name = Потоки для виконання ping
setting.pingexecutorthreads.description = Встановлює кількість потоків, які використовуються для виявлення сервера
Expand Down
19 changes: 19 additions & 0 deletions core/src/mindustry/Vars.java
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,25 @@ public static void loadSettings(){
Log.warn("END BUNDLE DIFF");
});
}

if(OS.hasProp("extrabundles")){ // When -Dextrabundles is passed, logs all extra keys for all bundles
Events.on(ClientLoadEvent.class, event -> {
I18NBundle parent = bundle;
while(parent.getParent() != null) parent = parent.getParent();

Log.warn("BEGIN BUNDLE EXTRAS");
for(var l : locales){
if(l == parent.getLocale()) continue;
var b = I18NBundle.createBundle(Core.files.internal("bundles/bundle"), l);
Log.warn("#############\n\tBundle: " + b.getLocale().toString());
for(var k : b.getKeys()){
if(!parent.has(k)) Log.info(k);
}
}
Log.warn("END BUNDLE EXTRAS");
});

}
}
}
}
11 changes: 1 addition & 10 deletions core/src/mindustry/client/Commands.kt
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,7 @@ fun setupCommands() {
}
}

player.sendMessage(
"""
[accent]${type.localizedName}:
Total(Cap): $total($cap)
Free(Free Flagged): $free($freeFlagged)
Flagged(Unflagged): $flagged($unflagged)
Players(Command): $players($command)
Logic(Logic Flagged): $logic($logicFlagged)
""".trimIndent()
)
player.sendMessage("client.command.count.success"[type.localizedName, total, cap, free, freeFlagged, flagged, unflagged, players, command, logic, logicFlagged])
}

// FINISHME: Add unit control/select command(s)
Expand Down
3 changes: 2 additions & 1 deletion core/src/mindustry/client/utils/ClientUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ fun <T> Iterable<T>.unescape(escapement: T, vararg escape: T): List<T> {
return output
}

fun String.bundle(): String? = Core.bundle[removePrefix("@")]
fun String.bundle(): String = Core.bundle[removePrefix("@")]
operator fun String.get(vararg args: Any?): String = Core.bundle.format(removePrefix("@"), args)

val X509Certificate.readableName: String
get() = subjectX500Principal.name.removePrefix("CN=")
Expand Down
2 changes: 1 addition & 1 deletion core/src/mindustry/ui/dialogs/SettingsMenuDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ void addSettings(){
client.sliderPref("automapvote", 0, 0, 4, s -> s == 0 ? "Never" : s == 4 ? "Random vote" : "Always " + new String[]{"downvote", "novote", "upvote"}[--s]);
client.sliderPref("pingexecutorthreads", OS.isWindows && !OS.is64Bit ? 5 : 65, 5, 105, 5, s -> s > 100 ? "Unlimited" : String.valueOf(s));
client.sliderPref("maxschematicslisted", 300, 0, 3000, 150, s -> s == 0 ? "Unlimited" : String.valueOf(s));
client.textPref("defaultbuildpathargs", "self"); // Keep it to just self. Skill issue players going afk make this too problematic otherwise.
client.textPref("defaultbuildpathargs", "self"); // Keep it to just self. Skill issue players going afk make this too problematic otherwise. FINISHME: Add an afk detection system and revert this once we can reliably detect afk players and allow others to stop their pathing
client.textPref("defaultminepathargs", "all");
client.textPref("gamejointext", "");
client.textPref("gamewintext", "");
Expand Down

0 comments on commit ce9ac94

Please sign in to comment.