TSAGE: Added R2R conversation dialog text and removal code

This commit is contained in:
Paul Gilbert
2013-07-28 10:35:56 -04:00
parent 28b8537530
commit 8320a556d4
2 changed files with 37 additions and 7 deletions
+36 -7
View File
@@ -429,10 +429,12 @@ int ConversationChoiceDialog::execute(const Common::StringArray &choiceList) {
// Set up the list of choices
int yp = 0;
int xp = (g_vm->getGameID() == GType_Ringworld2) ? 40 : 25;
for (uint idx = 0; idx < choiceList.size(); ++idx) {
Rect tempRect;
_gfxManager._font.getStringBounds(choiceList[idx].c_str(), tempRect, 265);
tempRect.moveTo(25, yp + 10);
tempRect.moveTo(xp, yp + 10);
_choiceList.push_back(ChoiceEntry(choiceList[idx], tempRect));
yp += tempRect.height() + 5;
@@ -537,6 +539,18 @@ void ConversationChoiceDialog::draw() {
_gfxManager.deactivate();
}
void ConversationChoiceDialog::remove() {
if (_savedArea) {
// Restore the area the dialog covered
Rect tempRect = _bounds;
tempRect.collapse(-10, -10);
g_globals->_gfxManagerInstance.copyFrom(*_savedArea, tempRect.left, tempRect.top);
delete _savedArea;
_savedArea = NULL;
}
}
/*--------------------------------------------------------------------------*/
void Obj44::load(const byte *dataP) {
@@ -891,13 +905,26 @@ void StripManager::signal() {
if (g_vm->getGameID() == GType_Ringworld2) {
Ringworld2::VisualSpeaker *speaker = static_cast<Ringworld2::VisualSpeaker *>(_activeSpeaker);
speaker->_speakerMode = obj44._speakerMode;
if (_obj44List.size() > 0)
speaker->proc15();
}
if (speaker) {
speaker->_speakerMode = obj44._speakerMode;
if (choiceList[strIndex].empty())
speaker->proc15();
}
_textShown = true;
_activeSpeaker->setText(choiceList[strIndex]);
if (!choiceList[strIndex].empty()) {
_textShown = true;
_activeSpeaker->setText(choiceList[strIndex]);
} else if (!obj44._speakerMode) {
_delayFrames = 1;
} else {
_delayFrames = 0;
speaker->proc15();
}
} else {
_textShown = true;
_activeSpeaker->setText(choiceList[strIndex]);
}
}
_obj44Index = getNewIndex(obj44._list[strIndex]._id);
@@ -965,6 +992,8 @@ Speaker *StripManager::getSpeaker(const char *speakerName) {
int StripManager::getNewIndex(int id) {
if (id == 10000)
return id;
if ((g_vm->getGameID() == GType_Ringworld2) && (id < 0))
return id;
for (uint idx = 0; idx < _obj44List.size(); ++idx) {
if (_obj44List[idx]._id == id) {
+1
View File
@@ -164,6 +164,7 @@ public:
int execute(const Common::StringArray &choiceList);
virtual void draw();
virtual void remove();
};
class Obj0A : public Serialisable {