void pawsNpcDialogWindow::AdjustForPromptWindow() { csString str; for (size_t i=0; i<responseList->GetRowCount(); i++) { str = responseList->GetTextCellValue(i,0); size_t where = str.Find("?="); if (where != SIZET_NOT_FOUND) // we have a prompt choice { pawsTextBox *hidden = (pawsTextBox *)responseList->GetRow(i)->GetColumn(1); if (where != SIZET_NOT_FOUND) { str.DeleteAt(where,1); // take out the ? // Save the question prompt, starting with the =, in the hidden column hidden->SetText(str.GetData() + where); str.DeleteAt(where,1); // take out the = // now change the visible menu choice to something better pawsTextBox *prompt = (pawsTextBox *)responseList->GetRow(i)->GetColumn(0); csString menuPrompt(str); menuPrompt.Insert(where,"<Answer "); menuPrompt.Append('>'); prompt->SetText(menuPrompt); } } } }
void pawsNpcDialogWindow::AdjustForPromptWindow() { csString str; // This part is used only for menu npc dialogue for(size_t i=0; i<responseList->GetRowCount(); i++) { str = responseList->GetTextCellValue(i,0); size_t where = str.Find("?="); if(where != SIZET_NOT_FOUND) // we have a prompt choice { pawsTextBox* hidden = (pawsTextBox*)responseList->GetRow(i)->GetColumn(1); if(hidden) { csString id = "="; // compatibility with old servers. if(csString(hidden->GetText()).Find("{") != SIZET_NOT_FOUND) { id += hidden->GetText(); } str.DeleteAt(where,2); // take out the ?= id += str.GetData(); // Save the question prompt, starting with the =, in the hidden column hidden->SetText(id.GetData()); // now change the visible menu choice to something better pawsTextBox* prompt = (pawsTextBox*)responseList->GetRow(i)->GetColumn(0); csString menuPrompt(str); menuPrompt.Insert(where,"<Answer "); menuPrompt.Append('>'); prompt->SetText(menuPrompt); } } } // this part is used only with bubbles npc dialogue for(size_t i = 0 ; i < questInfo.GetSize(); i++) { QuestInfo &qi = questInfo[i]; str = qi.text; size_t where = str.Find("?="); if(where != SIZET_NOT_FOUND) { csString id = "="; // compatibility with old servers. if(qi.trig.Find("{") != SIZET_NOT_FOUND) { id += qi.trig; } str.DeleteAt(where,2); // take out the ?= id += str; // Save the question prompt, starting with the =, in the hidden column qi.trig = id; str.Insert(where,"I know the answer to : "); qi.text = str; } } }