Skip to content

Commit

Permalink
Read mission dialogue as translation objects
Browse files Browse the repository at this point in the history
Rather than a simple string, read these entries as translation objects.
This has the advantage that they are checked for correct text styling.
  • Loading branch information
jbytheway committed Jan 1, 2020
1 parent 33d5e49 commit f76a1d9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/mission.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ std::string mission::dialogue_for_topic( const std::string &in_topic ) const

const auto &response = type->dialogue.find( topic );
if( response != type->dialogue.end() ) {
return _( response->second );
return response->second.translated();
}

return string_format( "Someone forgot to code this message id is %s, topic is %s!",
Expand Down
2 changes: 1 addition & 1 deletion src/mission.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ struct mission_type {
std::function<void( mission * )> end = mission_end::standard;
std::function<void( mission * )> fail = mission_fail::standard;

std::map<std::string, std::string> dialogue;
std::map<std::string, translation> dialogue;

// A dynamic goal condition invoked by MGOAL_CONDITION.
std::function<bool( const mission_goal_condition_context & )> goal_condition;
Expand Down

0 comments on commit f76a1d9

Please sign in to comment.