clintbellanger / flare

Free Libre Action Roleplaying Engine
http://clintbellanger.net/rpg/
GNU General Public License v3.0
167 stars 41 forks source link

Put all internal strings into a configuration file #111

Closed pennomi closed 13 years ago

pennomi commented 13 years ago

Here's my inventory of the internal strings currently in FLARE. This config file will be called messages.txt

Clint, please review this list to make sure that the message naming scheme is how you want it. It is easiest to change right before converting all of the code.

Also, we need to find the appropriate place to put the variable (map) that will hold all these values.

# Note: Pay attention to spacing here. The internal spaces have been
#       taken out to accomodate variations in languages.
#       You will need to manually provide the spaces in this file.

# CHARACTER (Avatar.cpp)
death=You are defeated.  You lose half your gold.  Press Enter to continue.
level_up_begin=Congratulations, you have reached level 
level_up_end=!
attribute_increase= You may increase one attribute through the Character Menu.

# REWARDS (CampaignManager.cpp)
reward_item_begin=You receive 
reward_item_end=.
reward_currency_begin=You receive 
reward_currency_end= gold.
reward_xp_begin=You receive 
reward_xp_end= XP.

# LOADING SCREEN (GameStateLoad.cpp)
delete_save_button=Delete Save
delete_save_dialog=Delete this save
exit_button=Exit to Title
choose_slot_button=Choose a Slot
new_game_button=New Game
load_game_button=Load Game
loading_game_status=Loading saved game...
entering_game_status=Entering game world...
character_level=Level 
empty_slot=Empty Slot

# NEW GAME SCREEN (GameStateNew.cpp)
cancel_button=Cancel
create_button=Create Character
choose_portrait=Choose a Portrait
choose_name=Choose a Name

# PLAY MESSAGES (GameStatePlay.cpp)
inventory_full=Inventory is full.

# TITLE SCREEN (GameStateTitle.cpp)
play_button=Play Game
exit_button=Exit Game
version_number=Flare Alpha v0.14.1 dev

# ITEMS (ItemDatabase.cpp)
type_main=Main Hand
type_body=Body
type_off=Off Hand
type_artifact=Artifact
type_consumable=Consumable
type_gem=Gem
type_quest=Quest Item
damage_melee=Melee
damage_ranged=Ranged
damage_mental=Mental
damage_end= damage: 
stat_absorb=Absorb: 
stat_bonus=Increases 
stat_malus=Decreases 
stat_by= by 
requirement_physical=Requires Physical 
requirement_mental=Requires Mental 
requirement_offense=Requires Offense 
requirement_defense=Requires Defense 
buy_price=Buy Price: 
sell_price=Sell Price: 
currency_lowercase= gold
each= each

# ITEMS, CONTINUED (LootManager.cpp)
currency= Gold

# GENERAL GAME (main.cpp)
window_title=Flare

# ACTION BAR (MenuActionBar.cpp)
character_tooltip=Character Menu (C)
inventory_tooltip=Inventory Menu (I)
power_tooltip=Power Menu (P)
log_tooltip=Log Menu (L)

# CHARACTER MENU (MenuCharacter.cpp)
character=Character
name=Name
level=Level
physical=Physical
mental=Mental
offense=Offense
defense=Defense
total_hp=Total HP
regen=Regen
total_mp=Total MP
#regen=Regen
accuracy_vs_def_1=Accuracy vs. Def 1
vs_def_5=vs. Def 5
avoidance_vs_off_1=Avoidance vs. Off 1
vs_off_5=vs. Off 5
main_weapon=Main Weapon
ranged_weapon=Ranged Weapon
crit_chance=Crit Chance
absorb=Absorb
fire_resist=Fire Resist
ice_resist=Ice Resist
physical_description=Physical (P) increases melee weapon proficiency and total HP.
mental_description=Mental (M) increases mental weapon proficiency and total MP.
offense_description=Offense (O) increases ranged weapon proficiency and accuracy.
defense_description=Defense (D) increases armor proficiency and avoidance.
stat_display_start=base (
stat_display_middle=), bonus (
stat_display_end=)
requires_physical=Requires Physical 
requires_mental=Requires Mental 
requires_offense=Requires Offense 
requires_defense=Requires Defense 
physical_2_proficiency=Dagger Proficiency
physical_3_proficiency=Shortsword Proficiency
physical_4_proficiency=Longsword Proficiency
physical_5_proficiency=Greatsword Proficiency
mental_2_proficiency=Wand Proficiency
mental_3_proficiency=Rod Proficiency
mental_4_proficiency=Staff Proficiency
mental_5_proficiency=Greatstaff Proficiency
offense_2_proficiency=Slingshot Proficiency
offense_3_proficiency=Shortbow Proficiency
offense_4_proficiency=Longbow Proficiency
offense_5_proficiency=Greatbow Proficiency
defense_2_proficiency=Light Armor Proficiency
defense_3_proficiency=Light Shield Proficiency
defense_4_proficiency=Heavy Armor Proficiency
defense_5_proficiency=Heavy Shield Proficiency
physical_hp_bonus=Each point of Physical grants +8 HP
level_hp_bonus=Each level grants +2 HP
hp_regen_description=Ticks of HP regen per minute
physical_hp_regen_bonus=Each point of Physical grants +4 HP regen
level_hp_regen_bonus=Each level grants +1 HP regen
mental_mp_bonus=Each point of Mental grants +8 MP
level_mp_bonus=Each level grants +2 MP
mp_regen_description=Ticks of MP regen per minute
mental_mp_regen_bonus=Each point of Mental grants +4 MP regen
level_mp_regen_bonus=Each level grants +1 MP regen
offense_accuracy_bonus=Each point of Offense grants +5 accuracy
level_accuracy_bonus=Each level grants +1 accuracy
defense_avoidance_bonus=Each point of Defense grants +5 avoidance
level_avoidance_bonus=Each level grants +1 avoidance

# ENEMIES (MenuEnemy.cpp)
enemy_level= level 
dead=Dead

# EXIT CONFIRM (MenuExit.cpp)
exit_dialog=Save and exit to title?

# INVENTORY MENU (MenuInventory.cpp)
inventory=Inventory
# type_main=Main Hand
# type_body=Body
# type_off=Off Hand
# type_artifact=Artifact
#currency= Gold
shift_tooltip=Use SHIFT to move only one item.
ctrl_tooltip=CTRL-click a carried item to sell it.
item_action_bar_only=This item can only be used from the action bar.

# LOG MENU (MenuLog.cpp)
messages_tab=Messages
quests_tab=Quests
achievements_tab=Achievements
statistics_tab=Statistics

# POWERS (MenuPowers.cpp)
powers=Powers
# physical=Physical
# mental=Mental
# offense=Offense
# defense=Defense
physical_offense_description=Physical + Offense grants melee and ranged attacks
physical_defense_description=Physical + Defense grants melee protection
mental_offense_description=Mental + Offense grants elemental spell attacks
mental_defense_description=Mental + Defense grants healing and magical protection
requires_physical_weapon=Requires a physical weapon
requires_mental_weapon=Requires a mental weapon
requires_offense_weapon=Requires an offense weapon
physical_offense=Physical Offense 
physical_defense=Physical Defense 
mental_offense=Mental Offense 
mental_defense=Mental Defense 
mp_cost_begin=Costs 
mp_cost_end= MP
cooldown_seconds_begin=Cooldown: 
cooldown_seconds_end= seconds

# VENDORS (MenuVendor.cpp)
vendor=Vendor

# CHARACTER CLASSES (StatBlock.cpp)
class_grand_master=Grand Master
class_master=Master
class_physical=Warrior
class_mental=Wizard
class_offense=Ranger
class_defense=Paladin
class_physical_offense=Rogue
class_physical_defense=Knight
class_mental_offense=Shaman
class_mental_defense=Cleric
class_physical_mental=Battle Mage
class_offense_defense=Heavy Archer
class_generic=Adventurer

# Phew! You made it!
clintbellanger commented 13 years ago

Some of this won't work as expected for all languages. Example:

buy_price=Buy Price: sell_price=Sell Price: currency_lowercase= gold each= each

Some languages will structure this phrase completely differently, so this might not be the right approach.

It might be better to do something like printf style:

buy_price_single = "Buy Price: %d gold" buy_price_multiple = "But Price: %d gold each"

That way it should be possible to handle any sentence structure?

It would be cool if e.g. "Physical" has to only be defined once and is applied through all these strings, but not sure if there's a way to do that without making a mess.

pennomi commented 13 years ago

Ah, I was thinking if that might be the best way, though I thought that it might cause the programming to be more difficult. Actually, I can see an easy way to do that now; thanks!

Have you figured out a good class to put this in? The only thing I can think of that is that far reaching is InputState (which doesn't make sense and still doesn't touch everything) and maybe Settings? Perhaps it's still better to just have a new class to handle it.

clintbellanger commented 13 years ago

Yeah I think this probably should be a new class.

pennomi commented 13 years ago

Oh, and on the "Physical only has to be defined once" thing, what if you had a small amount of markup, like %physical% which would take the "physical=Physical" tag and insert it into the string? So imagine:

physical=Physical
offense=Offense
physical_offense=%physical% %offense%

You still have the issue of capital "Physical" vs. lowercase "physical."

clintbellanger commented 13 years ago

I think we won't worry about getting that fancy, in case a game wants to define words differently in different places.

Example: Maybe you want to relabel "Physical" as "Strength" and Offense as "Agility". But then it'll sound clunky to say "Requires Strength Agility 5", so you might reword that phrase completely differently.

pennomi commented 13 years ago

Ah, good point. Okay, expect some large codebase changes soon. How does MessageEngine sound?

clintbellanger commented 13 years ago

Sounds good

clintbellanger commented 13 years ago

Great work, looks pretty much done for now. We may tweak some things as language situations arise, but this should be a killer start.