SBSPSS/source/game/convo.h

163 lines
3.2 KiB
C
Raw Normal View History

2001-01-05 22:43:21 +01:00
/*=========================================================================
convo.h
Author: PKG
Created:
Project: Spongebob
Purpose:
Copyright (c) 2000 Climax Development Ltd
===========================================================================*/
#ifndef __GAME_CONVO_H__
#define __GAME_CONVO_H__
/*----------------------------------------------------------------------
Includes
-------- */
2001-01-10 18:27:12 +01:00
#ifndef __FILE_EQUATES_H__
#include <biglump.h>
#endif
2001-01-05 22:43:21 +01:00
/* Std Lib
------- */
/*----------------------------------------------------------------------
Tyepdefs && Defines
------------------- */
/*----------------------------------------------------------------------
Structure defintions
-------------------- */
2001-01-10 18:27:12 +01:00
class CConversation
{
public:
2001-01-22 21:57:39 +01:00
static void init();
static void shutdown();
2001-01-10 18:27:12 +01:00
2001-01-22 21:57:39 +01:00
static void think(int _frames);
static void render();
2001-01-10 18:27:12 +01:00
2001-01-22 21:57:39 +01:00
static void registerConversationScript(FileEquate _feScript);
static void trigger(FileEquate _feScript);
static int isActive();
2001-01-10 18:27:12 +01:00
static void setCharacterAndText(int _characterId,int _textId);
static void setResponseOptions(int _responseOptions);
static int getResponse();
private:
enum
{
FRAME_WIDTH=400,
FRAME_HEIGHT=90,
FRAME_BOTTOM_OFFSET=40,
TEXT_BORDER=20,
OT_POS=0,
SELECT_TEXT_R=250,
SELECT_TEXT_G=250,
SELECT_TEXT_B=250,
UNSELECT_TEXT_R=100,
UNSELECT_TEXT_G=100,
UNSELECT_TEXT_B=100,
};
// This order is the same as in scripts/defs/charanim.scr
enum
{
CHAR_SPONGEBOB,
CHAR_SANDY,
CHAR_PATRICK,
CHAR_SQUIDWARD,
CHAR_KRABS,
CHAR_PLANKTON,
2001-01-11 22:54:44 +01:00
CHAR_MERMAIDMAN,
CHAR_BARNACLEBOY,
CHAR_JACKCUSTARD,
2001-01-10 18:27:12 +01:00
MAX_CHARS,
};
typedef struct
{
int m_frame;
} CHAR_ICON_FRAMES;
// These two are as in scripts/defs/response.scr
enum
{
QUESTION_NONE,
QUESTION_OK,
QUESTION_YES_NO,
MAX_QUESTIONS,
};
enum
{
ANSWER_NONE,
ANSWER_OK,
ANSWER_YES,
ANSWER_NO,
MAX_ANSWERS
};
// State of the conversation dialog
enum
{
STATE_INACTIVE,
STATE_JUST_ACTIVATED,
STATE_ACTIVE,
};
2001-01-23 22:05:48 +01:00
// Maximum number of scripts per level
enum
{
MAX_LOADED_SCRIPTS=10,
};
2001-01-10 18:27:12 +01:00
2001-01-22 21:57:39 +01:00
static void thinkQuestion();
static void renderQuestion();
2001-01-10 18:27:12 +01:00
2001-01-23 22:05:48 +01:00
static void dumpConversationScripts();
2001-01-10 18:27:12 +01:00
static class CGUIGroupFrame *s_guiFrame;
static class CGUISprite *s_guiIcon;
static class CGUITextBox *s_guiText;
2001-01-22 21:57:39 +01:00
static class FontBank *s_fontBank;
2001-01-10 18:27:12 +01:00
2001-01-22 21:57:39 +01:00
static CHAR_ICON_FRAMES s_characterIconFrames[MAX_CHARS];
2001-01-10 18:27:12 +01:00
2001-01-23 22:05:48 +01:00
static class CScript *s_registeredScripts[MAX_LOADED_SCRIPTS];
static int s_registeredScriptIds[MAX_LOADED_SCRIPTS];
static int s_numRegisteredScripts;
2001-01-22 21:57:39 +01:00
static class CScript *s_currentScript;
static int s_currentState;
2001-01-10 18:27:12 +01:00
2001-01-22 21:57:39 +01:00
static int s_currentCharacterId;
static int s_currentTextId;
static int s_currentQuestion;
static int s_currentAnswer;
static int s_currentSelectedAnswer;
2001-01-10 18:27:12 +01:00
};
2001-01-05 22:43:21 +01:00
/*----------------------------------------------------------------------
Globals
------- */
/*----------------------------------------------------------------------
Functions
--------- */
/*---------------------------------------------------------------------- */
#endif /* __GAME_CONVO_H__ */
/*===========================================================================
end */