SBSPSS/source/shop/shop.h

188 lines
3.4 KiB
C
Raw Normal View History

2001-06-05 18:13:55 +02:00
/*=========================================================================
shop.h
Author: PKG
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
#ifndef __SHOP_SHOP_H__
#define __SHOP_SHOP_H__
/*----------------------------------------------------------------------
Includes
-------- */
#ifndef __SYSTEM_GSTATE_H__
#include "system\gstate.h"
#endif
2001-06-19 00:58:36 +02:00
#ifndef _GLOBAL_HEADER_
#include "system\global.h" // Doh.. just for DVECTOR :/
#endif
2001-06-05 18:13:55 +02:00
/* Std Lib
------- */
/*----------------------------------------------------------------------
Tyepdefs && Defines
------------------- */
/*----------------------------------------------------------------------
Structure defintions
-------------------- */
class CShopScene : public CScene
{
public:
void init();
void shutdown();
void render();
void think(int _frames);
int readyToShutdown();
char *getSceneName() {return"Shop";}
typedef enum
{
2001-07-13 17:42:58 +02:00
SHOPITEM_TEDDY,
SHOPITEM_SARNIE,
2001-06-05 18:13:55 +02:00
SHOPITEM_CUPCAKE,
2001-07-13 17:42:58 +02:00
SHOPITEM_PREZZIE,
2001-06-05 18:13:55 +02:00
SHOPITEM_JELLY2,
2001-07-13 17:42:58 +02:00
SHOPITEM_CAKE,
SHOPITEM_BLOWER,
2001-06-05 18:13:55 +02:00
SHOPITEM_PARTYHAT,
2001-07-13 17:42:58 +02:00
2001-06-05 18:13:55 +02:00
NUM_SHOP_ITEM_IDS
} SHOPITEM_ID;
2001-06-06 04:11:50 +02:00
private:
void renderUi();
2001-06-19 00:58:36 +02:00
DVECTOR getPointerTarget();
2001-06-06 04:11:50 +02:00
int isItemAvailableToBuy(int _itemNumber);
void playSound(int _sfxId);
enum
{
// Icon stuff
SHOP_ICON_XBASE=180,
SHOP_ICON_YBASE=38,
SHOP_ICON_WIDTH=512-(SHOP_ICON_XBASE*2),
SHOP_ICON_Y_GAP=51,
SHOP_ICON_ITEMS_PER_ROW=4,
2001-06-07 00:39:02 +02:00
SHOP_ICON_FLASH_SPEED=150,
2001-06-06 04:11:50 +02:00
SHOP_ICON_FLASH_COLOUR_BASE=128,
2001-06-07 00:39:02 +02:00
SHOP_ICON_FLASH_COLOUR_RANGE=50,
2001-06-06 04:11:50 +02:00
SHOP_ICON_PURCHASED_RGB=40,
// UI stuff
SHOP_MAIN_UI_X=48,
SHOP_MAIN_UI_Y=155,
SHOP_MAIN_UI_W=416,
SHOP_MAIN_UI_H=64,
SHOP_XBORDER=10,
SHOP_GAP_BETWEEN_INSTRUCTION_BUTTONS=5,
SHOP_SPACE_BETWEEN_INSTRUCTIONS_AND_BUTTONS=10,
SHOP_Y_BUTTON_OFFSET_FORM_TOP_OF_TEXT=3,
SHOP_INSTRUCTIONS_Y_BASE=7,
SHOP_Y_GAP_BETWEEN_INSTRUCTION_LINES=16,
SHOP_PRICE_Y_GAP_FROM_TOP=5,
SHOP_ITEM_X_POS=10,
SHOP_ITEM_Y_POS=6,
SHOP_TOKEN_COUNT_X_POS=10,
SHOP_TOKEN_COUNT_Y_POS=42,
// Overlay UI for confirmation
SHOP_QUERY_UI_X=80,
SHOP_QUERY_UI_Y=50,
SHOP_QUERY_UI_W=352,
SHOP_QUERY_UI_H=128,
};
2001-06-05 18:13:55 +02:00
typedef struct
{
int m_cost;
int m_frame;
} SHOPITEM;
static SHOPITEM s_shopItems[NUM_SHOP_ITEM_IDS];
2001-06-06 04:11:50 +02:00
typedef enum
{
SHOP_STATE__FADING_IN,
SHOP_STATE__SELECT_ITEM,
SHOP_STATE__CONFIRM_PURCHASE,
SHOP_STATE__CANNOT_AFFORD_ITEM,
} SHOP_STATE;
SHOP_STATE m_state;
2001-06-05 18:13:55 +02:00
class ScalableFontBank *m_font;
class SpriteBank *m_spriteBank;
int m_readyToExit;
unsigned char *m_image;
2001-06-05 21:26:14 +02:00
class CGUIGroupFrame *m_guiFrame;
2001-06-06 04:11:50 +02:00
class CGUIControlFrame *m_guiConfirmPurchaseFrame;
class CGUIControlFrame *m_guiCannotAffordFrame;
2001-06-05 21:26:14 +02:00
2001-06-06 04:11:50 +02:00
enum
{
ANSWER_NONE=0,
ANSWER_OK=1,
ANSWER_YES=1,
ANSWER_NO,
};
int m_queryAnswer;
2001-06-05 21:26:14 +02:00
2001-06-05 18:13:55 +02:00
int m_currentlySelectedItem;
int m_flashSin;
2001-06-06 04:11:50 +02:00
enum
{
MAIN_UI_MAX_Y_OFFSET=120,
};
int m_mainUiYOffset;
2001-06-19 00:58:36 +02:00
class CPointerIcon *m_pointerIcon;
2001-06-05 18:13:55 +02:00
};
/*----------------------------------------------------------------------
Globals
------- */
extern CShopScene ShopScene;
/*----------------------------------------------------------------------
Functions
--------- */
/*---------------------------------------------------------------------- */
#endif /* __SHOP_SHOP_H__ */
/*===========================================================================
end */