22 #include <csutil/csstring.h> 23 #include <csutil/strhashr.h> 24 #include <csutil/randomgen.h> 25 #include <csutil/refarr.h> 26 #include <csutil/sysfunc.h> 27 #include <csutil/leakguard.h> 28 #include <csutil/eventhandlers.h> 29 #include <csutil/weakrefarr.h> 30 #include <csutil/weakreferenced.h> 31 #include <ivaria/profile.h> 32 #include <ivideo/graph3d.h> 33 #include <iutil/eventh.h> 36 #include "isoundmngr.h" 44 struct iConfigManager;
45 struct iDialogManager;
46 struct iDocumentSystem;
53 struct iSceneManipulate;
54 struct iTextureManager;
150 void UpdatePerFrame();
164 bool ProcessLogic(iEvent &Event);
165 bool Process2D(iEvent &Event);
166 bool Process3D(iEvent &Event);
167 bool ProcessFrame(iEvent &Event);
225 return scenemanipulator;
243 return netmanager->GetMsgHandler();
247 return netmanager->GetCmdHandler();
271 return effectManager;
287 return actionhandler;
291 return charController;
320 targetPetitioner = pet;
325 return targetPetitioner;
343 loadstate = LS_LOAD_SCREEN;
354 return BrightnessCorrection;
360 void SetBrightnessCorrection(
float B);
365 void AdjustBrightnessCorrectionUp();
370 void AdjustBrightnessCorrectionDown();
375 void ResetBrightnessCorrection();
394 void setLimitFPS(
int);
418 duelConfirmation = confirmType;
419 WriteConfirmationSettings();
427 return duelConfirmation;
436 marriageProposal = ignore;
437 WriteConfirmationSettings();
445 return marriageProposal;
452 void WriteConfirmationSettings();
459 bool LoadConfirmationSettings();
467 bool LoadSoundSettings(
bool forceDef);
500 bool LoadPawsWidget(
const char* title,
const char* filename);
507 bool LoadCustomPawsWidgets(
const char* filename);
511 void AddLoadingWindowMsg(
const csString &msg);
518 void FatalError(
const char* msg);
547 const char* GetMainPlayerName();
550 bool UpdateWindowTitleInformations();
575 return muteSoundsOnFocusLoss;
582 muteSoundsOnFocusLoss = value;
586 void MuteAllSounds(
void);
588 void UnmuteAllSounds(
void);
593 const char* FindCommonString(
unsigned int cstr_id);
600 csStringID FindCommonStringId(
const char* str);
603 csStringHashReversible* GetMsgStrings();
614 return inventoryCache;
620 return backgroundWorldLoading;
625 delayedLoaders.PushSmart(obj);
629 delayedLoaders.Delete(obj);
641 void LoadLogSettings();
647 void DeclareExtraFactories();
649 void HideWindow(
const csString &widgetName);
655 iObjectRegistry* object_reg;
656 csRef<iEventNameRegistry> nameRegistry;
657 csRef<iEngine> engine;
658 csRef<iConfigManager> cfgmgr;
659 csRef<iTextureManager> txtmgr;
661 csRef<iGraphics2D> g2d;
662 csRef<iGraphics3D> g3d;
663 csRef<iEventQueue> queue;
664 csRef<iVirtualClock> vc;
665 csRef<iDocumentSystem> xmlparser;
667 csRef<iStringSet> stringset;
670 csRef<psNetManager> netmanager;
671 csRef<psCelClient> celclient;
672 csRef<ModeHandler> modehandler;
673 csRef<ActionHandler> actionhandler;
674 csRef<ZoneHandler> zonehandler;
675 csRef<psCal3DCallbackLoader> cal3DCallbackLoader;
681 csRef<psEffectManager> effectManager;
691 csRef<iBgLoader> loader;
692 csRef<iSceneManipulate> scenemanipulator;
710 csRefArray<iThreadReturn> precaches;
711 csRef<iStringArray> meshes;
712 csRef<iStringArray> maps;
713 size_t lastLoadingCount;
720 csString targetPetitioner;
722 float BrightnessCorrection;
734 int duelConfirmation;
735 bool marriageProposal;
739 csArray<csString> wdgProblems;
754 unsigned int countFPS;
755 unsigned int timeFPS;
762 bool muteSoundsOnFocusLoss;
767 bool backgroundWorldLoading;
770 csEventID event_frame;
771 csEventID event_canvashidden;
772 csEventID event_canvasexposed;
773 csEventID event_focusgained;
774 csEventID event_focuslost;
775 csEventID event_mouse;
776 csEventID event_keyboard;
777 csEventID event_joystick;
778 csEventID event_quit;
780 #if defined(CS_PLATFORM_UNIX) && defined(INCLUDE_CLIPBOARD) 781 csEventID event_selectionnotify;
791 LogicEventHandler(
psEngine* parent) : scfImplementationType(this), parent(parent)
795 virtual ~LogicEventHandler()
799 virtual bool HandleEvent(iEvent &ev)
804 virtual const csHandlerID* GenericPrec(csRef<iEventHandlerRegistry> &,
805 csRef<iEventNameRegistry> &, csEventID)
const;
806 virtual const csHandlerID* GenericSucc(csRef<iEventHandlerRegistry> &,
807 csRef<iEventNameRegistry> &, csEventID)
const;
809 CS_EVENTHANDLER_NAMES(
"planeshift.client.frame.logic")
810 CS_EVENTHANDLER_DEFAULT_INSTANCE_CONSTRAINTS
823 EventHandler3D(
psEngine* parent) : scfImplementationType(this), parent(parent)
827 virtual ~EventHandler3D()
831 virtual bool HandleEvent(iEvent &ev)
836 CS_EVENTHANDLER_PHASE_3D(
"planeshift.client.frame.3d");
849 EventHandler2D(
psEngine* parent) : scfImplementationType(this), parent(parent)
853 virtual ~EventHandler2D()
857 virtual bool HandleEvent(iEvent &ev)
862 CS_EVENTHANDLER_PHASE_2D(
"planeshift.client.frame.2d");
875 FrameEventHandler(
psEngine* parent) : scfImplementationType(this), parent(parent)
879 virtual ~FrameEventHandler()
883 virtual bool HandleEvent(iEvent &ev)
888 CS_EVENTHANDLER_PHASE_FRAME(
"planeshift.client.frame");
894 csRef<LogicEventHandler> eventHandlerLogic;
895 csRef<EventHandler3D> eventHandler3D;
896 csRef<EventHandler2D> eventHandler2D;
897 csRef<FrameEventHandler> eventHandlerFrame;
899 csWeakRefArray<DelayedLoader> delayedLoaders;
Manages character details for the client.
psChatBubbles * GetChatBubbles()
iVirtualClock * GetVirtualClock()
bool HasLoadedMap() const
Checks if the client has loaded its map.
Ensures all regions that need to be loaded are.
ZoneHandler * GetZoneHandler()
bool ProcessFrame(iEvent &Event)
A helper class to setup Crystal Space and mount some dirs.
static csString playerName
float GetBrightnessCorrection()
Get the current brightness correlation value.
ModeHandler * GetModeHandler()
iEventNameRegistry * GetEventNameRegistry()
bool BackgroundWorldLoading()
Whether or not we're background loading.
Creates the effect of a chat bubble on top of character heads taking data from text chat...
void UnregisterDelayedLoader(DelayedLoader *obj)
void SetLoadedMap(bool value)
Sets the HasLoadedMap value.
bool GetMuteSoundsOnFocusLoss(void) const
Gets whether sounds should be muted when the application loses focus.
bool GetMarriageProposal() const
Simply returns if marriage proposals should be read or automatically ignored.
void SetGuildName(const char *name)
Set Guild Name here for use with Entity labels.
Main PlaneShift Window manager.
virtual bool CheckLoadStatus()=0
ClientMsgHandler * GetMsgHandler()
bool IsGameLoaded()
check if the game has been loaded or not
psCelClient * GetCelClient()
psMainWidget * GetMainWidget()
ClientSongManager * GetSongManager()
class handling autoexecution of commands at the startup.
bool GetSoundStatus()
Get the status of the sound plugin, if available or not.
void RegisterDelayedLoader(DelayedLoader *obj)
iDocumentSystem * GetXMLParser()
iSceneManipulate * GetSceneManipulator()
Handles messages to be sent out, connects to server and send those.
void SetDuelConfirm(int confirmType)
Sets the duel confirm type and updates the confirmation settings XML.
iConfigManager * GetConfig()
void SetTargetPetitioner(const char *pet)
Access the player's petitioner target.
static csString hwRenderer
iSoundManager * GetSoundManager()
Client version of the Cel Manager Requests world loading.
iObjectRegistry * GetObjectRegistry()
static csString hwVersion
void SetMuteSoundsOnFocusLoss(bool value)
Sets whether sounds should be muted when the application loses focus.
void StartLoad()
Tell the engine to start the load proceedure.
bool Process2D(iEvent &Event)
A stripped version of the cal3d callback loader used only for eedit.
This class holds references to different network classes and provides some conveniance functions to a...
psCharController * GetCharControl()
This class receives all network messages from the server which affect the GUI or are displayable by t...
void LoadError(bool value)
Sets the LoadError value.
psMouseBinds holds set of psMouseAction
int GetDuelConfirm() const
Simply returns the duel confirmation setting.
Handles camera modes like first person, thrid person, speak to npc manages collision of camera with m...
CmdHandler * GetCmdHandler()
void ForceRefresh()
Force the next frame to get drawn. Used when updating LoadWindow.
bool Process3D(iEvent &Event)
const char * GetGuildName()
Get GuildName.
This class connect the GUI and the server side of the instruments system to the sound plugin...
The psQuestionClient class manages answering to various questions sent from server to user...
Manages dragging items from one inventory slot to another and dropping them into the world...
void void Initialize(iObjectRegistry *object_reg)
Manages all control and movement related activities.
A hash map class that stores a name->ID of sockets.
ActionHandler * GetActionHandler()
psClientCharManager * GetCharManager()
const char * GetTargetPetitioner()
This class handles mode messages from the server, specifying actions for a clicked location...
psNetManager * GetNetManager()
bool LoadingError()
Checks if the client had any errors during the loading state.
bool ProcessLogic(iEvent &Event)
Everything is event base for csApp based system.
psEngine This is the main class that contains all the object.
bool IsLoggedIn()
Logged in?
csRandomGen & GetRandomGen()
int GetNumChars()
Get the number of characters this player should have.
This class handles mode messages from the server, specifying "normal", or "combat" or "death"...
psSlotManager * GetSlotManager()
iTextureManager * GetTextureManager()
void SetMarriageProposal(bool ignore)
Sets if marriage proposals should be ignored and updates the confirmation settings XML...
psInventoryCache * GetInventoryCache(void)
get the inventory cache
void FinishFrame()
Wait to finish drawing the current frame.
void SetNumChars(int chars)
Set the number of characters this player has.
The main or desktop widget.
psEffectManager * GetEffectManager()