mirror of
https://github.com/ENSL/NS.git
synced 2024-11-24 05:21:16 +00:00
130 lines
3.1 KiB
C
130 lines
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
|