mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
TITANIC: Stubs for selecting highlighted PET glyph
This commit is contained in:
@@ -371,8 +371,8 @@ void CPetControl::addToInventory(CCarry *item) {
|
||||
_inventory.itemsChanged();
|
||||
|
||||
setArea(PET_INVENTORY);
|
||||
if (_currentArea != PET_INVENTORY)
|
||||
_inventory.couldntShowInventory(item);
|
||||
if (_currentArea == PET_INVENTORY)
|
||||
_inventory.highlightItem(item);
|
||||
|
||||
makeDirty();
|
||||
CPETGainedObjectMsg msg;
|
||||
|
||||
@@ -50,7 +50,7 @@ bool CPetGlyph::translateContains(const Point &delta, const Point &pt) {
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
void CPetGlyphs::clear() {
|
||||
fn1(-1);
|
||||
changeHighlight(-1);
|
||||
destroyContents();
|
||||
_field10 = 0;
|
||||
}
|
||||
@@ -75,8 +75,12 @@ void CPetGlyphs::draw(CScreenManager *screenManager) {
|
||||
warning("TODO: CPetGlyphs::draw");
|
||||
}
|
||||
|
||||
void CPetGlyphs::fn1(int val) {
|
||||
warning("TODO: CPetGlyphs::fn1");
|
||||
void CPetGlyphs::changeHighlight(int index) {
|
||||
warning("TODO: CPetGlyphs::changeHighlight");
|
||||
}
|
||||
|
||||
void CPetGlyphs::highlight(int index) {
|
||||
warning("TODO: CPetGlyphs::highlight");
|
||||
}
|
||||
|
||||
} // End of namespace Titanic
|
||||
|
||||
@@ -117,7 +117,10 @@ protected:
|
||||
CPetGfxElement _scrollLeft;
|
||||
CPetGfxElement _scrollRight;
|
||||
protected:
|
||||
void fn1(int val);
|
||||
/**
|
||||
* Change the currently selected glyph
|
||||
*/
|
||||
void changeHighlight(int index);
|
||||
public:
|
||||
CPetGlyphs::CPetGlyphs() : _field10(0), _field14(7),
|
||||
_field18(-1), _field1C(-1), _field20(0), _field24(0) {
|
||||
@@ -145,6 +148,11 @@ public:
|
||||
* Draw the control
|
||||
*/
|
||||
void draw(CScreenManager *screenManager);
|
||||
|
||||
/**
|
||||
* Highlight a specific glyph
|
||||
*/
|
||||
void highlight(int index);
|
||||
};
|
||||
|
||||
} // End of namespace Titanic
|
||||
|
||||
@@ -133,8 +133,19 @@ void CPetInventory::itemsChanged() {
|
||||
}
|
||||
}
|
||||
|
||||
void CPetInventory::couldntShowInventory(CCarry *item) {
|
||||
|
||||
void CPetInventory::highlightItem(CGameObject *item) {
|
||||
int itemIndex = getItemIndex(item);
|
||||
_items.highlight(itemIndex);
|
||||
}
|
||||
|
||||
int CPetInventory::getItemIndex(CGameObject *item) const {
|
||||
int index = 0;
|
||||
for (CGameObject *obj = _petControl->getFirstObject(); obj && obj != item;
|
||||
++index, obj = _petControl->getNextObject(obj)) {
|
||||
}
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
|
||||
} // End of namespace Titanic
|
||||
|
||||
@@ -48,6 +48,11 @@ private:
|
||||
* Handles initial setup
|
||||
*/
|
||||
bool setPetControl(CPetControl *petControl);
|
||||
|
||||
/**
|
||||
* Get the index of an item added to the PET
|
||||
*/
|
||||
int getItemIndex(CGameObject *item) const;
|
||||
public:
|
||||
CPetInventory();
|
||||
|
||||
@@ -111,7 +116,7 @@ public:
|
||||
/**
|
||||
* Called when the inventory can't be shown after adding an item
|
||||
*/
|
||||
void couldntShowInventory(CCarry *item);
|
||||
void highlightItem(CGameObject *item);
|
||||
};
|
||||
|
||||
} // End of namespace Titanic
|
||||
|
||||
Reference in New Issue
Block a user