This commit is contained in:
Paul 2001-07-06 19:00:20 +00:00
parent d3f5008cfb
commit eb9316fe4e
3 changed files with 17 additions and 106 deletions

View File

@ -246,6 +246,7 @@ UI_GFX_NONTRANS_IN := $(foreach FILE,$(UI_GFX_NONTRANS),$(UI_GFX_DIR)/$(FILE))
UI_GFX_TRANS := +bambootopleft.bmp +bamboobotleft.bmp +bambootopright.bmp +bamboobotright.bmp \
+bamboohorizontal.bmp +bamboovertical.bmp \
+slider_marker.bmp \
+butU.bmp +butD.bmp +butL.bmp +butR.bmp \
+butC.bmp +butS.bmp +butX.bmp +butT.bmp \
+mappointer.bmp +speechbubblecorner.bmp \

View File

@ -34,6 +34,10 @@
#include "gfx\prim.h"
#endif
#ifndef __GAME_GAME_H__
#include "game\game.h"
#endif
/* Std Lib
------- */
@ -190,86 +194,6 @@ void CGUITextReadout::recalc()
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CGUISpatCountReadout::init(CGUIObject *_parent,GUIId _id)
{
CGUIObjectWithFont::init(_parent,_id);
m_spatsCollected=m_spatsTotal=0;
m_spriteBank=new ("SpatCountReadoutSprites") SpriteBank();
m_spriteBank->load(SPRITES_SPRITES_SPR);
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CGUISpatCountReadout::shutdown()
{
m_spriteBank->dump(); delete m_spriteBank;
CGUIObjectWithFont::shutdown();
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CGUISpatCountReadout::setSpatCounts(int _collected,int _total)
{
m_spatsCollected=_collected;
m_spatsTotal=_total;
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CGUISpatCountReadout::render()
{
if(!isHidden())
{
FontBank *fb;
sFrameHdr *fh;
char buf[100];
int x,y;
fb=getFontBank();
fh=m_spriteBank->getFrameHeader(FRM__SPATULA);
sprintf(buf,"%d/%d",m_spatsCollected,m_spatsTotal);
x=getW()-fb->getStringWidth(buf);
y=(getH()/2)-fb->getCharHeight();
fb->print(x,y,buf);
x=getX()+getParentX();
y=getY()+getParentY()+((getH()-fh->H)/2);
m_spriteBank->printFT4(fh,x,y,0,0,0);
}
CGUIObjectWithFont::render();
}
/*----------------------------------------------------------------------
Function:
Purpose:
@ -451,20 +375,24 @@ void CGUIBarReadout::setReadoutRange(int _min,int _max)
---------------------------------------------------------------------- */
void CGUIBarReadout::render()
{
POLY_G4 *g4;
int x,y,w,h;
int r,g,b;
int ot;
POLY_G4 *g4;
int x,y,w,h;
int r,g,b;
int ot;
SpriteBank *sb;
sFrameHdr *fh;
x=getX()+getParentX();
y=getY()+getParentY();
w=getW();
h=getH();
x=getX()+getParentX();
y=getY()+getParentY()+(h/2);
r=g=b=isSelected()?245:110;
ot=getOt();
DrawLine(x,y+(h/2),x+w,y+(h/2),r,g,b,ot);
DrawLine(x+m_markerOffset,y,x+m_markerOffset,y+h,r,g,b,ot);
sb=CGameScene::getSpriteBank();
fh=sb->getFrameHeader(FRM__SLIDER_MARKER);
sb->printFT4(fh,x+m_markerOffset-(fh->W/2),y-(fh->H/2),0,0,ot);
DrawLine(x,y,x+w,y,r,g,b,ot);
CGUIObject::render();
}

View File

@ -67,24 +67,6 @@ private:
};
class CGUISpatCountReadout : public CGUIObjectWithFont
{
public:
virtual void init(CGUIObject *_parent,GUIId _id=noId);
virtual void shutdown();
virtual void setSpatCounts(int _collected,int _total);
virtual void render();
private:
int m_spatsCollected,m_spatsTotal;
class SpriteBank *m_spriteBank;
};
class CGUISpriteReadout : public CGUIObjectWithSpriteBank
{
public: