Issue #107: fixed up some interfaces

This commit is contained in:
Marc Zinnschlag 2012-08-09 09:41:17 +02:00
parent 28ecfb4290
commit e6ede480c7
2 changed files with 14 additions and 14 deletions

View file

@ -599,7 +599,7 @@ namespace MWDialogue
} }
} }
void DialogueManager::addTopic(std::string topic) void DialogueManager::addTopic (const std::string& topic)
{ {
mKnownTopics[toLower(topic)] = true; mKnownTopics[toLower(topic)] = true;
} }
@ -804,7 +804,7 @@ namespace MWDialogue
mChoice = choice; mChoice = choice;
} }
void DialogueManager::keywordSelected(std::string keyword) void DialogueManager::keywordSelected (const std::string& keyword)
{ {
if(!mIsInChoice) if(!mIsInChoice)
{ {
@ -846,11 +846,11 @@ namespace MWDialogue
MWBase::Environment::get().getWindowManager()->removeGuiMode(MWGui::GM_Dialogue); MWBase::Environment::get().getWindowManager()->removeGuiMode(MWGui::GM_Dialogue);
} }
void DialogueManager::questionAnswered(std::string answere) void DialogueManager::questionAnswered (const std::string& answer)
{ {
if(mChoiceMap.find(answere) != mChoiceMap.end()) if(mChoiceMap.find(answer) != mChoiceMap.end())
{ {
mChoice = mChoiceMap[answere]; mChoice = mChoiceMap[answer];
std::vector<ESM::DialInfo>::const_iterator iter; std::vector<ESM::DialInfo>::const_iterator iter;
if(mDialogueMap.find(mLastTopic) != mDialogueMap.end()) if(mDialogueMap.find(mLastTopic) != mDialogueMap.end())
@ -888,7 +888,7 @@ namespace MWDialogue
win->addText(error); win->addText(error);
} }
void DialogueManager::askQuestion(std::string question, int choice) void DialogueManager::askQuestion (const std::string& question, int choice)
{ {
MWGui::DialogueWindow* win = MWBase::Environment::get().getWindowManager()->getDialogueWindow(); MWGui::DialogueWindow* win = MWBase::Environment::get().getWindowManager()->getDialogueWindow();
win->askQuestion(question); win->askQuestion(question);
@ -896,7 +896,7 @@ namespace MWDialogue
mIsInChoice = true; mIsInChoice = true;
} }
std::string DialogueManager::getFaction() std::string DialogueManager::getFaction() const
{ {
if (mActor.getTypeName() != typeid(ESM::NPC).name()) if (mActor.getTypeName() != typeid(ESM::NPC).name())
return ""; return "";

View file

@ -52,19 +52,19 @@ namespace MWDialogue
void startDialogue (const MWWorld::Ptr& actor); void startDialogue (const MWWorld::Ptr& actor);
void addTopic(std::string topic); void addTopic (const std::string& topic);
void askQuestion(std::string question,int choice); void askQuestion (const std::string& question,int choice);
void goodbye(); void goodbye();
///get the faction of the actor you are talking with ///get the faction of the actor you are talking with
std::string getFaction(); std::string getFaction() const;
//calbacks for the GUI //calbacks for the GUI
void keywordSelected(std::string keyword); void keywordSelected (const std::string& keyword);
void goodbyeSelected(); void goodbyeSelected();
void questionAnswered(std::string answere); void questionAnswered (const std::string& answer);
}; };
} }