TITANIC: Rename CPetText to CTextControl

The class is used in several areas outside of the PET, so it makes
better sense to not have it in the pet_control/ folder and named so
This commit is contained in:
Paul Gilbert 2017-01-01 05:24:31 -05:00
parent ab7a152c3a
commit d0d00f6beb
35 changed files with 147 additions and 147 deletions

View File

@ -28,7 +28,7 @@
#include "titanic/support/image.h"
#include "titanic/support/rect.h"
#include "titanic/support/string.h"
#include "titanic/pet_control/pet_text.h"
#include "titanic/gfx/text_control.h"
namespace Titanic {
@ -43,7 +43,7 @@ class CContinueSaveDialog : public CEventTarget {
};
private:
Common::Array<SaveEntry> _saves;
CPetText _slotNames[5];
CTextControl _slotNames[5];
int _highlightedSlot, _selectedSlot;
Point _mousePos;
bool _evilTwinShown;

View File

@ -1081,7 +1081,7 @@ void CGameObject::setMovieFrameRate(double rate) {
void CGameObject::setText(const CString &str, int border, int borderRight) {
if (!_text)
_text = new CPetText();
_text = new CTextControl();
_textBorder = border;
_textBorderRight = borderRight;
@ -1093,7 +1093,7 @@ void CGameObject::setText(const CString &str, int border, int borderRight) {
void CGameObject::setTextHasBorders(bool hasBorders) {
if (!_text)
_text = new CPetText();
_text = new CTextControl();
_text->setHasBorder(hasBorders);
}
@ -1109,14 +1109,14 @@ void CGameObject::setTextBounds() {
void CGameObject::setTextColor(byte r, byte g, byte b) {
if (!_text)
_text = new CPetText();
_text = new CTextControl();
_text->setColor(r, g, b);
}
void CGameObject::setTextFontNumber(int fontNumber) {
if (!_text)
_text = new CPetText();
_text = new CTextControl();
_text->setFontNumber(fontNumber);
}

View File

@ -34,7 +34,7 @@
#include "titanic/support/strings.h"
#include "titanic/support/movie_clip.h"
#include "titanic/pet_control/pet_section.h"
#include "titanic/pet_control/pet_text.h"
#include "titanic/gfx/text_control.h"
#include "titanic/game_state.h"
namespace Titanic {
@ -87,7 +87,7 @@ protected:
int _initialFrame;
CMovieRangeInfoList _movieRangeInfoList;
int _frameNumber;
CPetText *_text;
CTextControl *_text;
uint _textBorder;
uint _textBorderRight;
int _field9C;

View File

@ -20,12 +20,12 @@
*
*/
#include "titanic/pet_control/pet_text.h"
#include "titanic/gfx/text_control.h"
#include "titanic/titanic.h"
namespace Titanic {
CPetText::CPetText(uint count) :
CTextControl::CTextControl(uint count) :
_stringsMerged(false), _maxCharsPerLine(-1), _lineCount(0),
_displayEndCharIndex(-1), _unused1(0), _unused2(0), _unused3(0),
_backR(0xff), _backG(0xff), _backB(0xff),
@ -35,18 +35,18 @@ CPetText::CPetText(uint count) :
setupArrays(count);
}
void CPetText::setupArrays(int count) {
void CTextControl::setupArrays(int count) {
freeArrays();
if (count < 10 || count > 60)
count = 10;
_array.resize(count);
}
void CPetText::freeArrays() {
void CTextControl::freeArrays() {
_array.clear();
}
void CPetText::setup() {
void CTextControl::setup() {
for (int idx = 0; idx < (int)_array.size(); ++idx) {
_array[idx]._line.clear();
setLineColor(idx, _textR, _textG, _textB);
@ -57,16 +57,16 @@ void CPetText::setup() {
_stringsMerged = false;
}
void CPetText::setLineColor(uint lineNum, uint col) {
void CTextControl::setLineColor(uint lineNum, uint col) {
setLineColor(lineNum, col & 0xff, (col >> 8) & 0xff, (col >> 16) & 0xff);
}
void CPetText::setLineColor(uint lineNum, byte r, byte g, byte b) {
void CTextControl::setLineColor(uint lineNum, byte r, byte g, byte b) {
_array[lineNum]._rgb = getColorText(r, g, b);
_stringsMerged = false;
}
CString CPetText::getColorText(byte r, byte g, byte b) {
CString CTextControl::getColorText(byte r, byte g, byte b) {
char buffer[6];
if (!r)
r = 1;
@ -85,7 +85,7 @@ CString CPetText::getColorText(byte r, byte g, byte b) {
return CString(buffer);
}
void CPetText::load(SimpleFile *file, int param) {
void CTextControl::load(SimpleFile *file, int param) {
if (!param) {
uint numLines = file->readNumber();
int charsPerLine = file->readNumber();
@ -116,7 +116,7 @@ void CPetText::load(SimpleFile *file, int param) {
}
}
void CPetText::save(SimpleFile *file, int indent) {
void CTextControl::save(SimpleFile *file, int indent) {
int numLines = _lineCount + 1;
file->writeNumberLine(_array.size(), indent);
@ -143,7 +143,7 @@ void CPetText::save(SimpleFile *file, int indent) {
}
}
void CPetText::draw(CScreenManager *screenManager) {
void CTextControl::draw(CScreenManager *screenManager) {
Rect tempRect = _bounds;
if (_hasBorder) {
@ -179,7 +179,7 @@ void CPetText::draw(CScreenManager *screenManager) {
screenManager->setFontNumber(oldFontNumber);
}
void CPetText::mergeStrings() {
void CTextControl::mergeStrings() {
if (!_stringsMerged) {
_lines.clear();
@ -193,14 +193,14 @@ void CPetText::mergeStrings() {
}
}
void CPetText::resize(uint count) {
void CTextControl::resize(uint count) {
if (!count || _array.size() == count)
return;
_array.clear();
_array.resize(count);
}
CString CPetText::getText() const {
CString CTextControl::getText() const {
CString result = "";
for (int idx = 0; idx <= _lineCount; ++idx)
result += _array[idx]._line;
@ -208,16 +208,16 @@ CString CPetText::getText() const {
return result;
}
void CPetText::setText(const CString &str) {
void CTextControl::setText(const CString &str) {
setup();
appendText(str);
}
void CPetText::setText(StringId stringId) {
void CTextControl::setText(StringId stringId) {
setText(g_vm->_strings[stringId]);
}
void CPetText::appendText(const CString &str) {
void CTextControl::appendText(const CString &str) {
int lineSize = _array[_lineCount]._line.size();
int strSize = str.size();
@ -236,19 +236,19 @@ void CPetText::appendText(const CString &str) {
_stringsMerged = false;
}
void CPetText::setColor(uint col) {
void CTextControl::setColor(uint col) {
_textR = col & 0xff;
_textG = (col >> 8) & 0xff;
_textB = (col >> 16) & 0xff;
}
void CPetText::setColor(byte r, byte g, byte b) {
void CTextControl::setColor(byte r, byte g, byte b) {
_textR = r;
_textG = g;
_textB = b;
}
void CPetText::remapColors(uint count, uint *srcColors, uint *destColors) {
void CTextControl::remapColors(uint count, uint *srcColors, uint *destColors) {
for (int lineNum = 0; lineNum <= _lineCount; ++lineNum) {
if (_array[lineNum]._rgb.empty())
continue;
@ -271,12 +271,12 @@ void CPetText::remapColors(uint count, uint *srcColors, uint *destColors) {
_stringsMerged = false;
}
void CPetText::setMaxCharsPerLine(int maxChars) {
void CTextControl::setMaxCharsPerLine(int maxChars) {
if (maxChars >= -1 && maxChars < 257)
_maxCharsPerLine = maxChars;
}
void CPetText::updateStr3(int lineNum) {
void CTextControl::updateStr3(int lineNum) {
if (_npcFlag > 0 && _npcId > 0) {
char line[5];
line[0] = line[3] = TEXTCMD_NPC;
@ -290,7 +290,7 @@ void CPetText::updateStr3(int lineNum) {
}
}
int CPetText::getTextWidth(CScreenManager *screenManager) {
int CTextControl::getTextWidth(CScreenManager *screenManager) {
mergeStrings();
int oldFontNumber = screenManager->setFontNumber(_fontNumber);
int textWidth = screenManager->stringWidth(_lines);
@ -299,7 +299,7 @@ int CPetText::getTextWidth(CScreenManager *screenManager) {
return textWidth;
}
int CPetText::getTextHeight(CScreenManager *screenManager) {
int CTextControl::getTextHeight(CScreenManager *screenManager) {
mergeStrings();
int oldFontNumber = screenManager->setFontNumber(_fontNumber);
int textHeight = screenManager->getTextBounds(_lines, _bounds.width() - 4);
@ -308,63 +308,63 @@ int CPetText::getTextHeight(CScreenManager *screenManager) {
return textHeight;
}
void CPetText::deleteLastChar() {
void CTextControl::deleteLastChar() {
if (!_array[_lineCount]._line.empty()) {
_array[_lineCount]._line.deleteLastChar();
_stringsMerged = false;
}
}
void CPetText::setNPC(int npcFlag, int npcId) {
void CTextControl::setNPC(int npcFlag, int npcId) {
_npcFlag = npcFlag;
_npcId = npcId;
}
void CPetText::scrollUp(CScreenManager *screenManager) {
void CTextControl::scrollUp(CScreenManager *screenManager) {
int oldFontNumber = screenManager->setFontNumber(_fontNumber);
_scrollTop -= screenManager->getFontHeight();
constrainScrollUp(screenManager);
screenManager->setFontNumber(oldFontNumber);
}
void CPetText::scrollDown(CScreenManager *screenManager) {
void CTextControl::scrollDown(CScreenManager *screenManager) {
int oldFontNumber = screenManager->setFontNumber(_fontNumber);
_scrollTop += screenManager->getFontHeight();
constrainScrollDown(screenManager);
screenManager->setFontNumber(oldFontNumber);
}
void CPetText::scrollUpPage(CScreenManager *screenManager) {
void CTextControl::scrollUpPage(CScreenManager *screenManager) {
int oldFontNumber = screenManager->setFontNumber(_fontNumber);
_scrollTop -= getPageHeight(screenManager);
constrainScrollUp(screenManager);
screenManager->setFontNumber(oldFontNumber);
}
void CPetText::scrollDownPage(CScreenManager *screenManager) {
void CTextControl::scrollDownPage(CScreenManager *screenManager) {
int oldFontNumber = screenManager->setFontNumber(_fontNumber);
_scrollTop += getPageHeight(screenManager);
constrainScrollDown(screenManager);
screenManager->setFontNumber(oldFontNumber);
}
void CPetText::scrollToTop(CScreenManager *screenManager) {
void CTextControl::scrollToTop(CScreenManager *screenManager) {
_scrollTop = 0;
}
void CPetText::scrollToBottom(CScreenManager *screenManager) {
void CTextControl::scrollToBottom(CScreenManager *screenManager) {
int oldFontNumber = screenManager->setFontNumber(_fontNumber);
_scrollTop = getTextHeight(screenManager);
constrainScrollDown(screenManager);
screenManager->setFontNumber(oldFontNumber);
}
void CPetText::constrainScrollUp(CScreenManager *screenManager) {
void CTextControl::constrainScrollUp(CScreenManager *screenManager) {
if (_scrollTop < 0)
_scrollTop = 0;
}
void CPetText::constrainScrollDown(CScreenManager *screenManager) {
void CTextControl::constrainScrollDown(CScreenManager *screenManager) {
// Figure out the maximum scroll amount allowed
int maxScroll = getTextHeight(screenManager) - _bounds.height() - 4;
if (maxScroll < 0)
@ -374,7 +374,7 @@ void CPetText::constrainScrollDown(CScreenManager *screenManager) {
_scrollTop = maxScroll;
}
int CPetText::getPageHeight(CScreenManager *screenManager) {
int CTextControl::getPageHeight(CScreenManager *screenManager) {
int textHeight = _bounds.height();
int oldFontNumber = screenManager->setFontNumber(_fontNumber);
int fontHeight = screenManager->getFontHeight();
@ -390,16 +390,16 @@ int CPetText::getPageHeight(CScreenManager *screenManager) {
}
}
void CPetText::addLine(const CString &str) {
void CTextControl::addLine(const CString &str) {
addLine(str, _textR, _textG, _textB);
}
void CPetText::addLine(const CString &str, uint color) {
void CTextControl::addLine(const CString &str, uint color) {
addLine(str, color & 0xff, (color >> 8) & 0xff,
(color >> 16) & 0xff);
}
void CPetText::addLine(const CString &str, byte r, byte g, byte b) {
void CTextControl::addLine(const CString &str, byte r, byte g, byte b) {
if (_lineCount == ((int)_array.size() - 1)) {
// Lines array is full
if (_array.size() > 1) {
@ -416,7 +416,7 @@ void CPetText::addLine(const CString &str, byte r, byte g, byte b) {
++_lineCount;
}
bool CPetText::handleKey(char c) {
bool CTextControl::handleKey(char c) {
switch (c) {
case (char)Common::KEYCODE_BACKSPACE:
deleteLastChar();
@ -434,7 +434,7 @@ bool CPetText::handleKey(char c) {
return false;
}
void CPetText::showCursor(int mode) {
void CTextControl::showCursor(int mode) {
CScreenManager *screenManager = CScreenManager::setCurrent();
_textCursor = screenManager->_textCursor;
if (_textCursor) {
@ -448,7 +448,7 @@ void CPetText::showCursor(int mode) {
}
}
void CPetText::hideCursor() {
void CTextControl::hideCursor() {
if (_textCursor) {
_textCursor->setMode(-1);
_textCursor->hide();
@ -456,7 +456,7 @@ void CPetText::hideCursor() {
}
}
int CPetText::getNPCNum(uint ident, uint startIndex) {
int CTextControl::getNPCNum(uint ident, uint startIndex) {
if (!_stringsMerged) {
mergeStrings();
if (!_stringsMerged)
@ -483,7 +483,7 @@ int CPetText::getNPCNum(uint ident, uint startIndex) {
return -1;
}
void CPetText::setFontNumber(int fontNumber) {
void CTextControl::setFontNumber(int fontNumber) {
if (fontNumber >= 0 && fontNumber <= 2)
_fontNumber = fontNumber;
}

View File

@ -20,8 +20,8 @@
*
*/
#ifndef TITANIC_PET_TEXT_H
#define TITANIC_PET_TEXT_H
#ifndef TITANIC_TEXT_CONTROL_H
#define TITANIC_TEXT_CONTROL_H
#include "common/keyboard.h"
#include "titanic/support/simple_file.h"
@ -30,7 +30,7 @@
namespace Titanic {
class CPetText {
class CTextControl {
struct ArrayEntry {
CString _line;
CString _rgb;
@ -91,7 +91,7 @@ private:
*/
int getPageHeight(CScreenManager *screenManager);
public:
CPetText(uint count = 10);
CTextControl(uint count = 10);
/**
* Set up the control
@ -282,4 +282,4 @@ public:
} // End of namespace Titanic
#endif /* TITANIC_PET_TEXT_H */
#endif /* TITANIC_TEXT_CONTROL_H */

View File

@ -280,6 +280,7 @@ MODULE_OBJS := \
gfx/chev_right_on.o \
gfx/chev_send_rec_switch.o \
gfx/edit_control.o \
gfx/text_control.o \
gfx/elevator_button.o \
gfx/get_from_succ.o \
gfx/helmet_on_off.o \
@ -398,7 +399,6 @@ MODULE_OBJS := \
pet_control/pet_show_translation.o \
pet_control/pet_slider.o \
pet_control/pet_sound.o \
pet_control/pet_text.o \
sound/auto_music_player.o \
sound/auto_music_player_base.o \
sound/auto_sound_player.o \

View File

@ -24,7 +24,7 @@
#define TITANIC_PET_CONVERSATIONS_H
#include "titanic/pet_control/pet_section.h"
#include "titanic/pet_control/pet_text.h"
#include "titanic/gfx/text_control.h"
#include "titanic/pet_control/pet_gfx_element.h"
#include "titanic/true_talk/true_talk_manager.h"
@ -48,8 +48,8 @@ private:
CPetGfxElement _splitter;
CPetGfxElement _npcIcons[9];
int _npcNum;
CPetText _log;
CPetText _textInput;
CTextControl _log;
CTextControl _textInput;
bool _logChanged;
int _field418;
CString _npcName;

View File

@ -39,7 +39,7 @@ void CPetGlyph::drawAt(CScreenManager *screenManager, const Point &pt, bool isHi
}
void CPetGlyph::updateTooltip() {
CPetText *petText = getPetSection()->getText();
CTextControl *petText = getPetSection()->getText();
if (petText) {
petText->setColor(getPetSection()->getColor(0));
getTooltip(petText);

View File

@ -35,7 +35,7 @@ namespace Titanic {
class CPetGlyphs;
class CPetSection;
class CPetText;
class CTextControl;
enum GlyphActionMode { ACTION_REMOVE = 0, ACTION_REMOVED = 1, ACTION_CHANGE = 2 };
@ -177,7 +177,7 @@ public:
/**
* Returns the tooltip text for when the glyph is selected
*/
virtual void getTooltip(CPetText *text) {}
virtual void getTooltip(CTextControl *text) {}
/**
* Saves the data for the glyph

View File

@ -26,7 +26,7 @@
#include "titanic/support/simple_file.h"
#include "titanic/pet_control/pet_section.h"
#include "titanic/pet_control/pet_inventory_glyphs.h"
#include "titanic/pet_control/pet_text.h"
#include "titanic/gfx/text_control.h"
namespace Titanic {
@ -35,7 +35,7 @@ namespace Titanic {
*/
class CPetInventory : public CPetSection {
private:
CPetText _text;
CTextControl _text;
CPetInventoryGlyphs _items;
CGameObject *_itemBackgrounds[46];
CGameObject *_itemGlyphs[46];
@ -134,7 +134,7 @@ public:
/**
* Get a reference to the tooltip text associated with the section
*/
virtual CPetText *getText() { return &_text; }
virtual CTextControl *getText() { return &_text; }
/**
* Special retrieval of glyph background image

View File

@ -143,7 +143,7 @@ bool CPetInventoryGlyph::dragGlyph(const Point &topLeft, CMouseDragStartMsg *msg
}
}
void CPetInventoryGlyph::getTooltip(CPetText *text) {
void CPetInventoryGlyph::getTooltip(CTextControl *text) {
if (text) {
text->setText("");

View File

@ -106,7 +106,7 @@ public:
/**
* Returns the tooltip text for when the glyph is selected
*/
virtual void getTooltip(CPetText *text);
virtual void getTooltip(CTextControl *text);
/**
* Return whether the glyph is currently valid

View File

@ -50,7 +50,7 @@ bool CPetLoad::MouseButtonUpMsg(const Point &pt) {
}
}
void CPetLoad::getTooltip(CPetText *text) {
void CPetLoad::getTooltip(CTextControl *text) {
text->setText("Load the game.");
}

View File

@ -47,7 +47,7 @@ public:
/**
* Returns the tooltip text for when the glyph is selected
*/
virtual void getTooltip(CPetText *text);
virtual void getTooltip(CTextControl *text);
/**
* Highlights a save slot

View File

@ -24,7 +24,7 @@
#define TITANIC_PET_LOAD_SAVE_H
#include "titanic/pet_control/pet_glyphs.h"
#include "titanic/pet_control/pet_text.h"
#include "titanic/gfx/text_control.h"
namespace Titanic {
@ -52,7 +52,7 @@ private:
*/
bool isSlotHighlighted(int index, const Point &pt);
protected:
CPetText _slotNames[SAVEGAME_SLOTS_COUNT];
CTextControl _slotNames[SAVEGAME_SLOTS_COUNT];
bool _slotInUse[SAVEGAME_SLOTS_COUNT];
CPetGfxElement _btnLoadSave;
CPetGfxElement _gutter;

View File

@ -83,7 +83,7 @@ bool CPetQuit::MouseButtonUpMsg(const Point &pt) {
}
}
void CPetQuit::getTooltip(CPetText *text) {
void CPetQuit::getTooltip(CTextControl *text) {
text->setText("Quit the game.");
}

View File

@ -25,13 +25,13 @@
#include "titanic/pet_control/pet_gfx_element.h"
#include "titanic/pet_control/pet_glyphs.h"
#include "titanic/pet_control/pet_text.h"
#include "titanic/gfx/text_control.h"
namespace Titanic {
class CPetQuit : public CPetGlyph {
private:
CPetText _text;
CTextControl _text;
CPetGfxElement _btnYes;
public:
/**
@ -62,12 +62,12 @@ public:
/**
* Returns the tooltip text for when the glyph is selected
*/
virtual void getTooltip(CPetText *text);
virtual void getTooltip(CTextControl *text);
/**
* Get a reference to the tooltip text associated with the section
*/
virtual CPetText *getText() { return &_text; }
virtual CTextControl *getText() { return &_text; }
};
} // End of namespace Titanic

View File

@ -25,7 +25,7 @@
#include "titanic/pet_control/pet_section.h"
#include "titanic/pet_control/pet_glyphs.h"
#include "titanic/pet_control/pet_text.h"
#include "titanic/gfx/text_control.h"
namespace Titanic {
@ -35,7 +35,7 @@ class CPetSaveGlyphs : public CPetGlyphs {
class CPetRealLife : public CPetSection {
private:
CPetGlyphs _glyphs;
CPetText _text;
CTextControl _text;
private:
/**
* Does setup
@ -124,7 +124,7 @@ public:
/**
* Get a reference to the tooltip text associated with the section
*/
virtual CPetText *getText() { return &_text; }
virtual CTextControl *getText() { return &_text; }
};

View File

@ -202,7 +202,7 @@ void CPetRemote::enterRoom(CRoomItem *room) {
}
}
CPetText *CPetRemote::getText() {
CTextControl *CPetRemote::getText() {
return &_text;
}

View File

@ -27,7 +27,7 @@
#include "titanic/pet_control/pet_section.h"
#include "titanic/pet_control/pet_glyphs.h"
#include "titanic/pet_control/pet_remote_glyphs.h"
#include "titanic/pet_control/pet_text.h"
#include "titanic/gfx/text_control.h"
namespace Titanic {
@ -45,7 +45,7 @@ private:
CPetGfxElement _send;
CPetGfxElement _receive;
CPetGfxElement _call;
CPetText _text;
CTextControl _text;
private:
/**
* Setup the control
@ -137,7 +137,7 @@ public:
/**
* Get a reference to the tooltip text associated with the section
*/
virtual CPetText *getText();
virtual CTextControl *getText();
/**
* Get an element from the section by a designated Id

View File

@ -81,7 +81,7 @@ bool CBasicRemoteGlyph::MouseButtonUpMsg(const Point &pt) {
return false;
}
void CBasicRemoteGlyph::getTooltip(CPetText *text) {
void CBasicRemoteGlyph::getTooltip(CTextControl *text) {
text->setText(_tooltip);
}
@ -160,7 +160,7 @@ bool CRemoteGotoGlyph::MouseButtonUpMsg(const Point &pt) {
return true;
}
void CRemoteGotoGlyph::getTooltip(CPetText *text) {
void CRemoteGotoGlyph::getTooltip(CTextControl *text) {
text->setText(_tooltip);
}
@ -216,7 +216,7 @@ bool CTelevisionControlGlyph::MouseButtonUpMsg(const Point &pt) {
return false;
}
void CTelevisionControlGlyph::getTooltip(CPetText *text) {
void CTelevisionControlGlyph::getTooltip(CTextControl *text) {
text->setText(TELEVISION_CONTROL);
}
@ -280,7 +280,7 @@ bool CEntertainmentDeviceGlyph::MouseButtonUpMsg(const Point &pt) {
return false;
}
void CEntertainmentDeviceGlyph::getTooltip(CPetText *text) {
void CEntertainmentDeviceGlyph::getTooltip(CTextControl *text) {
text->setText(OPERATE_ENTERTAINMENT);
}
@ -334,7 +334,7 @@ bool COperateLightsGlyph::MouseButtonUpMsg(const Point &pt) {
return true;
}
void COperateLightsGlyph::getTooltip(CPetText *text) {
void COperateLightsGlyph::getTooltip(CTextControl *text) {
text->setText(OPERATE_LIGHTS);
}
@ -346,7 +346,7 @@ bool CDeployFloralGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
return true;
}
void CDeployFloralGlyph::getTooltip(CPetText *text) {
void CDeployFloralGlyph::getTooltip(CTextControl *text) {
text->setText(DEPLOY_FLORAL_ENHANCEMENT);
}
@ -359,7 +359,7 @@ bool CDeployFullyRelaxationGlyph::setup(CPetControl *petControl, CPetGlyphs *own
return true;
}
void CDeployFullyRelaxationGlyph::getTooltip(CPetText *text) {
void CDeployFullyRelaxationGlyph::getTooltip(CTextControl *text) {
text->setText(DEPLOY_FULLY_RELAXATION);
}
@ -371,7 +371,7 @@ bool CDeployComfortGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
return true;
}
void CDeployComfortGlyph::getTooltip(CPetText *text) {
void CDeployComfortGlyph::getTooltip(CTextControl *text) {
text->setText(DEPLOY_COMFORT_WORKSTATION);
}
@ -383,7 +383,7 @@ bool CDeployMinorStorageGlyph::setup(CPetControl *petControl, CPetGlyphs *owner)
return true;
}
void CDeployMinorStorageGlyph::getTooltip(CPetText *text) {
void CDeployMinorStorageGlyph::getTooltip(CTextControl *text) {
text->setText(DEPLOY_MINOR_STORAGE);
}
@ -395,7 +395,7 @@ bool CDeployMajorRelaxationGlyph::setup(CPetControl *petControl, CPetGlyphs *own
return true;
}
void CDeployMajorRelaxationGlyph::getTooltip(CPetText *text) {
void CDeployMajorRelaxationGlyph::getTooltip(CTextControl *text) {
text->setText(DEPLOY_MAJOR_RELAXATION);
}
@ -407,7 +407,7 @@ bool CInflateRelaxationGlyph::setup(CPetControl *petControl, CPetGlyphs *owner)
return true;
}
void CInflateRelaxationGlyph::getTooltip(CPetText *text) {
void CInflateRelaxationGlyph::getTooltip(CTextControl *text) {
text->setText(INFLATE_RELAXATION_DEVICE);
}
@ -419,7 +419,7 @@ bool CDeployMaintenanceGlyph::setup(CPetControl *petControl, CPetGlyphs *owner)
return true;
}
void CDeployMaintenanceGlyph::getTooltip(CPetText *text) {
void CDeployMaintenanceGlyph::getTooltip(CTextControl *text) {
text->setText(DEPLOY_MAINTENANCE_HUB);
}
@ -431,7 +431,7 @@ bool CDeployWorkSurfaceGlyph::setup(CPetControl *petControl, CPetGlyphs *owner)
return true;
}
void CDeployWorkSurfaceGlyph::getTooltip(CPetText *text) {
void CDeployWorkSurfaceGlyph::getTooltip(CTextControl *text) {
text->setText(DEPLOY_EXECUTIVE_SURFACE);
}
@ -443,7 +443,7 @@ bool CDeployMinorRelaxationGlyph::setup(CPetControl *petControl, CPetGlyphs *own
return true;
}
void CDeployMinorRelaxationGlyph::getTooltip(CPetText *text) {
void CDeployMinorRelaxationGlyph::getTooltip(CTextControl *text) {
text->setText(DEPLOY_MINOR_RELAXATION);
}
@ -455,7 +455,7 @@ bool CDeploySinkGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
return true;
}
void CDeploySinkGlyph::getTooltip(CPetText *text) {
void CDeploySinkGlyph::getTooltip(CTextControl *text) {
text->setText(DEPLOY_SINK);
}
@ -467,7 +467,7 @@ bool CDeployMajorStorageGlyph::setup(CPetControl *petControl, CPetGlyphs *owner)
return true;
}
void CDeployMajorStorageGlyph::getTooltip(CPetText *text) {
void CDeployMajorStorageGlyph::getTooltip(CTextControl *text) {
text->setText(DEPLOY_MAJOR_STORAGE);
}
@ -515,7 +515,7 @@ bool CSuccubusDeliveryGlyph::MouseButtonUpMsg(const Point &pt) {
return true;
}
void CSuccubusDeliveryGlyph::getTooltip(CPetText *text) {
void CSuccubusDeliveryGlyph::getTooltip(CTextControl *text) {
text->setText(SUCCUBUS_DELIVERY_SYSTEM);
}
@ -554,7 +554,7 @@ bool CNavigationControllerGlyph::MouseButtonUpMsg(const Point &pt) {
return true;
}
void CNavigationControllerGlyph::getTooltip(CPetText *text) {
void CNavigationControllerGlyph::getTooltip(CTextControl *text) {
text->setText(NAVIGATION_CONTROLLER);
}

View File

@ -116,7 +116,7 @@ public:
/**
* Returns the tooltip text for when the glyph is selected
*/
virtual void getTooltip(CPetText *text);
virtual void getTooltip(CTextControl *text);
};
class CToggleRemoteGlyph : public CPetRemoteGlyph {
@ -181,7 +181,7 @@ public:
/**
* Returns the tooltip text for when the glyph is selected
*/
virtual void getTooltip(CPetText *text);
virtual void getTooltip(CTextControl *text);
};
class CSummonElevatorGlyph : public CBasicRemoteGlyph {
@ -225,7 +225,7 @@ public:
/**
* Returns the tooltip text for when the glyph is selected
*/
virtual void getTooltip(CPetText *text);
virtual void getTooltip(CTextControl *text);
};
class CEntertainmentDeviceGlyph : public CToggleRemoteGlyph {
@ -259,7 +259,7 @@ public:
/**
* Returns the tooltip text for when the glyph is selected
*/
virtual void getTooltip(CPetText *text);
virtual void getTooltip(CTextControl *text);
};
@ -293,7 +293,7 @@ public:
/**
* Returns the tooltip text for when the glyph is selected
*/
virtual void getTooltip(CPetText *text);
virtual void getTooltip(CTextControl *text);
};
class CDeployFloralGlyph : public CToggleRemoteGlyph {
@ -320,7 +320,7 @@ public:
/**
* Returns the tooltip text for when the glyph is selected
*/
virtual void getTooltip(CPetText *text);
virtual void getTooltip(CTextControl *text);
};
class CDeployFullyRelaxationGlyph : public CToggleRemoteGlyph {
@ -347,7 +347,7 @@ public:
/**
* Returns the tooltip text for when the glyph is selected
*/
virtual void getTooltip(CPetText *text);
virtual void getTooltip(CTextControl *text);
};
class CDeployComfortGlyph : public CToggleRemoteGlyph {
@ -374,7 +374,7 @@ public:
/**
* Returns the tooltip text for when the glyph is selected
*/
virtual void getTooltip(CPetText *text);
virtual void getTooltip(CTextControl *text);
};
class CDeployMinorStorageGlyph : public CToggleRemoteGlyph {
@ -401,7 +401,7 @@ public:
/**
* Returns the tooltip text for when the glyph is selected
*/
virtual void getTooltip(CPetText *text);
virtual void getTooltip(CTextControl *text);
};
class CDeployMajorRelaxationGlyph : public CToggleRemoteGlyph {
@ -428,7 +428,7 @@ public:
/**
* Returns the tooltip text for when the glyph is selected
*/
virtual void getTooltip(CPetText *text);
virtual void getTooltip(CTextControl *text);
};
class CInflateRelaxationGlyph : public CToggleRemoteGlyph {
@ -455,7 +455,7 @@ public:
/**
* Returns the tooltip text for when the glyph is selected
*/
virtual void getTooltip(CPetText *text);
virtual void getTooltip(CTextControl *text);
};
class CDeployMaintenanceGlyph : public CToggleRemoteGlyph {
@ -482,7 +482,7 @@ public:
/**
* Returns the tooltip text for when the glyph is selected
*/
virtual void getTooltip(CPetText *text);
virtual void getTooltip(CTextControl *text);
};
class CDeployWorkSurfaceGlyph : public CToggleRemoteGlyph {
@ -509,7 +509,7 @@ public:
/**
* Returns the tooltip text for when the glyph is selected
*/
virtual void getTooltip(CPetText *text);
virtual void getTooltip(CTextControl *text);
};
class CDeployMinorRelaxationGlyph : public CToggleRemoteGlyph {
@ -536,7 +536,7 @@ public:
/**
* Returns the tooltip text for when the glyph is selected
*/
virtual void getTooltip(CPetText *text);
virtual void getTooltip(CTextControl *text);
};
class CDeploySinkGlyph : public CToggleRemoteGlyph {
@ -563,7 +563,7 @@ public:
/**
* Returns the tooltip text for when the glyph is selected
*/
virtual void getTooltip(CPetText *text);
virtual void getTooltip(CTextControl *text);
};
class CDeployMajorStorageGlyph : public CToggleRemoteGlyph {
@ -590,7 +590,7 @@ public:
/**
* Returns the tooltip text for when the glyph is selected
*/
virtual void getTooltip(CPetText *text);
virtual void getTooltip(CTextControl *text);
};
class CSuccubusDeliveryGlyph : public CPetRemoteGlyph {
@ -623,7 +623,7 @@ public:
/**
* Returns the tooltip text for when the glyph is selected
*/
virtual void getTooltip(CPetText *text);
virtual void getTooltip(CTextControl *text);
};
class CNavigationControllerGlyph : public CPetRemoteGlyph {
@ -657,7 +657,7 @@ public:
/**
* Returns the tooltip text for when the glyph is selected
*/
virtual void getTooltip(CPetText *text);
virtual void getTooltip(CTextControl *text);
};
class CGotoBottomOfWellGlyph : public CRemoteGotoGlyph {

View File

@ -170,7 +170,7 @@ void CPetRooms::enterRoom(CRoomItem *room) {
resetHighlight();
}
CPetText *CPetRooms::getText() {
CTextControl *CPetRooms::getText() {
return &_text;
}

View File

@ -24,7 +24,7 @@
#define TITANIC_PET_ROOMS_H
#include "titanic/pet_control/pet_section.h"
#include "titanic/pet_control/pet_text.h"
#include "titanic/gfx/text_control.h"
#include "titanic/pet_control/pet_rooms_glyphs.h"
#include "titanic/game_location.h"
@ -43,7 +43,7 @@ private:
CGameObject *_chevRightOnLit;
CGameObject *_chevRightOffLit;
CPetGfxElement _plinth;
CPetText _text;
CTextControl _text;
int _floorNum;
int _elevatorNum;
int _roomNum;
@ -141,7 +141,7 @@ public:
/**
* Get a reference to the tooltip text associated with the section
*/
virtual CPetText *getText();
virtual CTextControl *getText();
/**
* Special retrieval of glyph background image

View File

@ -141,7 +141,7 @@ bool CPetRoomsGlyph::dragGlyph(const Point &topLeft, CMouseDragStartMsg *msg) {
return false;
}
void CPetRoomsGlyph::getTooltip(CPetText *text) {
void CPetRoomsGlyph::getTooltip(CTextControl *text) {
CRoomFlags roomFlags(_roomFlags);
CPetRooms *owner = static_cast<CPetRooms *>(getPetSection());

View File

@ -89,7 +89,7 @@ public:
/**
* Returns the tooltip text for when the glyph is selected
*/
virtual void getTooltip(CPetText *text);
virtual void getTooltip(CTextControl *text);
/**
* Saves the data for the glyph

View File

@ -64,7 +64,7 @@ void CPetSave::highlightCurrent(const Point &pt) {
highlightSave(_savegameSlotNum);
}
void CPetSave::getTooltip(CPetText *text) {
void CPetSave::getTooltip(CTextControl *text) {
text->setText("Save the game.");
}

View File

@ -57,7 +57,7 @@ public:
/**
* Returns the tooltip text for when the glyph is selected
*/
virtual void getTooltip(CPetText *text);
virtual void getTooltip(CTextControl *text);
/**
* Called on a highlighted item when PET area is entered

View File

@ -39,7 +39,7 @@ static const uint PALETTE3[5] = {
};
void CPetSection::displayMessage(const CString &msg) {
CPetText *text = getText();
CTextControl *text = getText();
if (text) {
text->setColor(getColor(1));
@ -64,7 +64,7 @@ void CPetSection::removeText(int duration) {
}
void CPetSection::removeText() {
CPetText *text = getText();
CTextControl *text = getText();
if (text)
text->setup();
}

View File

@ -35,7 +35,7 @@ enum PetArea {
class CPetControl;
class CPetElement;
class CPetText;
class CTextControl;
class CScreenManager;
class CRoomItem;
@ -170,7 +170,7 @@ public:
/**
* Get a reference to the tooltip text associated with the section
*/
virtual CPetText *getText() { return nullptr; }
virtual CTextControl *getText() { return nullptr; }
/**
* Removes text after a given duration

View File

@ -275,7 +275,7 @@ bool CPetSound::MouseButtonUpMsg(const Point &pt) {
return true;
}
void CPetSound::getTooltip(CPetText *text) {
void CPetSound::getTooltip(CTextControl *text) {
text->setText("Change the volume settings.");
}

View File

@ -25,7 +25,7 @@
#include "titanic/pet_control/pet_glyphs.h"
#include "titanic/pet_control/pet_gfx_element.h"
#include "titanic/pet_control/pet_text.h"
#include "titanic/gfx/text_control.h"
#include "titanic/pet_control/pet_slider.h"
namespace Titanic {
@ -39,10 +39,10 @@ private:
CPetSlider _musicVolume;
CPetSlider _parrotVolume;
CPetSlider _speechVolume;
CPetText _textMasterVolume;
CPetText _textMusicVolume;
CPetText _textParrotVolume;
CPetText _textSpeechVolume;
CTextControl _textMasterVolume;
CTextControl _textMusicVolume;
CTextControl _textParrotVolume;
CTextControl _textSpeechVolume;
CPetSlider *_draggingSlider;
int _draggingSliderNum;
private:
@ -96,7 +96,7 @@ public:
/**
* Returns the tooltip text for when the glyph is selected
*/
virtual void getTooltip(CPetText *text);
virtual void getTooltip(CTextControl *text);
};
} // End of namespace Titanic

View File

@ -24,7 +24,7 @@
#define TITANIC_PET_STARFIELD_H
#include "titanic/pet_control/pet_section.h"
#include "titanic/pet_control/pet_text.h"
#include "titanic/gfx/text_control.h"
#include "titanic/pet_control/pet_gfx_element.h"
namespace Titanic {
@ -39,7 +39,7 @@ private:
CPetGfxElement _leds[6];
Rect _rect1;
int _field18C;
CPetText _text;
CTextControl _text;
bool _photoOn;
bool _hasReference;
private:

View File

@ -61,8 +61,8 @@ void CPetTranslation::clearTranslation() {
void CPetTranslation::addTranslation(const CString &str1, const CString &str2) {
CString msg = CString::format("%s%s - %s%s",
CPetText::getColorText(0, 0x80, 0).c_str(), str1.c_str(),
CPetText::getColorText(0, 0, 0).c_str(), str2.c_str());
CTextControl::getColorText(0, 0x80, 0).c_str(), str1.c_str(),
CTextControl::getColorText(0, 0, 0).c_str(), str2.c_str());
_message.addLine(msg);
_petControl->makeDirty();
}

View File

@ -24,14 +24,14 @@
#define TITANIC_PET_TRANSLATION_H
#include "titanic/pet_control/pet_section.h"
#include "titanic/pet_control/pet_text.h"
#include "titanic/gfx/text_control.h"
namespace Titanic {
class CPetTranslation : public CPetSection {
private:
CPetText _message;
CPetText _tooltip;
CTextControl _message;
CTextControl _tooltip;
private:
/**
* Setup the control
@ -87,7 +87,7 @@ public:
/**
* Get a reference to the tooltip text associated with the section
*/
virtual CPetText *getText() { return &_tooltip; }
virtual CTextControl *getText() { return &_tooltip; }
/**
* Clear any current translation text