mirror of
https://github.com/PikaMug/Quests.git
synced 2025-02-11 18:11:19 +01:00
Format money in rewards prompt, per #1719
This commit is contained in:
parent
f341bc0e79
commit
ea8b8fe24b
@ -191,9 +191,8 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||
} else {
|
||||
final int moneyRew = (Integer) context.getSessionData(CK.REW_MONEY);
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + moneyRew + " "
|
||||
+ (moneyRew > 1 ? plugin.getDependencies().getCurrency(true)
|
||||
: plugin.getDependencies().getCurrency(false)) + ChatColor.GRAY + ")";
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + moneyRew + " "
|
||||
+ plugin.getDependencies().getVaultEconomy().format(moneyRew) + ChatColor.GRAY + ")";
|
||||
}
|
||||
} else {
|
||||
return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
|
||||
@ -490,16 +489,14 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
||||
|
||||
@Override
|
||||
public String getPromptText(final ConversationContext context) {
|
||||
final QuestsEditorPostOpenStringPromptEvent event = new QuestsEditorPostOpenStringPromptEvent(context, this);
|
||||
final QuestsEditorPostOpenStringPromptEvent event
|
||||
= new QuestsEditorPostOpenStringPromptEvent(context, this);
|
||||
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
||||
|
||||
String text = getQueryText(context);
|
||||
if (plugin.getDependencies().getVaultEconomy() != null) {
|
||||
text = text.replace("<money>", ChatColor.AQUA + (plugin.getDependencies().getVaultEconomy()
|
||||
.currencyNamePlural().isEmpty() ? Lang.get("money") : plugin.getDependencies().getVaultEconomy()
|
||||
.currencyNamePlural()) + ChatColor.YELLOW);
|
||||
} else {
|
||||
text = text.replace("<money>", ChatColor.AQUA + Lang.get("money") + ChatColor.YELLOW);
|
||||
text = text.replace("<money>", ChatColor.AQUA
|
||||
+ (plugin.getDependencies().getVaultEconomy().currencyNamePlural() + ChatColor.YELLOW));
|
||||
}
|
||||
return ChatColor.YELLOW + text;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user