ns/releases/3.03/source/ui/UIHud.h
tankefugl 54a4ac5469 o Branched from 3.02
git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@85 67975925-1194-0748-b3d5-c16f83f1a3a1
2005-04-26 15:38:32 +00:00

130 lines
No EOL
3.1 KiB
C++

//
// Property of Charlie Cleveland, flayra@overmind.org
//
#ifndef UIHUD_H
#define UIHUD_H
//#include "cl_dll/hud.h"
#include "cl_dll/chud.h"
#include "textrep/TRDescription.h"
#include "ui/UIManager.h"
#include "vgui_InputSignal.h"
#include "vgui_Scheme.h"
#include "vgui_BitmapTGA.h"
#include "cl_dll/vgui_SchemeManager.h"
#include "fmoddyn.h"
#include "fmod_errors.h"
// From windows.h in fmoddyn.h
#undef SERVER_EXECUTE
class UIFactory;
// Initializes self from text file
class UIHud : public CHud
{
public:
// Takes over memory of factory, deletes it when it is done
UIHud(const string& inFilename, UIFactory* inFactory);
virtual ~UIHud(void);
// Accessors for returning the UI manager
UIManager& GetManager(void);
const UIManager& GetManager(void) const;
// Override default behaviors
virtual void Init(void);
virtual void LoadSchemes(void);
// The header that is saved out before saving out our ui.txt
virtual string GetTextHeader(void) const;
bool InitializeScheme(const char* inName, Scheme* inScheme);
void ClearStream(FSOUND_STREAM*& ioStream);
bool PlaySong(string& inSongName, int& ioVolume, bool inLooping, FSOUND_STREAM*& outStream, int& outChannel, int& outBytesInSong, float inTimeElapsed = -1);
virtual void PlayRandomSong(void);
virtual bool PlayInternetStream(const string& inStreamName, string& outError);
virtual void StopInternetStream();
virtual void PostUIInit(void);
virtual void ResetGame();
virtual void VidInit(void);
virtual void Think(void);
virtual int Redraw(float flTime, int intermission);
virtual void ToggleEditMode(void);
virtual void ToggleMouse(void);
virtual int UpdateClientData(client_data_t *cdata, float time);
virtual void SetMusicAllowed(bool inState);
virtual void SetUsingVGUI(bool inState);
virtual void InitializeSound(void);
virtual void Shutdown(void);
virtual void StopMusic(void);
virtual void UpdateMusic(float inCurrentTime);
virtual bool UpdateInternetStream(float inCurrentTime, string& outError);
FMOD_INSTANCE* GetFMOD();
protected:
virtual bool Update(float inCurrentTime, string& outError);
private:
bool GetIsTimeForSong(float inCurrentTime) const;
bool PickRandomSong(string& outRelativeSongName) const;
virtual void ShutdownMusic(void);
const string mFilename;
static const string UITextHeader;
bool mInitted;
bool mSoundInitialized;
bool mMusicEnabled;
bool mMusicAllowed;
bool mSongIsPlaying;
int mBytesInCurrentSong;
float mTimeSongEnded;
int mRandomSecondsBetweenSongs;
int mCurrentVolume;
int mCurrentChannel;
int mInternetStreamChannel;
TRDescriptionList mDescriptionList;
UIManager mManager;
BitmapTGA* mArrowBitmap;
Cursor* mArrowCursor;
FSOUND_STREAM* mCurrentSongStream;
FSOUND_STREAM* mCurrentInternetStream;
protected:
CSchemeManager* mSchemeManager;
FMOD_INSTANCE* mFMOD;
};
#endif