KYRA: (EOB II/ZH) - fix party transfer dialog

This commit is contained in:
athrxx 2023-08-17 17:39:40 +02:00
parent 27a40d8334
commit 950eb9c881
9 changed files with 182 additions and 96 deletions

View File

@ -3631,7 +3631,7 @@ static const ResourceProvider resourceProviders[] = {
{ kEoBBaseFlightObjFlipIndex, kEoB2, kPlatformDOS, kTalkieVersion, UNK_LANG, &kEoB2FlightObjFlipIndexDOSProvider },
{ kEoBBaseFlightObjShpMap, kEoB2, kPlatformDOS, kTalkieVersion, UNK_LANG, &kEoB2FlightObjShpMapDOSProvider },
{ kEoBBaseFlightObjSclIndex, kEoB2, kPlatformDOS, kTalkieVersion, UNK_LANG, &kEoB2FlightObjSclIndexDOSProvider },
{ kEoB2TransferPortraitFrames, kEoB2, kPlatformDOS, kTalkieVersion, UNK_LANG, &kEoB2TransferPortraitFramesDOSProvider },
{ kEoB2TransferPortraitFrames, kEoB2, kPlatformDOS, kTalkieVersion, UNK_LANG, &kEoB2TransferPortraitFramesDOSChineseProvider },
{ kEoB2TransferConvertTable, kEoB2, kPlatformDOS, kTalkieVersion, UNK_LANG, &kEoB2TransferConvertTableDOSProvider },
{ kEoB2TransferItemTable, kEoB2, kPlatformDOS, kTalkieVersion, UNK_LANG, &kEoB2TransferItemTableDOSProvider },
{ kEoB2TransferExpTable, kEoB2, kPlatformDOS, kTalkieVersion, UNK_LANG, &kEoB2TransferExpTableDOSProvider },

View File

@ -910,22 +910,21 @@ static const char *const kEoB2MainMenuStringsDOSChinese[5] = {
static const StringListProvider kEoB2MainMenuStringsDOSChineseProvider = { ARRAYSIZE(kEoB2MainMenuStringsDOSChinese), kEoB2MainMenuStringsDOSChinese };
static const char *const kEoB2TransferStrings1DOSChinese[2] = {
"\xb5\xa5\xaf\xc5\x3a\x25\x64", /* "等級:%d"; */
" / %d"
"\xb5\xa5\xaf\xc5\x3a""%-2d", /* "等級:%d"; */
"/%2d "
};
static const StringListProvider kEoB2TransferStrings1DOSChineseProvider = { ARRAYSIZE(kEoB2TransferStrings1DOSChinese), kEoB2TransferStrings1DOSChinese };
static const char *const kEoB2TransferStrings2DOSChinese[2] = {
"\xa6\x62\xb1\x7a\xaa\xba\xb6\xa4\xa5\xee\xa4\xa4\x2c\xb1\x7a\xb3\xcc\xa6\x68\xa5\x75\xaf\xe0\xbf\xef\xa5\x7c\xa6\xec\xa4\x48\xaa\xab\xc2\xe0\xb4\xab", /* ",您最多只能選四位人物轉換"; */
"Select OK when you are finished choosing your party."
static const char *const kEoB2TransferStrings2DOSChinese[1] = {
"\xa6\x62\xb1\x7a\xaa\xba\xb6\xa4\xa5\xee\xa4\xa4\x2c\xb1\x7a\xb3\xcc\xa6\x68\xa5\x75\xaf\xe0\xbf\xef\xa5\x7c\xa6\xec\xa4\x48\xaa\xab\xc2\xe0\xb4\xab" /* "在您的隊伍中,您最多只能選四位人物轉換"; */
};
static const StringListProvider kEoB2TransferStrings2DOSChineseProvider = { ARRAYSIZE(kEoB2TransferStrings2DOSChinese), kEoB2TransferStrings2DOSChinese };
static const char *const kEoB2TransferLabelsDOSChinese[2] = {
"CANCEL",
"OK"
"\xa8\xfa\xae\xf8", /* "取消" */
"\xa7\xb9\xa6\xa8" /* "完成" */
};
static const StringListProvider kEoB2TransferLabelsDOSChineseProvider = { ARRAYSIZE(kEoB2TransferLabelsDOSChinese), kEoB2TransferLabelsDOSChinese };
@ -1094,3 +1093,12 @@ static const DarkMoonAnimCommand kEoB2IntroAnimData40DOSChinese[] = {
};
static const DarkMoonAnimCommandProvider kEoB2IntroAnimData40DOSChineseProvider = { ARRAYSIZE(kEoB2IntroAnimData40DOSChinese), kEoB2IntroAnimData40DOSChinese }; // OK
static const uint16 kEoB2TransferPortraitFramesDOSChinese[32] = {
0x0004, 0x0012, 0x0024, 0x0033, 0x00A3, 0x0024, 0x00BF, 0x0033,
0x0004, 0x004E, 0x0024, 0x006F, 0x00A3, 0x004E, 0x00C3, 0x006F,
0x0004, 0x008A, 0x0024, 0x00AB, 0x00A3, 0x008A, 0x00C3, 0x00AB,
0x0004, 0x00B5, 0x0022, 0x00C6, 0x00A3, 0x00B5, 0x00C1, 0x00C6
};
static const Uint16Provider kEoB2TransferPortraitFramesDOSChineseProvider = { ARRAYSIZE(kEoB2TransferPortraitFramesDOSChinese), kEoB2TransferPortraitFramesDOSChinese };

View File

@ -993,10 +993,10 @@ static const byte kEoB2FlightObjSclIndexPC98[72] = {
static const ByteProvider kEoB2FlightObjSclIndexPC98Provider = { ARRAYSIZE(kEoB2FlightObjSclIndexPC98), kEoB2FlightObjSclIndexPC98 };
static const uint16 kEoB2TransferPortraitFramesPC98[32] = {
0x0004, 0x0018, 0x009D, 0x0038, 0x00A2, 0x0018, 0x013C, 0x0039,
0x0004, 0x0018, 0x009D, 0x0038, 0x00A2, 0x0018, 0x013C, 0x0038,
0x0004, 0x0040, 0x009D, 0x0060, 0x00A2, 0x0040, 0x013C, 0x0060,
0x0004, 0x0068, 0x009D, 0x0089, 0x00A2, 0x0068, 0x013C, 0x0089,
0x0004, 0x0094, 0x002E, 0x009E, 0x0110, 0x0094, 0x013A, 0x009E
0x0004, 0x0092, 0x003B, 0x009F, 0x0103, 0x0092, 0x013A, 0x009F
};
static const Uint16Provider kEoB2TransferPortraitFramesPC98Provider = { ARRAYSIZE(kEoB2TransferPortraitFramesPC98), kEoB2TransferPortraitFramesPC98 };

Binary file not shown.

View File

@ -2036,9 +2036,23 @@ private:
const char *const *_strings1;
const char *const *_strings2;
const char *const *_labels;
struct DialogDefs {
const Common::Rect dlgCoords;
const Common::Point headLinesXY[2];
const Common::Rect buttonCoords[2];
const Common::Point buttonLabelsXY[2];
};
const DialogDefs &_dlg;
static const DialogDefs _dialogSettings_DEF;
static const DialogDefs _dialogSettings_JP;
static const DialogDefs _dialogSettings_ZH;
};
TransferPartyWiz::TransferPartyWiz(EoBCoreEngine *vm, Screen_EoB *screen) : _vm(vm), _screen(screen) {
TransferPartyWiz::TransferPartyWiz(EoBCoreEngine *vm, Screen_EoB *screen) : _vm(vm), _screen(screen),
_dlg(vm ? ((vm->gameFlags().lang == Common::ZH_TWN) ? _dialogSettings_ZH : (vm->gameFlags().lang == Common::JA_JPN ? _dialogSettings_JP : _dialogSettings_DEF)) : _dialogSettings_DEF) {
int temp;
_portraitFrames = _vm->staticres()->loadRawDataBe16(kEoB2TransferPortraitFrames, temp);
_convertTable = _vm->staticres()->loadRawData(kEoB2TransferConvertTable, temp);
@ -2163,34 +2177,25 @@ bool TransferPartyWiz::selectAndLoadTransferFile() {
}
int TransferPartyWiz::selectCharactersMenu() {
static const int16 coordDef[] = { 0, 272, 43, 9, 288 };
static const int16 coordJp[] = { 2, 259, 56, 8, 280 };
const int16 *coord = coordDef;
_screen->setCurPage(2);
Screen::FontId of = _screen->setFont(_vm->_conFont);
_screen->clearCurPage();
_vm->gui_drawBox(0, 0, 320, 163, _vm->guiSettings()->colors.frame1, _vm->guiSettings()->colors.frame2, _vm->guiSettings()->colors.fill);
for (int i = 0; i < 2; ++i)
_vm->gui_drawBox(_dlg.dlgCoords.left, _dlg.dlgCoords.top, _dlg.dlgCoords.width(), _dlg.dlgCoords.height(), _vm->guiSettings()->colors.frame1, _vm->guiSettings()->colors.frame2, _vm->guiSettings()->colors.fill);
_screen->setFont(_vm->_invFont1);
for (int i = 0; i < 6; i++)
drawCharPortraitWithStats(i, 0);
_screen->setFont(_vm->_conFont);
if (_vm->_flags.lang == Common::JA_JPN) {
_screen->printText(_strings2[0], 4, 4, _vm->guiSettings()->colors.guiColorWhite, 0);
_screen->printText(_strings2[1], 4, 12, _vm->guiSettings()->colors.guiColorWhite, 0);
coord = coordJp;
} else {
_screen->printText(_strings2[0], 5, 3, _vm->guiSettings()->colors.guiColorWhite, 0);
_screen->printText(_strings2[1], 5, 10, _vm->guiSettings()->colors.guiColorWhite, 0);
}
for (int i = 0; i < 2 && _dlg.headLinesXY[i].x != -1; ++i)
_screen->printText(_strings2[i], _dlg.headLinesXY[i].x, _dlg.headLinesXY[i].y, _vm->guiSettings()->colors.guiColorWhite, 0);
_vm->gui_drawBox(4, 148 - coord[0], coord[2], 12 + coord[0], _vm->guiSettings()->colors.frame1, _vm->guiSettings()->colors.frame2, _vm->guiSettings()->colors.fill);
_vm->gui_drawBox(coord[1], 148 - coord[0], coord[2], 12 + coord[0], _vm->guiSettings()->colors.frame1, _vm->guiSettings()->colors.frame2, _vm->guiSettings()->colors.fill);
_screen->printShadedText(_labels[0], coord[3], 151 - (coord[0] >> 1), _vm->guiSettings()->colors.guiColorWhite, 0, _vm->guiSettings()->colors.guiColorBlack);
_screen->printShadedText(_labels[1], coord[4], 151 - (coord[0] >> 1), _vm->guiSettings()->colors.guiColorWhite, 0, _vm->guiSettings()->colors.guiColorBlack);
for (int i = 0; i < 2; ++i) {
_vm->gui_drawBox(_dlg.buttonCoords[i].left, _dlg.buttonCoords[i].top, _dlg.buttonCoords[i].width(), _dlg.buttonCoords[i].height(), _vm->guiSettings()->colors.frame1, _vm->guiSettings()->colors.frame2, _vm->guiSettings()->colors.fill);
_screen->printShadedText(_labels[i], _dlg.buttonLabelsXY[i].x, _dlg.buttonLabelsXY[i].y, _vm->guiSettings()->colors.guiColorWhite, 0, _vm->guiSettings()->colors.guiColorBlack);
}
_screen->setCurPage(0);
_screen->clearPage(0);
@ -2251,11 +2256,10 @@ int TransferPartyWiz::selectCharactersMenu() {
continue;
}
int x = (highlight - 6) * (coord[1] - 4) + 4;
_vm->gui_drawBox(x, 148 - coord[0], coord[2], 12 + coord[0], _vm->guiSettings()->colors.fill, _vm->guiSettings()->colors.fill, -1);
_vm->gui_drawBox(_dlg.buttonCoords[highlight - 6].left, _dlg.buttonCoords[highlight - 6].top, _dlg.buttonCoords[highlight - 6].width(), _dlg.buttonCoords[highlight - 6].height(), _vm->guiSettings()->colors.fill, _vm->guiSettings()->colors.fill, -1);
_screen->updateScreen();
_vm->_system->delayMillis(80);
_vm->gui_drawBox(x, 148 - coord[0], coord[2], 12 + coord[0], _vm->guiSettings()->colors.frame1, _vm->guiSettings()->colors.frame2, -1);
_vm->gui_drawBox(_dlg.buttonCoords[highlight - 6].left, _dlg.buttonCoords[highlight - 6].top, _dlg.buttonCoords[highlight - 6].width(), _dlg.buttonCoords[highlight - 6].height(), _vm->guiSettings()->colors.frame1, _vm->guiSettings()->colors.frame2, -1);
_screen->updateScreen();
if (highlight == 6 || _vm->shouldQuit()) {
@ -2272,7 +2276,7 @@ int TransferPartyWiz::selectCharactersMenu() {
if (count == 4 || _vm->shouldQuit())
loop = false;
else
_vm->_gui->messageDialogue(16, count < 4 ? 69 : 70, _vm->guiSettings()->colors.guiColorLightRed);
_vm->_gui->messageDialog(16, count < 4 ? 69 : 70, _vm->guiSettings()->colors.guiColorLightRed);
_screen->updateScreen();
}
@ -2281,52 +2285,71 @@ int TransferPartyWiz::selectCharactersMenu() {
if (_vm->shouldQuit())
return 0;
else
_vm->_gui->messageDialogue(16, 71, _vm->guiSettings()->colors.guiColorLightRed);
_vm->_gui->messageDialog(16, 71, _vm->guiSettings()->colors.guiColorLightRed);
return selection;
}
void TransferPartyWiz::drawCharPortraitWithStats(int charIndex, bool enabled) {
int adjY = 0;
int multY = 40;
int boxH = 34;
int txtColor2D = _vm->guiSettings()->colors.guiColorBlack;
if (_vm->gameFlags().lang == Common::ZH_TWN) {
adjY = -6;
multY = 60;
boxH = 57;
txtColor2D = _vm->guiSettings()->colors.guiColorDarkBlue;
}
int16 x = (charIndex % 2) * 159;
int16 y = (charIndex / 2) * 40;
int16 y = (charIndex / 2) * multY;
EoBCharacter *c = &_vm->_characters[charIndex];
_screen->fillRect(x + 4, y + 24, x + 36, y + 57, 12);
_vm->gui_drawBox(x + 40, y + 24, 118, 34, _vm->guiSettings()->colors.frame1, _vm->guiSettings()->colors.frame2, _vm->guiSettings()->colors.fill);
_screen->fillRect(x + 4, y + 24 + adjY, x + 36, y + 57 + adjY, 12);
_vm->gui_drawBox(x + 40, y + 24 + adjY, 118, boxH, _vm->guiSettings()->colors.frame1, _vm->guiSettings()->colors.frame2, _vm->guiSettings()->colors.fill);
if (!(c->flags & 1))
return;
_screen->drawShape(_screen->_curPage, c->faceShape, x + 4, y + 25, 0);
_screen->drawShape(_screen->_curPage, c->faceShape, x + 4, y + 25 + adjY, 0);
int color1 = _vm->guiSettings()->colors.guiColorWhite;
int color2 = _vm->guiSettings()->colors.guiColorBlack;
int color2 = txtColor2D;
if (enabled) {
color1 = _vm->guiSettings()->colors.guiColorLightRed;
color2 = _vm->guiSettings()->colors.guiColorWhite;
} else {
_screen->drawShape(_screen->_curPage, _vm->_disabledCharGrid, x + 4, y + 25, 0);
_screen->drawShape(_screen->_curPage, _vm->_disabledCharGrid, x + 4, y + 25 + adjY, 0);
}
_screen->printShadedText(c->name, x + 44, y + 27, color1, 0, _vm->guiSettings()->colors.guiColorBlack);
_screen->printText(_vm->_chargenRaceSexStrings[c->raceSex], x + 43, y + 36, color2, 0);
_screen->printText(_vm->_chargenClassStrings[c->cClass], x + 43, y + 43, color2, 0);
if (_vm->gameFlags().lang == Common::ZH_TWN) {
Screen::FontId of = _screen->setFont(Screen::FID_6_FNT);
_screen->printShadedText(c->name, x + 44, y + 20, color1, 0, _vm->guiSettings()->colors.guiColorBlack);
_screen->setFont(of);
_screen->printShadedText(_vm->_chargenRaceSexStrings[c->raceSex], x + 43, y + 28, color2, 0, _vm->guiSettings()->colors.guiColorBlack);
_screen->printShadedText(_vm->_chargenClassStrings[c->cClass], x + 43, y + 43, color2, 0, _vm->guiSettings()->colors.guiColorBlack);
} else {
_screen->printShadedText(c->name, x + 44, y + 27, color1, 0, _vm->guiSettings()->colors.guiColorBlack);
_screen->printText(_vm->_chargenRaceSexStrings[c->raceSex], x + 43, y + 36, color2, 0);
_screen->printText(_vm->_chargenClassStrings[c->cClass], x + 43, y + 43, color2, 0);
}
Common::String tmp = Common::String::format(_strings1[0], c->level[0]);
for (int i = 1; i < _vm->_numLevelsPerClass[c->cClass]; i++)
tmp += Common::String::format(_strings1[1], c->level[i]);
_screen->printText(tmp.c_str(), x + 43, y + 50, color2, 0);
if (_vm->gameFlags().lang == Common::ZH_TWN)
_screen->printShadedText(tmp.c_str(), x + 43, y + 58, color2, 0, _vm->guiSettings()->colors.guiColorBlack);
else
_screen->printText(tmp.c_str(), x + 43, y + 50, color2, 0);
}
void TransferPartyWiz::updateHighlight(int index) {
static const int16 xPosDef[] = { 9, 288 };
static const int16 xPosJp[] = { 8, 280 };
const int16 *xPos = (_vm->_flags.lang == Common::JA_JPN) ? xPosJp : xPosDef;
int16 yPos = (_vm->_flags.lang == Common::JA_JPN) ? 150 : 151;
if (_highlight > 5 && _highlight != index)
_screen->printText(_labels[_highlight - 6], xPos[_highlight - 6], yPos, _vm->guiSettings()->colors.guiColorWhite, 0);
_screen->printText(_labels[_highlight - 6], _dlg.buttonLabelsXY[_highlight - 6].x, _dlg.buttonLabelsXY[_highlight - 6].y, _vm->guiSettings()->colors.guiColorWhite, 0);
if (index < 6) {
_vm->_gui->updateBoxFrameHighLight(14 + index);
@ -2340,7 +2363,7 @@ void TransferPartyWiz::updateHighlight(int index) {
if (_highlight < 6)
_vm->_gui->updateBoxFrameHighLight(-1);
_screen->printText(_labels[index - 6], xPos[index - 6], yPos, _vm->guiSettings()->colors.guiColorLightRed, 0);
_screen->printText(_labels[index - 6], _dlg.buttonLabelsXY[index - 6].x, _dlg.buttonLabelsXY[index - 6].y, _vm->guiSettings()->colors.guiColorLightRed, 0);
_screen->updateScreen();
_highlight = index;
}
@ -2636,6 +2659,27 @@ Common::String TransferPartyWiz::makeTwoByteString(const Common::String &src) {
return n;
}
const TransferPartyWiz::DialogDefs TransferPartyWiz::_dialogSettings_DEF = {
{ 0, 0, 320, 163 },
{ { 5, 3 }, { 5, 10 } },
{ { 4, 148, 47, 160}, { 272, 148, 315, 160} },
{ { 9, 151 }, { 288, 151 } }
};
const TransferPartyWiz::DialogDefs TransferPartyWiz::_dialogSettings_JP = {
{ 0, 0, 320, 163 },
{ { 4, 4 }, { 4, 12 } },
{ { 4, 146, 60, 160}, { 259, 146, 315, 160} },
{ { 8, 150 }, { 280, 150 } }
};
const TransferPartyWiz::DialogDefs TransferPartyWiz::_dialogSettings_ZH = {
{ 0, 0, 320, 200 },
{ { 5, 2 }, { -1, -1 } },
{ { 2, 180, 37, 200}, { 161, 180, 196, 200} },
{ { 4, 183 }, { 163, 183 } }
};
// Start functions
bool EoBCoreEngine::startCharacterGeneration(bool defaultParty) {

View File

@ -597,8 +597,8 @@ void DarkMoonEngine::restParty_npc() {
gui_drawBox(_screen->_curDim->sx << 3, _screen->_curDim->sy, _screen->_curDim->w << 3, _screen->_curDim->h, guiSettings()->colors.frame1, guiSettings()->colors.frame2, -1);
gui_drawBox((_screen->_curDim->sx << 3) + 1, _screen->_curDim->sy + 1, (_screen->_curDim->w << 3) - 2, _screen->_curDim->h - 2, guiSettings()->colors.frame1, guiSettings()->colors.frame2, guiSettings()->colors.fill);
_screen->set16bitShadingLevel(0);
_gui->messageDialogue2(11, 63, guiSettings()->colors.guiColorLightRed);
_gui->messageDialogue2(11, 64, guiSettings()->colors.guiColorLightRed);
_gui->messageDialog2(11, 63, guiSettings()->colors.guiColorLightRed);
_gui->messageDialog2(11, 64, guiSettings()->colors.guiColorLightRed);
}
bool DarkMoonEngine::restParty_extraAbortCondition() {

View File

@ -1574,7 +1574,10 @@ GUI_EoB::GUI_EoB(EoBCoreEngine *vm) : GUI(vm), _vm(vm), _screen(vm ? vm->_screen
// For all other versions we convert to capital characters.
_textInputForceUppercase(vm && vm->_flags.platform != Common::kPlatformPC98 && vm->_flags.lang != Common::ZH_TWN && !(vm->_flags.platform == Common::kPlatformSegaCD && vm->_flags.lang != Common::EN_ANY)),
_textInputHeight(vm && vm->game() == GI_EOB2 && vm->gameFlags().lang == Common::Language::ZH_TWN ? 16 : 9),
_textInputShadowOffset(vm && vm->game() == GI_EOB2 && vm->gameFlags().lang == Common::Language::ZH_TWN ? 1 : 0) {
_textInputShadowOffset(vm && vm->game() == GI_EOB2 && vm->gameFlags().lang == Common::Language::ZH_TWN ? 1 : 0),
_dlgButtonHeight1(vm && vm->game() == GI_EOB2 && vm->gameFlags().lang == Common::Language::ZH_TWN ? 16 : 14),
_dlgButtonHeight2(vm && vm->game() == GI_EOB2 && vm->gameFlags().lang == Common::Language::ZH_TWN ? 17 : 14),
_dlgButtonLabelYOffs(vm && vm->game() == GI_EOB2 && vm->gameFlags().lang == Common::Language::ZH_TWN ? 1 : 3) {
_menuStringsPrefsTemp = new char*[4]();
_saveSlotStringsTemp = new char*[6];
@ -1620,8 +1623,8 @@ GUI_EoB::GUI_EoB(EoBCoreEngine *vm) : GUI(vm), _vm(vm), _screen(vm ? vm->_screen
else
_highLightColorTable = _highlightColorTableVGA;
EoBRect16 *highlightFrames = new EoBRect16[20];
memcpy(highlightFrames, _highlightFramesDefault, 20 * sizeof(EoBRect16));
EoBRect16 *highlightFrames = new EoBRect16[ARRAYSIZE(_highlightFramesDefault)];
memcpy(highlightFrames, _highlightFramesDefault, sizeof(_highlightFramesDefault));
if (_vm->gameFlags().platform == Common::kPlatformSegaCD) {
for (int i = 0; i < 6; ++i) {
@ -1630,6 +1633,8 @@ GUI_EoB::GUI_EoB(EoBCoreEngine *vm) : GUI(vm), _vm(vm), _screen(vm ? vm->_screen
highlightFrames[i].x2 = _vm->guiSettings()->charBoxCoords.boxX[i & 1] + _vm->guiSettings()->charBoxCoords.boxWidth - 1;
highlightFrames[i].y2 = _vm->guiSettings()->charBoxCoords.boxY[i >> 1] + _vm->guiSettings()->charBoxCoords.boxHeight - 1;
}
} else if (_vm->gameFlags().lang == Common::ZH_TWN) {
memcpy(&highlightFrames[14], _highlightFramesTransferZH, sizeof(_highlightFramesTransferZH));
}
_highlightFrames = highlightFrames;
@ -2695,12 +2700,12 @@ bool GUI_EoB::runLoadMenu(int x, int y, bool fromMainMenu) {
} else if (slot >= 0) {
if (_saveSlotIdTemp[slot] == -1) {
_vm->useMainMenuGUISettings(fromMainMenu);
messageDialogue(11, 65, _vm->guiSettings()->colors.guiColorLightRed);
messageDialog(11, 65, _vm->guiSettings()->colors.guiColorLightRed);
_vm->useMainMenuGUISettings(false);
} else {
if (_vm->loadGameState(_saveSlotIdTemp[slot]).getCode() != Common::kNoError) {
_vm->useMainMenuGUISettings(fromMainMenu);
messageDialogue(11, 16, _vm->guiSettings()->colors.guiColorLightRed);
messageDialog(11, 16, _vm->guiSettings()->colors.guiColorLightRed);
_vm->useMainMenuGUISettings(false);
}
runLoop = false;
@ -2731,13 +2736,13 @@ bool GUI_EoB::confirmDialogue2(int dim, int id, int deflt) {
int lastHighlight = -1;
for (int i = 0; i < 2; i++)
drawMenuButtonBox(x[i], y, 32, 14, false, false);
drawMenuButtonBox(x[i], y, 32, _dlgButtonHeight2, false, false);
for (bool runLoop = true; runLoop && !_vm->shouldQuit();) {
Common::Point p = _vm->getMousePos();
if (_vm->posWithinRect(p.x, p.y, x[0], y, x[0] + 32, y + 14))
if (_vm->posWithinRect(p.x, p.y, x[0], y, x[0] + 32, y + _dlgButtonHeight2))
newHighlight = 0;
else if (_vm->posWithinRect(p.x, p.y, x[1], y, x[1] + 32, y + 14))
else if (_vm->posWithinRect(p.x, p.y, x[1], y, x[1] + 32, y + _dlgButtonHeight2))
newHighlight = 1;
int inputFlag = _vm->checkInput(0, false, 0) & 0x8FF;
@ -2754,10 +2759,10 @@ bool GUI_EoB::confirmDialogue2(int dim, int id, int deflt) {
newHighlight = 0;
runLoop = false;
} else if (inputFlag == 199 || inputFlag == 201) {
if (_vm->posWithinRect(p.x, p.y, x[0], y, x[0] + 32, y + 14)) {
if (_vm->posWithinRect(p.x, p.y, x[0], y, x[0] + 32, y + _dlgButtonHeight2)) {
newHighlight = 0;
runLoop = false;
} else if (_vm->posWithinRect(p.x, p.y, x[1], y, x[1] + 32, y + 14)) {
} else if (_vm->posWithinRect(p.x, p.y, x[1], y, x[1] + 32, y + _dlgButtonHeight2)) {
newHighlight = 1;
runLoop = false;
}
@ -2765,16 +2770,16 @@ bool GUI_EoB::confirmDialogue2(int dim, int id, int deflt) {
if (newHighlight != lastHighlight) {
for (int i = 0; i < 2; i++)
_screen->printShadedText(_vm->_menuYesNoStrings[i], x[i] + 16 - (_screen->getTextWidth(_vm->_menuYesNoStrings[i]) / 2) + 1, y + 3, i == newHighlight ? _vm->guiSettings()->colors.guiColorLightRed : _vm->guiSettings()->colors.guiColorWhite, 0, _vm->guiSettings()->colors.guiColorBlack);
_screen->printShadedText(_vm->_menuYesNoStrings[i], x[i] + 16 - (_screen->getTextWidth(_vm->_menuYesNoStrings[i]) / 2) + 1, y + _dlgButtonLabelYOffs, i == newHighlight ? _vm->guiSettings()->colors.guiColorLightRed : _vm->guiSettings()->colors.guiColorWhite, 0, _vm->guiSettings()->colors.guiColorBlack);
_screen->updateScreen();
lastHighlight = newHighlight;
}
}
drawMenuButtonBox(x[newHighlight], y, 32, 14, true, true);
drawMenuButtonBox(x[newHighlight], y, 32, _dlgButtonHeight2, true, true);
_screen->updateScreen();
_vm->_system->delayMillis(80);
drawMenuButtonBox(x[newHighlight], y, 32, 14, false, true);
drawMenuButtonBox(x[newHighlight], y, 32, _dlgButtonHeight2, false, true);
_screen->updateScreen();
_screen->copyRegion(0, _screen->_curDim->h, _screen->_curDim->sx << 3, _screen->_curDim->sy, _screen->_curDim->w << 3, _screen->_curDim->h, 2, 0, Screen::CR_NO_P_CHECK);
@ -2788,7 +2793,7 @@ bool GUI_EoB::confirmDialogue2(int dim, int id, int deflt) {
return newHighlight == 0;
}
void GUI_EoB::messageDialogue(int dim, int id, int buttonTextCol) {
void GUI_EoB::messageDialog(int dim, int id, int buttonTextCol) {
int od = _screen->curDimIndex();
_screen->setScreenDim(dim);
Screen::FontId of = _screen->setFont(_menuFont);
@ -2801,13 +2806,8 @@ void GUI_EoB::messageDialogue(int dim, int id, int buttonTextCol) {
int by = dm->sy + dm->h - 19;
int bw = _screen->getTextWidth(_vm->_menuOkString) + 7;
if (_vm->_flags.lang == Common::Language::ZH_TWN) {
drawMenuButtonBox(bx, by, bw, 16, false, false);
_screen->printShadedText(_vm->_menuOkString, bx + 4, by + 1, buttonTextCol, 0, _vm->guiSettings()->colors.guiColorBlack);
} else {
drawMenuButtonBox(bx, by, bw, 14, false, false);
_screen->printShadedText(_vm->_menuOkString, bx + 4, by + 3, buttonTextCol, 0, _vm->guiSettings()->colors.guiColorBlack);
}
drawMenuButtonBox(bx, by, bw, _dlgButtonHeight1, false, false);
_screen->printShadedText(_vm->_menuOkString, bx + 4, by + _dlgButtonLabelYOffs, buttonTextCol, 0, _vm->guiSettings()->colors.guiColorBlack);
_screen->updateScreen();
for (bool runLoop = true; runLoop && !_vm->shouldQuit();) {
@ -2815,17 +2815,17 @@ void GUI_EoB::messageDialogue(int dim, int id, int buttonTextCol) {
_vm->removeInputTop();
if (inputFlag == 199 || inputFlag == 201) {
if (_vm->posWithinRect(_vm->_mouseX, _vm->_mouseY, bx, by, bx + bw, by + 14))
if (_vm->posWithinRect(_vm->_mouseX, _vm->_mouseY, bx, by, bx + bw, by + _dlgButtonHeight1))
runLoop = false;
} else if (inputFlag == _vm->_keyMap[Common::KEYCODE_SPACE] || inputFlag == _vm->_keyMap[Common::KEYCODE_RETURN] || inputFlag == _vm->_keyMap[Common::KEYCODE_o]) {
runLoop = false;
}
}
drawMenuButtonBox(bx, by, bw, 14, true, true);
drawMenuButtonBox(bx, by, bw, _dlgButtonHeight1, true, true);
_screen->updateScreen();
_vm->_system->delayMillis(80);
drawMenuButtonBox(bx, by, bw, 14, false, true);
drawMenuButtonBox(bx, by, bw, _dlgButtonHeight1, false, true);
_screen->updateScreen();
_screen->copyRegion(0, dm->h, dm->sx << 3, dm->sy, dm->w << 3, dm->h, 2, 0, Screen::CR_NO_P_CHECK);
@ -2838,7 +2838,7 @@ void GUI_EoB::messageDialogue(int dim, int id, int buttonTextCol) {
dm = _screen->getScreenDim(dim);
}
void GUI_EoB::messageDialogue2(int dim, int id, int buttonTextCol) {
void GUI_EoB::messageDialog2(int dim, int id, int buttonTextCol) {
_screen->_curPage = 2;
_screen->setClearScreenDim(dim);
drawMenuButtonBox(_screen->_curDim->sx << 3, _screen->_curDim->sy, _screen->_curDim->w << 3, _screen->_curDim->h, false, false);
@ -2847,10 +2847,10 @@ void GUI_EoB::messageDialogue2(int dim, int id, int buttonTextCol) {
_screen->copyRegion(_screen->_curDim->sx << 3, _screen->_curDim->sy, _screen->_curDim->sx << 3, _screen->_curDim->sy, _screen->_curDim->w << 3, _screen->_curDim->h, 2, 0, Screen::CR_NO_P_CHECK);
int x = (_screen->_curDim->sx << 3) + (_screen->_curDim->w << 2) - (_screen->getTextWidth(_vm->_menuOkString) / 2);
int y = _screen->_curDim->sy + _screen->_curDim->h - 21;
int y = _screen->_curDim->sy + _screen->_curDim->h - (35 - _dlgButtonHeight2);
int w = _screen->getTextWidth(_vm->_menuOkString) + 8;
drawMenuButtonBox(x, y, w, 14, false, false);
_screen->printShadedText(_vm->_menuOkString, x + 4, y + 3, buttonTextCol, 0, _vm->guiSettings()->colors.guiColorBlack);
drawMenuButtonBox(x, y, w, _dlgButtonHeight1, false, false);
_screen->printShadedText(_vm->_menuOkString, x + 4, y + _dlgButtonLabelYOffs, buttonTextCol, 0, _vm->guiSettings()->colors.guiColorBlack);
_screen->updateScreen();
for (bool runLoop = true; runLoop && !_vm->shouldQuit();) {
@ -2858,7 +2858,7 @@ void GUI_EoB::messageDialogue2(int dim, int id, int buttonTextCol) {
_vm->removeInputTop();
if (inputFlag == 199 || inputFlag == 201) {
if (_vm->posWithinRect(_vm->_mouseX, _vm->_mouseY, x, y, x + w, y + 14))
if (_vm->posWithinRect(_vm->_mouseX, _vm->_mouseY, x, y, x + w, y + _dlgButtonHeight1))
runLoop = false;
} else if (inputFlag == _vm->_keyMap[Common::KEYCODE_SPACE] || inputFlag == _vm->_keyMap[Common::KEYCODE_RETURN] || inputFlag == _vm->_keyMap[Common::KEYCODE_o]) {
runLoop = false;
@ -2866,14 +2866,13 @@ void GUI_EoB::messageDialogue2(int dim, int id, int buttonTextCol) {
}
_screen->set16bitShadingLevel(4);
_vm->gui_drawBox(x, y, w, 14, _vm->guiSettings()->colors.frame2, _vm->guiSettings()->colors.fill, -1);
_vm->gui_drawBox(x, y, w, _dlgButtonHeight1, _vm->guiSettings()->colors.frame2, _vm->guiSettings()->colors.fill, -1);
_screen->set16bitShadingLevel(0);
_screen->updateScreen();
_vm->_system->delayMillis(80);
drawMenuButtonBox(x, y, w, 14, false, false);
_screen->printShadedText(_vm->_menuOkString, x + 4, y + 3, buttonTextCol, 0, _vm->guiSettings()->colors.guiColorBlack);
drawMenuButtonBox(x, y, w, _dlgButtonHeight1, false, false);
_screen->printShadedText(_vm->_menuOkString, x + 4, y + _dlgButtonLabelYOffs, buttonTextCol, 0, _vm->guiSettings()->colors.guiColorBlack);
_screen->updateScreen();
}
void GUI_EoB::updateBoxFrameHighLight(int box) {
@ -3286,7 +3285,7 @@ bool GUI_EoB::transferFileMenu(Common::String &targetName, Common::String &selec
break;
if (_saveSlotIdTemp[slot] == -1)
messageDialogue(11, 65, _vm->guiSettings()->colors.guiColorLightRed);
messageDialog(11, 65, _vm->guiSettings()->colors.guiColorLightRed);
else {
_screen->modifyScreenDim(11, xo, yo, dm->w, dm->h);
selection = _vm->getSavegameFilename(targetName, _saveSlotIdTemp[slot]);
@ -3369,7 +3368,7 @@ bool GUI_EoB::runSaveMenu(int x, int y) {
}
if (!strlen(_saveSlotStringsTemp[slot])) {
messageDialogue(11, 54, _vm->guiSettings()->colors.guiColorLightRed);
messageDialog(11, 54, _vm->guiSettings()->colors.guiColorLightRed);
in = -1;
}
}
@ -3403,7 +3402,7 @@ bool GUI_EoB::runSaveMenu(int x, int y) {
if (err.getCode() == Common::kNoError)
result = true;
else
messageDialogue(11, 15, _vm->guiSettings()->colors.guiColorLightRed);
messageDialog(11, 15, _vm->guiSettings()->colors.guiColorLightRed);
runLoop = false;
}
@ -3534,7 +3533,7 @@ int GUI_EoB::selectSaveSlotDialog(int x, int y, int id) {
void GUI_EoB::drawSaveSlotDialog(int x, int y, int id) {
_screen->setCurPage(2);
drawMenuButtonBox(0, 0, 176, 144, false, false);
const char* title = (id < 2) ? _vm->_saveLoadStrings[2 + id] : _vm->_transferStringsScummVM[id - 1];
const char *title = (id < 2) ? _vm->_saveLoadStrings[2 + id] : _vm->_transferStringsScummVM[id - 1];
_screen->printShadedText(title, 52, _vm->_flags.lang == Common::Language::ZH_TWN ? 3 : 5,
(_vm->_configRenderMode == Common::kRenderCGA) ? 1 : _vm->guiSettings()->colors.guiColorWhite, 0, _vm->guiSettings()->colors.guiColorBlack);
_screen->copyRegion(0, 0, x, y, 176, 144, 2, 0, Screen::CR_NO_P_CHECK);
@ -4915,7 +4914,7 @@ void GUI_EoB::restParty_updateRestTime(int hours, bool init) {
_screen->setFont(of);
}
const EoBRect16 GUI_EoB::_highlightFramesDefault[] = {
const EoBRect16 GUI_EoB::_highlightFramesDefault[20] = {
{ 0x00B7, 0x0001, 0x00F7, 0x0034 },
{ 0x00FF, 0x0001, 0x013F, 0x0034 },
{ 0x00B7, 0x0035, 0x00F7, 0x0068 },
@ -4938,6 +4937,15 @@ const EoBRect16 GUI_EoB::_highlightFramesDefault[] = {
{ 0x00A3, 0x0068, 0x00C3, 0x0089 }
};
const EoBRect16 GUI_EoB::_highlightFramesTransferZH[] = {
{ 0x0004, 0x0012, 0x0024, 0x0033 },
{ 0x00A3, 0x0012, 0x00C3, 0x0033 },
{ 0x0004, 0x004E, 0x0024, 0x006F },
{ 0x00A3, 0x004E, 0x00C3, 0x006F },
{ 0x0004, 0x008A, 0x0024, 0x00AB },
{ 0x00A3, 0x008A, 0x00C3, 0x00AB }
};
const uint8 GUI_EoB::_highlightColorTableVGA[] = { 0x0F, 0xB0, 0xB2, 0xB4, 0xB6, 0xB8, 0xBA, 0xBC, 0x0C, 0xBC, 0xBA, 0xB8, 0xB6, 0xB4, 0xB2, 0xB0, 0x00 };
const uint8 GUI_EoB::_highlightColorTableEGA[] = { 0x0C, 0x0D, 0x0E, 0x0F, 0x0E, 0x0D, 0x00 };

View File

@ -63,8 +63,8 @@ public:
virtual bool runLoadMenu(int x, int y, bool fromMainMenu = false);
bool confirmDialogue2(int dim, int id, int deflt);
void messageDialogue(int dim, int id, int buttonTextCol);
void messageDialogue2(int dim, int id, int buttonTextCol);
void messageDialog(int dim, int id, int buttonTextCol);
void messageDialog2(int dim, int id, int buttonTextCol);
void updateBoxFrameHighLight(int box);
@ -181,9 +181,13 @@ private:
const Screen::FontId _menuFont;
const Screen::FontId _menuFont2;
const int _dlgButtonHeight1;
const int _dlgButtonHeight2;
const int _dlgButtonLabelYOffs;
const EoBRect16 *_highlightFrames;
static const EoBRect16 _highlightFramesDefault[];
static const EoBRect16 _highlightFramesDefault[20];
static const EoBRect16 _highlightFramesTransferZH[6];
static const uint8 _highlightColorTableVGA[];
static const uint8 _highlightColorTableEGA[];
static const uint8 _highlightColorTableAmiga[];

View File

@ -1913,7 +1913,7 @@ void DarkMoonEngine::initStaticResource() {
};
// ScummVM specific
static const char *const transferStringsScummVM[3][5] = {
static const char *const transferStringsScummVM[5][5] = {
{
"\r We cannot find any EOB save game\r file. Please make sure that the\r save game file with the party\r you wish to transfer is located\r in your ScummVM save game\r directory. If you have set up\r multiple save directories you\r have to copy the EOB save file\r into your EOB II save directory.\r Do you wish to try again?",
"Game ID",
@ -1934,6 +1934,20 @@ void DarkMoonEngine::initStaticResource() {
"\r Parece que ya se ha vencido\r Xanathar aqui. Deseas transferir\r el grupo que ha finalizado el\r juego? En caso contrario puedes\r seleccionar otra partida de las\r anteriores guardadas.",
"Escoge Fichero",
"\r\r Un momento\r por favor..."
},
{// TODO: translate to Japanese
"\r We cannot find any EOB save game\r file. Please make sure that the\r save game file with the party\r you wish to transfer is located\r in your ScummVM save game\r directory. If you have set up\r multiple save directories you\r have to copy the EOB save file\r into your EOB II save directory.\r Do you wish to try again?",
" ""\x83""Q""\x81""[""\x83\x80""ID",
"\r It seems that you have already\r defeated Xanathar here. Do you\r wish to transfer the party that\r finished the game? If not, you\r will be able to select a save\r game from the save game\r dialog.",
"\x83""t""\x83""@""\x83""C""\x83\x8b\x82\xf0\x91""I""\x91\xf0",
"\r\r ""\x82\xb5\x82\xce\x82\xe7\x82\xad\x82\xa8\x91\xd2\x82\xbf\x82\xad\x82\xbe\x82\xb3\x82\xa2\x81""E""\x81""E""\x81""E"
},
{// TODO: translate to Traditional Chinese
"\r We cannot find any EOB save game\r file. Please make sure that the\r save game file with the party\r you wish to transfer is located\r in your ScummVM save game\r directory. If you have set up\r multiple save directories you\r have to copy the EOB save file\r into your EOB II save directory.\r Do you wish to try again?",
" ""\xb9""C""\xc0\xb8""ID",
" It seems that you have already\r defeated Xanathar here. Do you\r wish to transfer the party that\r finished the game? If not, you\r will be able to select a save\r game from the save game dialog.",
"\xbf\xef\xbe\xdc\xa4""@""\xad\xd3\xa4\xe5\xa5\xf3",
"\r ""\xbd\xd0\xb5y\xb5\xa5""..."
}
};
@ -1953,13 +1967,21 @@ void DarkMoonEngine::initStaticResource() {
break;
case Common::JA_JPN:
_errorSlotNoNameString = errorSlotNoNameString[3];
_transferStringsScummVM = transferStringsScummVM[0];
_transferStringsScummVM = transferStringsScummVM[3];
break;
case Common::ZH_TWN:
_errorSlotNoNameString = errorSlotNoNameString[4];
_transferStringsScummVM = transferStringsScummVM[0];
_transferStringsScummVM = transferStringsScummVM[4];
break;
}
Common::U32String g("選擇一個文件");
Common::String r = g.encode(Common::kWindows950);
Common::String dmp;
for (int i = 0; i < r.size(); ++i) {
dmp += (((uint8)r[i] <= 0x7F) ? Common::String(r[i]).c_str() : Common::String::format("\\x%02x", (uint8)r[i]).c_str());
}
debug("%s", dmp.c_str());
}
void DarkMoonEngine::initSpells() {