2015-01-03 03:19:14 -10:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef XEEN_INTERFACE_H
|
|
|
|
#define XEEN_INTERFACE_H
|
|
|
|
|
|
|
|
#include "common/scummsys.h"
|
|
|
|
#include "xeen/dialogs.h"
|
2015-01-14 20:39:56 -05:00
|
|
|
#include "xeen/interface_map.h"
|
2015-01-03 03:19:14 -10:00
|
|
|
#include "xeen/party.h"
|
2015-01-03 19:08:30 -05:00
|
|
|
#include "xeen/screen.h"
|
2015-01-03 03:19:14 -10:00
|
|
|
|
|
|
|
namespace Xeen {
|
|
|
|
|
|
|
|
class XeenEngine;
|
|
|
|
|
2015-01-19 15:29:57 -05:00
|
|
|
#define MINIMAP_SIZE 7
|
2015-01-27 22:57:46 -05:00
|
|
|
#define HILIGHT_CHAR_DISABLED -2
|
2017-11-23 19:07:26 -05:00
|
|
|
#define HILIGHT_CHAR_NONE -1
|
2015-01-19 15:29:57 -05:00
|
|
|
|
2015-02-10 19:28:45 -05:00
|
|
|
/**
|
|
|
|
* Class responsible for drawing the images of the characters in the party
|
|
|
|
*/
|
|
|
|
class PartyDrawer {
|
2015-01-03 03:19:14 -10:00
|
|
|
private:
|
|
|
|
XeenEngine *_vm;
|
2015-01-22 07:53:33 -05:00
|
|
|
SpriteResource _dseFace;
|
2015-01-03 19:08:30 -05:00
|
|
|
SpriteResource _hpSprites;
|
2015-02-10 19:28:45 -05:00
|
|
|
SpriteResource _restoreSprites;
|
|
|
|
int _hiliteChar;
|
|
|
|
public:
|
|
|
|
PartyDrawer(XeenEngine *vm);
|
|
|
|
|
|
|
|
void drawParty(bool updateFlag);
|
|
|
|
|
|
|
|
void highlightChar(int charId);
|
|
|
|
|
|
|
|
void unhighlightChar();
|
2015-02-16 19:58:53 -05:00
|
|
|
|
|
|
|
void resetHighlight();
|
2015-02-10 19:28:45 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements the main in-game interface
|
|
|
|
*/
|
|
|
|
class Interface: public ButtonContainer, public InterfaceMap, public PartyDrawer {
|
|
|
|
private:
|
|
|
|
XeenEngine *_vm;
|
2015-01-05 08:11:16 -05:00
|
|
|
SpriteResource _uiSprites;
|
2015-01-05 15:10:42 -05:00
|
|
|
SpriteResource _iconSprites;
|
2015-02-15 14:20:35 -05:00
|
|
|
SpriteResource _borderSprites;
|
|
|
|
SpriteResource _spellFxSprites;
|
|
|
|
SpriteResource _fecpSprites;
|
|
|
|
SpriteResource _blessSprites;
|
2015-01-05 15:10:42 -05:00
|
|
|
DrawStruct _mainList[16];
|
2015-01-03 03:19:14 -10:00
|
|
|
|
|
|
|
bool _buttonsLoaded;
|
2015-01-19 12:13:03 -05:00
|
|
|
int _steppingFX;
|
2015-02-15 14:43:04 -05:00
|
|
|
int _blessedUIFrame;
|
|
|
|
int _powerShieldUIFrame;
|
|
|
|
int _holyBonusUIFrame;
|
|
|
|
int _heroismUIFrame;
|
|
|
|
int _flipUIFrame;
|
2015-01-05 21:17:44 -05:00
|
|
|
|
2015-01-05 15:10:42 -05:00
|
|
|
void initDrawStructs();
|
|
|
|
|
2015-01-14 20:39:56 -05:00
|
|
|
void loadSprites();
|
|
|
|
|
2015-01-03 03:19:14 -10:00
|
|
|
void setupBackground();
|
2015-01-03 19:08:30 -05:00
|
|
|
|
2015-02-16 14:35:23 -05:00
|
|
|
void setMainButtons(bool combatMode = false);
|
2015-01-11 20:35:32 -05:00
|
|
|
|
2015-01-19 11:32:57 -05:00
|
|
|
void chargeStep();
|
2015-01-19 12:13:03 -05:00
|
|
|
|
2016-08-28 17:52:56 -04:00
|
|
|
/**
|
|
|
|
* Handles incrementing game time
|
|
|
|
*/
|
2015-01-19 12:13:03 -05:00
|
|
|
void stepTime();
|
|
|
|
|
|
|
|
void doStepCode();
|
2015-01-19 18:42:40 -05:00
|
|
|
|
2016-08-28 17:52:56 -04:00
|
|
|
/**
|
|
|
|
* Check movement in the given direction
|
|
|
|
*/
|
2015-01-19 18:42:40 -05:00
|
|
|
bool checkMoveDirection(int key);
|
2015-02-15 12:01:04 -05:00
|
|
|
|
2016-08-28 17:52:56 -04:00
|
|
|
/**
|
|
|
|
* Handle doing the falling
|
|
|
|
*/
|
2015-02-15 12:01:04 -05:00
|
|
|
void handleFalling();
|
|
|
|
|
|
|
|
void saveFall();
|
|
|
|
|
|
|
|
void fall(int v);
|
|
|
|
|
2016-08-28 17:52:56 -04:00
|
|
|
/**
|
|
|
|
* Shake the screen
|
|
|
|
*/
|
2015-02-15 12:20:44 -05:00
|
|
|
void shake(int time);
|
2015-02-15 12:26:23 -05:00
|
|
|
|
2016-08-28 17:52:56 -04:00
|
|
|
/**
|
|
|
|
* Draw the minimap
|
|
|
|
*/
|
2015-02-15 12:26:23 -05:00
|
|
|
void drawMiniMap();
|
2015-02-16 19:58:53 -05:00
|
|
|
|
2016-08-28 17:52:56 -04:00
|
|
|
/**
|
|
|
|
* Select next character or monster to be attacking
|
|
|
|
*/
|
2015-02-16 19:58:53 -05:00
|
|
|
void nextChar();
|
2015-01-20 08:20:07 -05:00
|
|
|
public:
|
|
|
|
int _intrIndex1;
|
2015-01-23 20:44:02 -05:00
|
|
|
Common::String _interfaceText;
|
2015-02-15 14:10:37 -05:00
|
|
|
int _falling;
|
2015-02-15 14:43:04 -05:00
|
|
|
int _face1State, _face2State;
|
|
|
|
int _face1UIFrame, _face2UIFrame;
|
|
|
|
int _spotDoorsUIFrame;
|
|
|
|
int _dangerSenseUIFrame;
|
2015-02-22 23:45:11 -05:00
|
|
|
int _levitateUIFrame;
|
2015-02-15 14:43:04 -05:00
|
|
|
bool _upDoorText;
|
|
|
|
Common::String _screenText;
|
|
|
|
byte _tillMove;
|
2015-02-28 18:43:04 -05:00
|
|
|
int _charFX[6];
|
2015-01-03 03:19:14 -10:00
|
|
|
public:
|
|
|
|
Interface(XeenEngine *vm);
|
|
|
|
|
2015-01-22 07:53:33 -05:00
|
|
|
virtual ~Interface() {}
|
|
|
|
|
2015-02-15 14:20:35 -05:00
|
|
|
void setup();
|
2015-01-05 21:17:44 -05:00
|
|
|
|
2015-01-05 08:11:16 -05:00
|
|
|
void manageCharacters(bool soundPlayed);
|
|
|
|
|
2015-01-05 15:10:42 -05:00
|
|
|
void startup();
|
|
|
|
|
|
|
|
void mainIconsPrint();
|
2015-01-19 11:32:57 -05:00
|
|
|
|
2016-08-28 17:52:56 -04:00
|
|
|
/**
|
|
|
|
* Start the party falling
|
|
|
|
*/
|
2015-02-15 14:10:37 -05:00
|
|
|
void startFalling(bool v);
|
2015-01-20 08:46:27 -05:00
|
|
|
|
2016-08-28 17:52:56 -04:00
|
|
|
/**
|
|
|
|
* Waits for a keypress or click, whilst still allowing the game scene to
|
|
|
|
* be animated.
|
|
|
|
*/
|
2015-01-19 12:13:03 -05:00
|
|
|
void perform();
|
2015-02-07 21:17:31 -05:00
|
|
|
|
|
|
|
void rest();
|
2015-02-07 22:47:28 -05:00
|
|
|
|
|
|
|
void bash(const Common::Point &pt, Direction direction);
|
2015-02-15 12:01:04 -05:00
|
|
|
|
2015-02-25 20:25:27 -05:00
|
|
|
void draw3d(bool updateFlag, bool skipDelay = false);
|
2015-02-15 14:20:35 -05:00
|
|
|
|
2016-08-28 17:52:56 -04:00
|
|
|
/**
|
|
|
|
* Draw the display borders
|
|
|
|
*/
|
2015-02-15 14:20:35 -05:00
|
|
|
void assembleBorder();
|
2015-02-16 14:35:23 -05:00
|
|
|
|
|
|
|
void doCombat();
|
2015-02-28 18:43:04 -05:00
|
|
|
|
|
|
|
void spellFX(Character *c);
|
2015-01-03 03:19:14 -10:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Xeen
|
|
|
|
|
|
|
|
#endif /* XEEN_INTERFACE_H */
|