This commit is contained in:
parent
d3f5008cfb
commit
eb9316fe4e
3 changed files with 17 additions and 106 deletions
|
@ -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 \
|
UI_GFX_TRANS := +bambootopleft.bmp +bamboobotleft.bmp +bambootopright.bmp +bamboobotright.bmp \
|
||||||
+bamboohorizontal.bmp +bamboovertical.bmp \
|
+bamboohorizontal.bmp +bamboovertical.bmp \
|
||||||
|
+slider_marker.bmp \
|
||||||
+butU.bmp +butD.bmp +butL.bmp +butR.bmp \
|
+butU.bmp +butD.bmp +butL.bmp +butR.bmp \
|
||||||
+butC.bmp +butS.bmp +butX.bmp +butT.bmp \
|
+butC.bmp +butS.bmp +butX.bmp +butT.bmp \
|
||||||
+mappointer.bmp +speechbubblecorner.bmp \
|
+mappointer.bmp +speechbubblecorner.bmp \
|
||||||
|
|
|
@ -34,6 +34,10 @@
|
||||||
#include "gfx\prim.h"
|
#include "gfx\prim.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __GAME_GAME_H__
|
||||||
|
#include "game\game.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Std Lib
|
/* 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:
|
Function:
|
||||||
Purpose:
|
Purpose:
|
||||||
|
@ -451,20 +375,24 @@ void CGUIBarReadout::setReadoutRange(int _min,int _max)
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CGUIBarReadout::render()
|
void CGUIBarReadout::render()
|
||||||
{
|
{
|
||||||
POLY_G4 *g4;
|
POLY_G4 *g4;
|
||||||
int x,y,w,h;
|
int x,y,w,h;
|
||||||
int r,g,b;
|
int r,g,b;
|
||||||
int ot;
|
int ot;
|
||||||
|
SpriteBank *sb;
|
||||||
|
sFrameHdr *fh;
|
||||||
|
|
||||||
x=getX()+getParentX();
|
|
||||||
y=getY()+getParentY();
|
|
||||||
w=getW();
|
w=getW();
|
||||||
h=getH();
|
h=getH();
|
||||||
|
x=getX()+getParentX();
|
||||||
|
y=getY()+getParentY()+(h/2);
|
||||||
r=g=b=isSelected()?245:110;
|
r=g=b=isSelected()?245:110;
|
||||||
ot=getOt();
|
ot=getOt();
|
||||||
|
|
||||||
DrawLine(x,y+(h/2),x+w,y+(h/2),r,g,b,ot);
|
sb=CGameScene::getSpriteBank();
|
||||||
DrawLine(x+m_markerOffset,y,x+m_markerOffset,y+h,r,g,b,ot);
|
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();
|
CGUIObject::render();
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
class CGUISpriteReadout : public CGUIObjectWithSpriteBank
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue