mirror of
https://github.com/ENSL/NS.git
synced 2024-11-26 22:40:58 +00:00
4f13237895
Change CRLF to LF in repo.
135 lines
3.1 KiB
C++
135 lines
3.1 KiB
C++
//
|
|
// Property of Charlie Cleveland, flayra@overmind.org
|
|
//
|
|
|
|
#ifndef UIHUD_H
|
|
#define UIHUD_H
|
|
|
|
//#include "cl_dll/hud.h"
|
|
#include "chud.h"
|
|
#include "textrep/TRDescription.h"
|
|
#include "UIManager.h"
|
|
#include "VGUI_InputSignal.h"
|
|
#include "VGUI_Scheme.h"
|
|
#include "VGUI_BitmapTGA.h"
|
|
#include "vgui_SchemeManager.h"
|
|
#include "winsani_in.h"
|
|
#include "fmoddyn.h"
|
|
#include "winsani_out.h"
|
|
class UIFactory;
|
|
|
|
//struct fmod_instance_struct;
|
|
//typedef fmod_instance_struct FMOD_INSTANCE;
|
|
|
|
|
|
typedef struct FSOUND_STREAM FSOUND_STREAM;
|
|
|
|
// 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 void ShowMouse(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
|