MADS: In progress text draw methods for user interface
This commit is contained in:
parent
4dd057edd9
commit
39a36064ac
4 changed files with 69 additions and 10 deletions
|
@ -393,7 +393,7 @@ void Scene::doFrame() {
|
||||||
|
|
||||||
// Write any text needed by the interface
|
// Write any text needed by the interface
|
||||||
if (_vm->_game->_abortTimers2)
|
if (_vm->_game->_abortTimers2)
|
||||||
_userInterface.writeText();
|
_userInterface.drawTextElements();
|
||||||
|
|
||||||
// Draw any elements
|
// Draw any elements
|
||||||
drawElements((ScreenTransition)_vm->_game->_abortTimers2, _vm->_game->_abortTimers2);
|
drawElements((ScreenTransition)_vm->_game->_abortTimers2, _vm->_game->_abortTimers2);
|
||||||
|
|
|
@ -45,7 +45,6 @@ ScreenObjects::ScreenObjects(MADSEngine *vm): _vm(vm) {
|
||||||
_v7FECA = 0;
|
_v7FECA = 0;
|
||||||
_v7FED6 = 0;
|
_v7FED6 = 0;
|
||||||
_v8332A = 0;
|
_v8332A = 0;
|
||||||
_selectedObject = 0;
|
|
||||||
_category = CAT_NONE;
|
_category = CAT_NONE;
|
||||||
_objectIndex = 0;
|
_objectIndex = 0;
|
||||||
_released = false;
|
_released = false;
|
||||||
|
@ -70,10 +69,10 @@ void ScreenObjects::check(bool scanFlag) {
|
||||||
_v7FECA = false;
|
_v7FECA = false;
|
||||||
|
|
||||||
if ((_vm->_events->_vD6 || _v8332A || _yp || _v8333C) && scanFlag) {
|
if ((_vm->_events->_vD6 || _v8332A || _yp || _v8333C) && scanFlag) {
|
||||||
_selectedObject = scanBackwards(_vm->_events->currentPos(), LAYER_GUI);
|
scene._userInterface._selectedObject = scanBackwards(_vm->_events->currentPos(), LAYER_GUI);
|
||||||
if (_selectedObject > 0) {
|
if (scene._userInterface._selectedObject > 0) {
|
||||||
_category = (ScrCategory)((*this)[_selectedObject - 1]._category & 7);
|
_category = (ScrCategory)((*this)[scene._userInterface._selectedObject - 1]._category & 7);
|
||||||
_objectIndex = (*this)[_selectedObject - 1]._descId;
|
_objectIndex = (*this)[scene._userInterface._selectedObject - 1]._descId;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handling for easy mouse
|
// Handling for easy mouse
|
||||||
|
|
|
@ -41,6 +41,7 @@ UserInterface::UserInterface(MADSEngine *vm) : _vm(vm) {
|
||||||
_screenObjectsCount = 0;
|
_screenObjectsCount = 0;
|
||||||
_inventoryTopIndex = 0;
|
_inventoryTopIndex = 0;
|
||||||
_objectY = 0;
|
_objectY = 0;
|
||||||
|
_selectedObject = -1;
|
||||||
|
|
||||||
byte *pData = _vm->_screen.getBasePtr(0, MADS_SCENE_HEIGHT);
|
byte *pData = _vm->_screen.getBasePtr(0, MADS_SCENE_HEIGHT);
|
||||||
setPixels(pData, MADS_SCREEN_WIDTH, MADS_INTERFACE_HEIGHT);
|
setPixels(pData, MADS_SCREEN_WIDTH, MADS_INTERFACE_HEIGHT);
|
||||||
|
@ -106,7 +107,7 @@ void UserInterface::setup(int id) {
|
||||||
scene._imageInterEntries.call(0, 0);
|
scene._imageInterEntries.call(0, 0);
|
||||||
|
|
||||||
scene._action.clear();
|
scene._action.clear();
|
||||||
writeText();
|
drawTextElements();
|
||||||
loadElements();
|
loadElements();
|
||||||
scene._dynamicHotspots.refresh();
|
scene._dynamicHotspots.refresh();
|
||||||
}
|
}
|
||||||
|
@ -115,10 +116,38 @@ void UserInterface::elementHighlighted() {
|
||||||
warning("TODO: UserInterface::elementHighlighted");
|
warning("TODO: UserInterface::elementHighlighted");
|
||||||
}
|
}
|
||||||
|
|
||||||
void UserInterface::writeText() {
|
void UserInterface::drawTextElements() {
|
||||||
warning("TODO: UserInterface::writeText");
|
Scene &scene = _vm->_game->_scene;
|
||||||
|
if (scene._screenObjects._v832EC) {
|
||||||
|
drawTalkList();
|
||||||
|
} else {
|
||||||
|
// Draw the actions
|
||||||
|
drawActions();
|
||||||
|
drawInventoryList();
|
||||||
|
drawItemVocabList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UserInterface::drawActions() {
|
||||||
|
for (int idx = 0; idx < 10; ++idx) {
|
||||||
|
drawVocab(CAT_ACTION, idx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void UserInterface::drawInventoryList() {
|
||||||
|
int endIndex = MIN((int)_vm->_game->_objects._inventoryList.size(), _inventoryTopIndex + 5);
|
||||||
|
for (int idx = _inventoryTopIndex; idx < endIndex; ++idx) {
|
||||||
|
drawVocab(CAT_INV_LIST, idx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void UserInterface::drawItemVocabList() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void UserInterface::drawVocab(ScrCategory category, int id) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void UserInterface::setBounds(const Common::Rect &r) {
|
void UserInterface::setBounds(const Common::Rect &r) {
|
||||||
_bounds = r;
|
_bounds = r;
|
||||||
|
@ -273,4 +302,9 @@ void UserInterface::moveRect(Common::Rect &bounds) {
|
||||||
bounds.translate(0, MADS_SCENE_HEIGHT);
|
bounds.translate(0, MADS_SCENE_HEIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UserInterface::drawTalkList() {
|
||||||
|
warning("TODO: drawTalkList");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} // End of namespace MADS
|
} // End of namespace MADS
|
||||||
|
|
|
@ -54,6 +54,31 @@ private:
|
||||||
* Reposition a bounding rectangle to physical co-ordinates
|
* Reposition a bounding rectangle to physical co-ordinates
|
||||||
*/
|
*/
|
||||||
void moveRect(Common::Rect &bounds);
|
void moveRect(Common::Rect &bounds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draw options during a conversation.
|
||||||
|
*/
|
||||||
|
void drawTalkList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draw the action list
|
||||||
|
*/
|
||||||
|
void drawActions();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draw the inventory list
|
||||||
|
*/
|
||||||
|
void drawInventoryList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draw the inventory item vocab list
|
||||||
|
*/
|
||||||
|
void drawItemVocabList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draw a vocab text entry
|
||||||
|
*/
|
||||||
|
void drawVocab(ScrCategory category, int id);
|
||||||
public:
|
public:
|
||||||
ScrCategory _category;
|
ScrCategory _category;
|
||||||
int _screenObjectsCount;
|
int _screenObjectsCount;
|
||||||
|
@ -62,6 +87,7 @@ public:
|
||||||
MSurface _surface;
|
MSurface _surface;
|
||||||
int _inventoryTopIndex;
|
int _inventoryTopIndex;
|
||||||
int _objectY;
|
int _objectY;
|
||||||
|
int _selectedObject;
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
@ -80,7 +106,7 @@ public:
|
||||||
|
|
||||||
void elementHighlighted();
|
void elementHighlighted();
|
||||||
|
|
||||||
void writeText();
|
void drawTextElements();
|
||||||
|
|
||||||
void setBounds(const Common::Rect &r);
|
void setBounds(const Common::Rect &r);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue