SBSPSS/source/game/convo.h

194 lines
3.9 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-07-01 20:40:03 +02:00
#ifndef _GLOBAL_HEADER_
#include "system\global.h"
#endif
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-07-01 20:40:03 +02:00
static void init();
static void shutdown();
static void think(int _frames);
static void render();
static void registerConversationLevelScripts(int level);
static void registerConversationScript(FileEquate _feScript);
static void trigger(FileEquate _feScript);
static int isActive();
static void setCharacterAndText(int _characterId,int _textId);
static void setResponseOptions(int _responseOptions);
static int getResponse();
static RECT getTextRegion();
2001-01-10 18:27:12 +01:00
2001-07-24 17:06:30 +02:00
static void ignoreNewlyPressedButtonsOnPadThisThink();
2001-01-10 18:27:12 +01:00
private:
enum
{
2001-05-09 00:09:00 +02:00
TEXTBOX_X=125,
2001-07-27 16:50:13 +02:00
TEXTBOX_Y=30,
2001-05-09 00:09:00 +02:00
TEXTBOX_WIDTH=357,
2001-07-27 16:50:13 +02:00
TEXTBOX_HEIGHT=25,
2001-07-01 20:40:03 +02:00
TEXTBOX_X_FOR_NARRATOR=512-TEXTBOX_X-TEXTBOX_WIDTH,
TEXTBOX_WIDTH_FOR_NARRATOR=512-(TEXTBOX_X_FOR_NARRATOR*2),
2001-05-09 00:09:00 +02:00
TEXTBOX_QUESTIONHEIGHT=16,
2001-01-10 18:27:12 +01:00
OT_POS=0,
2001-07-01 20:40:03 +02:00
TEXTBOX_FONT_LINE_SPACING=14,
2001-07-27 16:50:13 +02:00
TEXTBOX_FONT_NUM_LINES_IN_BOX=2,
2001-07-01 20:40:03 +02:00
TEXTBOX_BUTTONS_XOFF=0,
2001-07-10 23:47:14 +02:00
TEXTBOX_BUTTONS_YOFF=TEXTBOX_HEIGHT+6,
2001-07-01 20:40:03 +02:00
TEXTBOX_BUTTONS_GAP=20,
2001-07-18 00:39:53 +02:00
TEXTBOX_XBUTTON_XOFFSET=50,
2001-05-14 15:55:53 +02:00
// Main text
TEXT_R=120,
TEXT_G=115,
TEXT_B=90,
// Question text
2001-01-10 18:27:12 +01:00
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-07-01 20:40:03 +02:00
CHAR_GARY,
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-05-03 03:59:46 +02:00
static void thinkText();
2001-01-22 21:57:39 +01:00
static void thinkQuestion();
2001-05-03 03:59:46 +02:00
static void renderText();
2001-01-22 21:57:39 +01:00
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
2001-05-03 03:59:46 +02:00
static class FontBank *s_textFontBank;
static class FontBank *s_questionFontBank;
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_currentQuestion;
static int s_currentAnswer;
static int s_currentSelectedAnswer;
2001-05-09 00:09:00 +02:00
static int s_faceFrame;
static int s_speechId;
2001-07-01 20:40:03 +02:00
static int s_textPageOffset;
static int s_maxTextPageOffset;
static class SpriteBank *s_sprites;
2001-05-09 00:09:00 +02:00
2001-07-24 17:06:30 +02:00
static int s_ignoreNewlyPressedButtonsOnPadThisThink;
2001-01-10 18:27:12 +01:00
};
2001-01-05 22:43:21 +01:00
/*----------------------------------------------------------------------
Globals
------- */
/*----------------------------------------------------------------------
Functions
--------- */
/*---------------------------------------------------------------------- */
#endif /* __GAME_CONVO_H__ */
/*===========================================================================
end */