Skip to content

Commit

Permalink
Merged PR 510: Merge 609_component_selector_formatting to master
Browse files Browse the repository at this point in the history
Related work items: #609
  • Loading branch information
Allen B. Cummings committed May 31, 2019
1 parent 3a26d49 commit 567846f
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 45 deletions.
10 changes: 0 additions & 10 deletions README

This file was deleted.

2 changes: 1 addition & 1 deletion modules/crafting/componentSelector.c
Expand Up @@ -199,7 +199,7 @@ protected nomask string additionalInstructions()
configuration->decorate(" denotes a selected material.\n", "details", configuration->decorate(" denotes a selected material.\n", "details",
"selector", colorConfiguration) + "selector", colorConfiguration) +
configuration->decorate((User->charsetConfiguration() == "unicode") ? configuration->decorate((User->charsetConfiguration() == "unicode") ?
" (\xe2\x80\xa0)" : "(*)", "selected", "selector", colorConfiguration) + "(\xe2\x80\xa0)" : "(*)", "selected", "selector", colorConfiguration) +
configuration->decorate(" denotes that a specific component type has been chosen.\n", configuration->decorate(" denotes that a specific component type has been chosen.\n",
"details", "selector", colorConfiguration); "details", "selector", colorConfiguration);
} }
8 changes: 4 additions & 4 deletions modules/crafting/selectMaterialsSelector.c
Expand Up @@ -91,9 +91,9 @@ private nomask string getDescription()
"information", "selector", colorConfiguration); "information", "selector", colorConfiguration);
} }
} }
return sprintf("From this menu, you will select the\ncomponents that " return regreplace(format(sprintf("%s - From this menu, you will select the components that "
"will be used to craft your %s. The relative statistics\nfor the item " "will be used to craft your %s. The relative statistics for the item "
"you are creating are:", CraftingItem) + ret; "you are creating are:", Type, CraftingItem), 78), (Type + " - "), "") + ret;
} }


///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
Expand All @@ -106,8 +106,8 @@ protected nomask void setUpUserForSelection()
} }
getItemToCraft(); getItemToCraft();


Description = getDescription();
Type = "Craft " + capitalize(CraftingItem); Type = "Craft " + capitalize(CraftingItem);
Description = getDescription();


Data = Dictionary->getCraftingDataForItem(CraftingType, CraftingItem, User); Data = Dictionary->getCraftingDataForItem(CraftingType, CraftingItem, User);


Expand Down
12 changes: 6 additions & 6 deletions tests/modules/crafting/craftArmorTest.c
Expand Up @@ -81,9 +81,9 @@ void ChoosingRobesDisplaysRobesMenu()
command("2", Player); command("2", Player);
command("7", Player); command("7", Player);


ExpectEq("\x1b[0;36mCraft Robes - \x1b[0m\x1b[0;37;1mFrom this menu, you will select the\n" ExpectEq("\x1b[0;36mCraft Robes - \x1b[0m\x1b[0;37;1mFrom this menu, you "
"components that will be used to craft your robes. The relative statistics\n" "will select the components that will be used\nto craft your robes. "
"for the item you are creating are:\n" "The relative statistics for the item you are creating\nare:\n\n"
"\x1b[0m\x1b[0;36m\tMaterial: \x1b[0;31mnone selected\x1b[0m\n" "\x1b[0m\x1b[0;36m\tMaterial: \x1b[0;31mnone selected\x1b[0m\n"
"\x1b[0;36m\tDamage Protection: \x1b[0m\x1b[0;33m1\x1b[0m\n" "\x1b[0;36m\tDamage Protection: \x1b[0m\x1b[0;33m1\x1b[0m\n"
"\x1b[0;36m\tEncumberance: \x1b[0m\x1b[0;33m6\x1b[0m\n" "\x1b[0;36m\tEncumberance: \x1b[0m\x1b[0;33m6\x1b[0m\n"
Expand Down Expand Up @@ -128,9 +128,9 @@ void SelectingMaterialUpdatesRobesMenu()
command("1", Player); command("1", Player);
command("17", Player); command("17", Player);


ExpectEq("\x1b[0;36mCraft Robes - \x1b[0m\x1b[0;37;1mFrom this menu, you will select the\n" ExpectEq("\x1b[0;36mCraft Robes - \x1b[0m\x1b[0;37;1mFrom this menu, you "
"components that will be used to craft your robes. The relative statistics\n" "will select the components that will be used\nto craft your robes. "
"for the item you are creating are:\n" "The relative statistics for the item you are creating\nare:\n\n"
"\x1b[0m\x1b[0;36m\tMaterial: \x1b[0m\x1b[0;33mSilk\x1b[0m\n" "\x1b[0m\x1b[0;36m\tMaterial: \x1b[0m\x1b[0;33mSilk\x1b[0m\n"
"\x1b[0;36m\tDamage Protection: \x1b[0m\x1b[0;33m2\x1b[0m\n" "\x1b[0;36m\tDamage Protection: \x1b[0m\x1b[0;33m2\x1b[0m\n"
"\x1b[0;36m\tEncumberance: \x1b[0m\x1b[0;33m5\x1b[0m\n" "\x1b[0;36m\tEncumberance: \x1b[0m\x1b[0;33m5\x1b[0m\n"
Expand Down
6 changes: 3 additions & 3 deletions tests/modules/crafting/craftHelmetTest.c
Expand Up @@ -118,9 +118,9 @@ void ChoosingHelmDisplaysHelmMenu()
command("1", Player); command("1", Player);
command("13", Player); command("13", Player);


ExpectEq("Craft Helm - From this menu, you will select the\n" ExpectEq("Craft Helm - From this menu, you will select the components "
"components that will be used to craft your helm. The relative statistics\n" "that will be used\nto craft your helm. The relative statistics "
"for the item you are creating are:\n" "for the item you are creating are:\n\n"
"\tMaterial: none selected\n" "\tMaterial: none selected\n"
"\tWeight: 1\n" "\tWeight: 1\n"
"\n" "\n"
Expand Down
18 changes: 9 additions & 9 deletions tests/modules/crafting/craftJewelryTest.c
Expand Up @@ -111,9 +111,9 @@ void ChoosingRingDisplaysRingMenu()
command("1", Player); command("1", Player);
command("16", Player); command("16", Player);


ExpectEq("\x1b[0;36mCraft Ring - \x1b[0m\x1b[0;37;1mFrom this menu, you will select the\n" ExpectEq("\x1b[0;36mCraft Ring - \x1b[0m\x1b[0;37;1mFrom this menu, you "
"components that will be used to craft your ring. The relative statistics\n" "will select the components that will be used\nto craft your ring. "
"for the item you are creating are:\n" "The relative statistics for the item you are creating are:\n\n"
"\x1b[0m\x1b[0;36m\tMaterial: \x1b[0;31mnone selected\x1b[0m\n\x1b[0m\n" "\x1b[0m\x1b[0;36m\tMaterial: \x1b[0;31mnone selected\x1b[0m\n\x1b[0m\n"
"\t[\x1b[0;31;1m1\x1b[0m] - \x1b[0;32mSelect Metal \x1b[0m\n" "\t[\x1b[0;31;1m1\x1b[0m] - \x1b[0;32mSelect Metal \x1b[0m\n"
"\t[\x1b[0;31;1m2\x1b[0m] - \x1b[0;32mSelect Ring design \x1b[0m\n" "\t[\x1b[0;31;1m2\x1b[0m] - \x1b[0;32mSelect Ring design \x1b[0m\n"
Expand Down Expand Up @@ -153,9 +153,9 @@ void SelectingMaterialUpdatesRingMenu()
command("1", Player); command("1", Player);
command("1", Player); command("1", Player);


ExpectEq("\x1b[0;36mCraft Ring - \x1b[0m\x1b[0;37;1mFrom this menu, you will select the\n" ExpectEq("\x1b[0;36mCraft Ring - \x1b[0m\x1b[0;37;1mFrom this menu, you "
"components that will be used to craft your ring. The relative statistics\n" "will select the components that will be used\nto craft your ring. "
"for the item you are creating are:\n" "The relative statistics for the item you are creating are:\n\n"
"\x1b[0m\x1b[0;36m\tMaterial: \x1b[0m\x1b[0;33mAdmantite\x1b[0m\n\x1b[0m\n" "\x1b[0m\x1b[0;36m\tMaterial: \x1b[0m\x1b[0;33mAdmantite\x1b[0m\n\x1b[0m\n"
"\t[\x1b[0;31;1m1\x1b[0m] - \x1b[0;32mSelect Metal \x1b[0m\x1b[0;34;1m (*)\x1b[0m\n" "\t[\x1b[0;31;1m1\x1b[0m] - \x1b[0;32mSelect Metal \x1b[0m\x1b[0;34;1m (*)\x1b[0m\n"
"\t[\x1b[0;31;1m2\x1b[0m] - \x1b[0;32mSelect Ring design \x1b[0m\n" "\t[\x1b[0;31;1m2\x1b[0m] - \x1b[0;32mSelect Ring design \x1b[0m\n"
Expand All @@ -181,9 +181,9 @@ void CanAddComponentThatDoesNotModifyMaterials()
command("10", Player); command("10", Player);
command("19", Player); command("19", Player);


ExpectEq("\x1b[0;36mCraft Ring - \x1b[0m\x1b[0;37;1mFrom this menu, you will select the\n" ExpectEq("\x1b[0;36mCraft Ring - \x1b[0m\x1b[0;37;1mFrom this menu, you "
"components that will be used to craft your ring. The relative statistics\n" "will select the components that will be used\nto craft your ring. "
"for the item you are creating are:\n" "The relative statistics for the item you are creating are:\n\n"
"\x1b[0m\x1b[0;36m\tMaterial: \x1b[0;31mnone selected\x1b[0m\n\x1b[0m\n" "\x1b[0m\x1b[0;36m\tMaterial: \x1b[0;31mnone selected\x1b[0m\n\x1b[0m\n"
"\t[\x1b[0;31;1m1\x1b[0m] - \x1b[0;32mSelect Metal \x1b[0m\n" "\t[\x1b[0;31;1m1\x1b[0m] - \x1b[0;32mSelect Metal \x1b[0m\n"
"\t[\x1b[0;31;1m2\x1b[0m] - \x1b[0;32mSelect Ring design \x1b[0m\x1b[0;34;1m (*)\x1b[0m\n" "\t[\x1b[0;31;1m2\x1b[0m] - \x1b[0;32mSelect Ring design \x1b[0m\x1b[0;34;1m (*)\x1b[0m\n"
Expand Down
24 changes: 12 additions & 12 deletions tests/modules/crafting/weaponComponentSelectorTest.c
Expand Up @@ -78,9 +78,9 @@ void SpecificWeaponMenuDisplaysCorrectly()
{ {
Selector->initiateSelector(Player); Selector->initiateSelector(Player);


ExpectEq("\x1b[0;36mCraft Long sword - \x1b[0m\x1b[0;37;1mFrom this menu, you will select the\n" ExpectEq("\x1b[0;36mCraft Long sword - \x1b[0m\x1b[0;37;1mFrom this menu, "
"components that will be used to craft your long sword. The relative statistics\n" "you will select the components that will be\nused to craft your long "
"for the item you are creating are:\n" "sword. The relative statistics for the item you are\ncreating are:\n\n"
"\x1b[0m\x1b[0;36m\tMaterial: \x1b[0;31mnone selected\x1b[0m\n" "\x1b[0m\x1b[0;36m\tMaterial: \x1b[0;31mnone selected\x1b[0m\n"
"\x1b[0;36m\tAttack: \x1b[0m\x1b[0;33m5\x1b[0m\x1b[0;33m to 105\x1b[0m\n" "\x1b[0;36m\tAttack: \x1b[0m\x1b[0;33m5\x1b[0m\x1b[0;33m to 105\x1b[0m\n"
"\x1b[0;36m\tDamage: \x1b[0m\x1b[0;33m7\x1b[0m\x1b[0;33m to 10\x1b[0m\n" "\x1b[0;36m\tDamage: \x1b[0m\x1b[0;33m7\x1b[0m\x1b[0;33m to 10\x1b[0m\n"
Expand Down Expand Up @@ -311,9 +311,9 @@ void CancelDoesNotSetValuesForWeaponCraftingMenu()
command("6", Player); command("6", Player);
command("26", Player); command("26", Player);


ExpectEq("\x1b[0;36mCraft Long sword - \x1b[0m\x1b[0;37;1mFrom this menu, you will select the\n" ExpectEq("\x1b[0;36mCraft Long sword - \x1b[0m\x1b[0;37;1mFrom this menu, "
"components that will be used to craft your long sword. The relative statistics\n" "you will select the components that will be\nused to craft your long "
"for the item you are creating are:\n" "sword. The relative statistics for the item you are\ncreating are:\n\n"
"\x1b[0m\x1b[0;36m\tMaterial: \x1b[0;31mnone selected\x1b[0m\n" "\x1b[0m\x1b[0;36m\tMaterial: \x1b[0;31mnone selected\x1b[0m\n"
"\x1b[0;36m\tAttack: \x1b[0m\x1b[0;33m5\x1b[0m\x1b[0;33m to 105\x1b[0m\n" "\x1b[0;36m\tAttack: \x1b[0m\x1b[0;33m5\x1b[0m\x1b[0;33m to 105\x1b[0m\n"
"\x1b[0;36m\tDamage: \x1b[0m\x1b[0;33m7\x1b[0m\x1b[0;33m to 10\x1b[0m\n" "\x1b[0;36m\tDamage: \x1b[0m\x1b[0;33m7\x1b[0m\x1b[0;33m to 10\x1b[0m\n"
Expand Down Expand Up @@ -352,9 +352,9 @@ void ConfirmSetsValuesForWeaponCraftingMenu()
command("6", Player); command("6", Player);
command("25", Player); command("25", Player);


ExpectEq("\x1b[0;36mCraft Long sword - \x1b[0m\x1b[0;37;1mFrom this menu, you will select the\n" ExpectEq("\x1b[0;36mCraft Long sword - \x1b[0m\x1b[0;37;1mFrom this menu, "
"components that will be used to craft your long sword. The relative statistics\n" "you will select the components that will be\nused to craft your long "
"for the item you are creating are:\n" "sword. The relative statistics for the item you are\ncreating are:\n\n"
"\x1b[0m\x1b[0;36m\tMaterial: \x1b[0m\x1b[0;33mAdmantite\x1b[0m\n" "\x1b[0m\x1b[0;36m\tMaterial: \x1b[0m\x1b[0;33mAdmantite\x1b[0m\n"
"\x1b[0;36m\tAttack: \x1b[0m\x1b[0;33m8\x1b[0m\x1b[0;33m to 108\x1b[0m\n" "\x1b[0;36m\tAttack: \x1b[0m\x1b[0;33m8\x1b[0m\x1b[0;33m to 108\x1b[0m\n"
"\x1b[0;36m\tDamage: \x1b[0m\x1b[0;33m12\x1b[0m\x1b[0;33m to 15\x1b[0m\x1b[0;31m [+2 magical]\x1b[0m\n" "\x1b[0;36m\tDamage: \x1b[0m\x1b[0;33m12\x1b[0m\x1b[0;33m to 15\x1b[0m\x1b[0;31m [+2 magical]\x1b[0m\n"
Expand Down Expand Up @@ -632,9 +632,9 @@ void TurningOffColorDisplaysCorrectly()
Player->colorConfiguration("none"); Player->colorConfiguration("none");
Selector->initiateSelector(Player); Selector->initiateSelector(Player);


ExpectEq("Craft Long sword - From this menu, you will select the\n" ExpectEq("Craft Long sword - From this menu, you will select the components "
"components that will be used to craft your long sword. The relative statistics\n" "that will be\nused to craft your long sword. The relative statistics "
"for the item you are creating are:\n" "for the item you are\ncreating are:\n\n"
"\tMaterial: none selected\n" "\tMaterial: none selected\n"
"\tAttack: 5 to 105\n" "\tAttack: 5 to 105\n"
"\tDamage: 7 to 10\n" "\tDamage: 7 to 10\n"
Expand Down

0 comments on commit 567846f

Please sign in to comment.