mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-03 17:33:05 +00:00
AVALANCHE: Move/rename/implement Help::plotButton().
This commit is contained in:
parent
db2baa6f06
commit
6ffbbc8ab2
@ -652,6 +652,40 @@ void GraphicManager::ghostDrawBackgroundItems(Common::File &file) {
|
||||
refreshScreen();
|
||||
}
|
||||
|
||||
/**
|
||||
* @remarks Originally called 'plot_button'
|
||||
*/
|
||||
void GraphicManager::helpDrawButton(int y, byte which) {
|
||||
if (y > 200) {
|
||||
_vm->_graphics->setBackgroundColor(kColorGreen);
|
||||
_vm->_system->delayMillis(10);
|
||||
_vm->_graphics->setBackgroundColor(kColorBlack);
|
||||
return;
|
||||
}
|
||||
|
||||
Common::File file;
|
||||
|
||||
if (!file.open("buttons.avd"))
|
||||
error("AVALANCHE: Help: File not found: buttons.avd");
|
||||
|
||||
file.seek(which * 930); // 930 is the size of one button.
|
||||
|
||||
Graphics::Surface button = loadPictureGraphic(file);
|
||||
|
||||
int x = 0;
|
||||
if (y == -177) {
|
||||
x = 229;
|
||||
y = 5;
|
||||
}
|
||||
else
|
||||
x = 470;
|
||||
|
||||
_vm->_graphics->drawPicture(_surface, button, x, y);
|
||||
|
||||
button.free();
|
||||
file.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* This function mimics Pascal's getimage().
|
||||
*/
|
||||
|
@ -103,6 +103,9 @@ public:
|
||||
void ghostDrawPicture(const Graphics::Surface &picture, uint16 destX, uint16 destY);
|
||||
void ghostDrawBackgroundItems(Common::File &file);
|
||||
|
||||
// Help's function:
|
||||
void helpDrawButton(int y, byte which);
|
||||
|
||||
void clearAlso();
|
||||
void clearTextBar();
|
||||
void setAlsoLine(int x1, int y1, int x2, int y2, Color color);
|
||||
|
@ -38,11 +38,8 @@ Help::Help(AvalancheEngine *vm) {
|
||||
_highlightWas = 0;
|
||||
}
|
||||
|
||||
void Help::plotButton(int8 y, byte which) {
|
||||
warning("STUB: Help::plotButton()");
|
||||
}
|
||||
|
||||
void Help::getMe(byte which) {
|
||||
// Help icons are 80x20.
|
||||
|
||||
_highlightWas = 177; // Forget where the highlight was.
|
||||
|
||||
@ -61,7 +58,7 @@ void Help::getMe(byte which) {
|
||||
_vm->_graphics->drawFilledRectangle(Common::Rect(8, 40, 450, 200), kColorWhite);
|
||||
|
||||
byte index = file.readByte();
|
||||
plotButton(-177, index);
|
||||
_vm->_graphics->helpDrawButton(-177, index);
|
||||
|
||||
// Plot the title:
|
||||
_vm->_graphics->drawNormalText(title, _vm->_font, 8, 629 - 8 * title.size(), 26, kColorBlack);
|
||||
|
@ -49,7 +49,6 @@ private:
|
||||
Button _buttons[10];
|
||||
byte _highlightWas;
|
||||
|
||||
void plotButton(int8 y, byte which);
|
||||
void getMe(byte which);
|
||||
Common::String getLine(Common::File &file); // It was a nested function in getMe().
|
||||
byte checkMouse(); // Returns clicked-on button, or 0 if none.
|
||||
|
Loading…
x
Reference in New Issue
Block a user