From 623d349c6184947581375f9c9d8d0c3cc13bbdca Mon Sep 17 00:00:00 2001 From: HappyPikachu Date: Wed, 31 Jan 2018 03:03:23 -0500 Subject: [PATCH] (UNSTABLE) Lang corrections, reduce duplicate strings - part 3 --- .../me/blackvein/quests/EventFactory.java | 4 +- .../java/me/blackvein/quests/util/Lang.java | 24 ++++-- src/main/resources/strings.yml | 84 ++++++++++--------- 3 files changed, 63 insertions(+), 49 deletions(-) diff --git a/src/main/java/me/blackvein/quests/EventFactory.java b/src/main/java/me/blackvein/quests/EventFactory.java index 9ee28f45f..a7e19d4bd 100644 --- a/src/main/java/me/blackvein/quests/EventFactory.java +++ b/src/main/java/me/blackvein/quests/EventFactory.java @@ -1039,9 +1039,9 @@ public class EventFactory implements ConversationAbandonedListener { @Override public Prompt acceptInput(ConversationContext context, String input) { - if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false && input.equalsIgnoreCase(Lang.get("cmdNone")) == false) { + if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false && input.equalsIgnoreCase(Lang.get("cmdClear")) == false) { context.setSessionData(CK.E_MESSAGE, input); - } else if (input.equalsIgnoreCase(Lang.get("cmdNone"))) { + } else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) { context.setSessionData(CK.E_MESSAGE, null); } return new CreateMenuPrompt(); diff --git a/src/main/java/me/blackvein/quests/util/Lang.java b/src/main/java/me/blackvein/quests/util/Lang.java index b56889ca6..b5848629b 100644 --- a/src/main/java/me/blackvein/quests/util/Lang.java +++ b/src/main/java/me/blackvein/quests/util/Lang.java @@ -123,12 +123,24 @@ public class Lang { } private void finishLang() { - // or 'cancel' to return - if (get("strCancel") != null) { - langMap.put("strCancel", get("strCancel").replaceAll("", get("cmdCancel"))); - } - for (String s : langMap.keySet()) { - langMap.put(s, get(s).replaceAll("", get("strCancel"))); + langMap.put("strAdd", get("strAdd").replaceAll("", get("cmdAdd"))); + langMap.put("strClear", get("strClear").replaceAll("", get("cmdClear"))); + langMap.put("strCancel", get("strCancel").replaceAll("", get("cmdCancel"))); + langMap.put("strDone", get("strDone").replaceAll("", get("cmdDone"))); + + for (String key : langMap.keySet()) { + String value = get(key); + + // then enter 'add' to include it + value.replaceAll("", get("strAdd")); + // or 'clear' to erase all data + value.replaceAll("", get("strClear")); + // or 'cancel' to return + value.replaceAll("", get("strCancel")); + // then enter '' to save + value.replaceAll("", get("strDone")); + + langMap.put(key, value); } } diff --git a/src/main/resources/strings.yml b/src/main/resources/strings.yml index e9574dafb..eb3500b97 100644 --- a/src/main/resources/strings.yml +++ b/src/main/resources/strings.yml @@ -73,12 +73,12 @@ questEditorEnterAskMessage: "Enter ask message ()" questEditorEnterFinishMessage: "Enter finish message ()" questEditorEnterRedoDelay: "Enter amount of time (in seconds), 0 to clear the redo delay or -1 to cancel" questEditorEnterNPCStart: "Enter NPC ID, -1 to clear the NPC start or -2 to cancel" -questEditorEnterBlockStart: "Right-click on a block to use as a start point, then enter 'done' to save, or enter 'clear' to clear the block start, " -questEditorEnterInitialEvent: "Enter an Event name, or enter 'clear' to clear the initial Event, " +questEditorEnterBlockStart: "Right-click on a block to use as a start point, , , " +questEditorEnterInitialEvent: "Enter an Event name, , " questRequiredNoneSet: "Required, none set" questWGSetRegion: "Set Region" questWGNotInstalled: "WorldGuard not installed" -questWGPrompt: "Enter WorldGuard region, or enter 'clear' to clear the region, " +questWGPrompt: "Enter WorldGuard region, , " questWGInvalidRegion: " is not a valid WorldGuard region!" questWGRegionCleared: "Quest region cleared." questCitNotInstalled: "Citizens not installed" @@ -187,7 +187,7 @@ stageEditorObjectiveOverride: "Objective display override" stageEditorCustom: "Custom objectives" stageEditorNoModules: "No modules loaded" stageEditorModuleNotFound: "Custom objective module not found." -stageEditorCustomPrompt: "Enter the name of a custom objective to add, or enter 'clear' to clear all custom objectives, " +stageEditorCustomPrompt: "Enter the name of a custom objective to add, , " stageEditorCustomAlreadyAdded: "That custom objective has already been added!" stageEditorCustomCleared: "Custom objectives cleared." stageEditorCustomDataPrompt: "Enter value for :" @@ -204,36 +204,36 @@ stageEditorEnchantTypePrompt: "Enter enchantment names, separating each one by a stageEditorEnchantAmountsPrompt: "Enter enchant amounts (numbers), separating each one by a space, " stageEditorItemNamesPrompt: "Enter item names, separating each one by a space, " stageEditorNPCPrompt: "Enter NPC IDs, separating each one by a space, " -stageEditorNPCToTalkToPrompt: "Enter NPC IDs, separating each one by a space, or enter 'clear' to clear the NPC ID list, " +stageEditorNPCToTalkToPrompt: "Enter NPC IDs, separating each one by a space, , " stageEditorDeliveryMessagesPrompt: "Enter delivery messages, separating each one by a semi-colon, " stageEditorKillNPCsPrompt: "Enter kill amounts (numbers), separating each one by a space, " stageEditorMobsPrompt: "Enter mob names separating each one by a space, " stageEditorMobAmountsPrompt: "Enter mob amounts separating each one by a space, " -stageEditorMobLocationPrompt: "Right-click on a block to select it, then enter 'add' to add it to the kill location list, " +stageEditorMobLocationPrompt: "Right-click on a block to select it, , " stageEditorMobLocationRadiiPrompt: "Enter kill location radii (number of blocks) separating each one by a space, " stageEditorMobLocationNamesPrompt: "Enter location names separating each one by a comma, " -stageEditorReachLocationPrompt: "Right-click on a block to select it, then enter 'add' to add it to the reach location list, " +stageEditorReachLocationPrompt: "Right-click on a block to select it, , " stageEditorReachLocationRadiiPrompt: "Enter reach location radii (number of blocks) separating each one by a space, " stageEditorReachLocationNamesPrompt: "Enter location names separating each one by a comma, " stageEditorTameAmountsPrompt: "Enter tame amounts separating each one by a space, " stageEditorShearColorsPrompt: "Enter sheep colors separating each one by a space, " stageEditorShearAmountsPrompt: "Enter shear amounts separating each one by a space, " -stageEditorEventsPrompt: "Enter an event name, or enter 'clear' to clear the event, " -stageEditorChatEventsPrompt: "Enter an event name to add, or enter 'clear' to clear all chat events, " +stageEditorEventsPrompt: "Enter an event name, , " +stageEditorChatEventsPrompt: "Enter an event name to add, , " stageEditorChatEventsTriggerPrompt: "%yellow%Enter a chat trigger for%aqua% %yellow% " -stageEditorCommandEventsPrompt: "Enter an event name to add, or enter 'clear' to clear all command events, " +stageEditorCommandEventsPrompt: "Enter an event name to add, , " stageEditorCommandEventsTriggerPrompt: "%yellow%Enter a command trigger for%aqua% %yellow% " -stageEditorDelayPrompt: "Enter time (in seconds), or enter 'clear' to clear the delay, " -stageEditorDelayMessagePrompt: "Enter delay message, or enter 'clear' to clear the message, " -stageEditorScriptPrompt: "Enter script name, or enter 'clear' to clear the script, " -stageEditorStartMessagePrompt: "Enter start message, or enter 'clear' to clear the message, " -stageEditorCompleteMessagePrompt: "Enter complete message, or enter 'clear' to clear the message, " +stageEditorDelayPrompt: "Enter time (in seconds), , " +stageEditorDelayMessagePrompt: "Enter delay message, , " +stageEditorScriptPrompt: "Enter script name, , " +stageEditorStartMessagePrompt: "Enter start message, , " +stageEditorCompleteMessagePrompt: "Enter complete message, , " stageEditorPasswordDisplayPrompt: "Enter a password display, " stageEditorPasswordDisplayHint: "(This is the text that will be displayed to the player as their objective)" stageEditorPasswordPhrasePrompt: "Enter a password phrase, " stageEditorPasswordPhraseHint1: "(This is the text that a player has to say to complete the objective)" stageEditorPasswordPhraseHint2: "If you want multiple password phrases, separate them by a | (pipe)" -stageEditorObjectiveOverridePrompt: "Enter objective display override, or 'clear' to clear the override, " +stageEditorObjectiveOverridePrompt: "Enter objective display override, , " stageEditorObjectiveOverrideHint: "(This override will display your own text as the objective)" stageEditorObjectiveOverrideCleared: "Objective display override cleared." stageEditorDeliveryAddItem: "Add item" @@ -401,7 +401,7 @@ eventEditorNoEffects: "No effects set" eventEditorMustAddEffects: "You must add effects first!" eventEditorInvalidEffect: "is not a valid effect name!" eventEditorEffectsCleared: "Event effects cleared." -eventEditorEffectLocationPrompt: "Right-click on a block to play an effect at, then enter 'add' to add it to the list, " +eventEditorEffectLocationPrompt: "Right-click on a block to play an effect at, , " eventEditorMobSpawns: "Event Mob Spawns" eventEditorAddMobTypes: "Add mob" eventEditorNoTypesSet: "(No type set)" @@ -440,14 +440,14 @@ eventEditorPotionsCleared: "Potion effects cleared." eventEditorInvalidPotionType: "is not a valid potion effect type!" eventEditorEnterNPCId: "Enter NPC ID (or -1 to cancel)" eventEditorNoNPCExists: "No NPC exists with that id!" -eventEditorLightningPrompt: "Right-click on a block to spawn a lightning strike at, then enter 'add' to add it to the list, or enter 'clear' to clear the locations list, " -eventEditorExplosionPrompt: "Right-click on a block to spawn an explosion at, then enter 'add' to add it to the list, or enter 'clear' to clear the explosions list, " +eventEditorLightningPrompt: "Right-click on a block to spawn a lightning strike at, , , " +eventEditorExplosionPrompt: "Right-click on a block to spawn an explosion at, , , " eventEditorSelectBlockFirst: "You must select a block first." eventEditorSetMessagePrompt: "Enter message, or enter 'none' to delete, ()" eventEditorSetMobTypesPrompt: "Enter mob name, " eventEditorSetMobAmountsPrompt: "Enter mob amount, " eventEditorSetMobNamePrompt: "Enter the name for this mob, " -eventEditorSetMobLocationPrompt: "Right-click on a block to select it, then enter 'add' to add it to the mob spawn location list, " +eventEditorSetMobLocationPrompt: "Right-click on a block to select it, , " eventEditorSetPotionEffectsPrompt: "Enter potion effect types separating each one by a space, " eventEditorSetPotionDurationsPrompt: "Enter effect durations (in milliseconds) separating each one by a space, " eventEditorSetPotionMagnitudesPrompt: "Enter potion effect magnitudes separating each one by a space, " @@ -457,9 +457,9 @@ eventEditorSetSaturationPrompt: "Enter saturation level, or -1 to clear" eventEditorSaturationLevelAtLeastZero: "Saturation level must be at least 0!" eventEditorSetHealthPrompt: "Enter health level, or -1 to clear" eventEditorHealthLevelAtLeastZero: "Health level must be at least 0!" -eventEditorSetTeleportPrompt: "Right-click on a block to teleport the player to, then enter 'done' to finish, or enter 'clear' to clear the teleport location, " +eventEditorSetTeleportPrompt: "Right-click on a block to teleport the player to, , , " eventEditorCommandsNote: "Note: You may use to refer to the player's name." -eventEditorSetCommandsPrompt: "Enter commands separating each one by a comma, or enter 'clear' to clear the list, " +eventEditorSetCommandsPrompt: "Enter commands separating each one by a comma, , " reqSetMoney: "Set money requirement" reqSetQuestPoints: "Set Quest Points requirement" reqSetItem: "Set item requirements" @@ -477,14 +477,14 @@ reqHeroesSetSecondary: "Set Secondary Class" reqMoneyPrompt: "Enter amount of , or 0 to clear the money requirement, or -1 to cancel" reqQuestPointsPrompt: "Enter amount of Quest Points, or 0 to clear the Quest Point requirement, or -1 to cancel" reqQuestListTitle: "- Quests Available -" -reqQuestPrompt: "Enter a list of Quest names separating each one by a , or enter 'clear' to clear the list, " +reqQuestPrompt: "Enter a list of Quest names separating each one by a , , " reqRemoveItemsPrompt: "Enter a list of true/false values, separating each one by a space, " -reqPermissionsPrompt: "Enter permission requirements separating each one by a space, or enter 'clear' to clear the list, " -reqCustomPrompt: "Enter the name of a custom requirement to add, or enter 'clear' to clear all custom requirements, " -reqMcMMOPrompt: "Enter mcMMO skills, separating each one by a space, or enter 'clear' to clear the list, " -reqMcMMOAmountsPrompt: "Enter mcMMO skill amounts, separating each one by a space, or enter 'clear' to clear the list, " -reqHeroesPrimaryPrompt: "Enter a Heroes Primary Class name, or enter 'clear' to clear the requirement, " -reqHeroesSecondaryPrompt: "Enter a Heroes Secondary Class name, or enter 'clear' to clear the requirement, " +reqPermissionsPrompt: "Enter permission requirements separating each one by a space, , " +reqCustomPrompt: "Enter the name of a custom requirement to add, , " +reqMcMMOPrompt: "Enter mcMMO skills, separating each one by a space, , " +reqMcMMOAmountsPrompt: "Enter mcMMO skill amounts, separating each one by a space, , " +reqHeroesPrimaryPrompt: "Enter a Heroes Primary Class name, , " +reqHeroesSecondaryPrompt: "Enter a Heroes Secondary Class name, , " reqFailMessagePrompt: "Enter fail requirements message, " reqAddItem: "Add item" reqSetRemoveItems: "Set remove items" @@ -528,16 +528,16 @@ rewSetHeroesClasses: "Set classes" rewSetHeroesAmounts: "Set experience amounts" rewMoneyPrompt: "Enter amount of , or 0 to clear the money reward, or -1 to cancel" rewExperiencePrompt: "Enter amount of experience, or 0 to clear the experience reward, or -1 to cancel" -rewCommandPrompt: "Enter command rewards separating each one by a , or enter 'clear' to clear the list, " +rewCommandPrompt: "Enter command rewards separating each one by a , , " rewCommandPromptHint: 'Note: You may put to specify the player who completed the Quest. e.g. smite ' -rewPermissionsPrompt: "Enter permission rewards separating each one by a space, or enter 'clear' to clear the list, " +rewPermissionsPrompt: "Enter permission rewards separating each one by a space, , " rewQuestPointsPrompt: "Enter amount of Quest Points, or 0 to clear the Quest Point reward, or -1 to cancel" rewMcMMOPrompt: "Enter mcMMO skills, separating each one by a space, " rewMcMMOPromptHint: "Note: Typing 'All' will give levels to all skills." rewHeroesClassesPrompt: "Enter Heroes classes separating each one by a space, " rewHeroesExperiencePrompt: "Enter experience amounts (numbers, decimals are allowed) separating each one by a space, " -rewPhatLootsPrompt: "Enter PhatLoots separating each one by a space, or enter 'clear' to clear the list, " -rewCustomRewardPrompt: "Enter the name of a custom reward to add, or enter 'clear' to clear all custom rewards, " +rewPhatLootsPrompt: "Enter PhatLoots separating each one by a space, , " +rewCustomRewardPrompt: "Enter the name of a custom reward to add, , " rewItemsCleared: "Item rewards cleared." rewNoMcMMOSkills: "No skills set" rewNoHeroesClasses: "No classes set" @@ -563,11 +563,11 @@ itemCreateSetDisplay: "Set display name" itemCreateSetLore: "Set lore" itemCreateEnterName: "Enter an item name, " itemCreateEnterAmount: "Enter item amount (max. 64), " -itemCreateEnterDurab: "Enter item durability, or 'clear' to clear the data, " -itemCreateEnterEnch: "Enter an enchantment name, or 'clear' to clear the enchantments, " +itemCreateEnterDurab: "Enter item durability, , " +itemCreateEnterEnch: "Enter an enchantment name, , " itemCreateEnterLevel: "Enter a level (number) for " -itemCreateEnterDisplay: "Enter item display name, or 'clear' to clear the display name, " -itemCreateEnterLore: "Enter item lore, separating each line by a semi-colon ; or 'clear' to clear the lore, " +itemCreateEnterDisplay: "Enter item display name, , " +itemCreateEnterLore: "Enter item lore, separating each line by a semi-colon, , " itemCreateLoaded: "Item loaded." itemCreateNoItem: "No item in hand!" itemCreateNoName: "You must set a name first!" @@ -636,19 +636,21 @@ effGhastShriek: "Sound of a Ghast shrieking" effZombieWood: "Sound of a Zombie chewing an iron door" effZombieIron: "Sound of a Zombie chewing a wooden door" effEnterName: "Enter an effect name to add it to the list, " +cmdAdd: "add" +strAdd: "then enter '' to include it" +cmdClear: "clear" +strClear: "or '' to erase all data" cmdCancel: "cancel" strCancel: "or '' to return" -cmdAdd: "add" -cmdClear: "clear" -cmdNone: "none" cmdDone: "done" +strDone: "then enter '' to save" acceptQuest: "Accept Quest?" enterAnOption: "Enter an option" questAccepted: 'Quest accepted: ' currentQuest: "Current Quests:" noMoreQuest: "No more quests available." -damage: "Damage" break: "Break" +damage: "Damage" place: "Place" use: "Use" cut: "Cut"