Planeshift
|
The main or desktop widget. More...
#include <psmainwidget.h>
Classes | |
struct | mesgOption |
Used to store an option about on screen options. More... | |
Public Member Functions | |
void | ClearFadingText () |
void | DeleteChild (pawsWidget *txtBox) |
Removes the fading text box from the array and the memory. | |
void | Draw () |
Draw method. | |
void | DrawChildren () |
Draws all children marked visible. | |
GEMClientObject * | FindMouseOverObject (int mouseX, int mouseY) |
Find what entity the mouse is over. | |
psEntityTypes * | GetEntityTypes () |
const char * | HandleCommand (const char *) |
Handles commands (unused for now) | |
void | HandleMessage (MsgEntry *message) |
Handles server messages. | |
bool | IsPlayerLocked () |
void | LockPlayer () |
bool | OnDoubleClick (int button, int modifiers, int x, int y) |
Manage mouse double click event. | |
bool | OnKeyDown (utf32_char keyCode, utf32_char key, int modifiers) |
Process keydown messages. | |
bool | OnMouseDown (int button, int modifiers, int x, int y) |
Manage mouse down event to test for and apply window changes. | |
bool | OnMouseUp (int button, int modifiers, int x, int y) |
Manage mouse up event. | |
void | PrintOnScreen (const char *text, int color, float ymod=0.50f) |
Print a message on screen. | |
psMainWidget () | |
bool | SetupMain () |
void | UnlockPlayer () |
virtual | ~psMainWidget () |
Functions to handle on-screen messages options | |
bool | GetMesgOption (int mesgType) |
Gets an on-screen message option. | |
void | SetMesgOption (int mesgType, bool value) |
Sets a on screen message option. | |
bool | LoadConfigFromFile () |
Loads the configuration of this widget. | |
bool | SaveConfigToFile () |
Saves the configuration of this widget. | |
csHash< mesgOption, int > ::GlobalIterator | GetMesgOptionsIterator () |
Returns an iterator to iterate the options about on-screen messages. |
The main or desktop widget.
Definition at line 79 of file psmainwidget.h.
psMainWidget::psMainWidget | ( | ) |
virtual psMainWidget::~psMainWidget | ( | ) | [virtual] |
void psMainWidget::ClearFadingText | ( | ) |
void psMainWidget::DeleteChild | ( | pawsWidget * | txtBox | ) | [virtual] |
Removes the fading text box from the array and the memory.
Reimplemented from pawsWidget.
void psMainWidget::Draw | ( | ) | [inline, virtual] |
Draw method.
As the main widget is not a real widget which should show things, but only it's children are drawn by calling drawchildren directly, the draw function does nothing.
Reimplemented from pawsWidget.
Definition at line 132 of file psmainwidget.h.
void psMainWidget::DrawChildren | ( | ) | [virtual] |
Draws all children marked visible.
Reimplemented from pawsWidget.
GEMClientObject* psMainWidget::FindMouseOverObject | ( | int | mouseX, |
int | mouseY | ||
) |
Find what entity the mouse is over.
mouseX | The screen X position of the mouse. |
mouseY | The screen Y position of the mouse. |
psEntityTypes* psMainWidget::GetEntityTypes | ( | ) | [inline] |
Definition at line 102 of file psmainwidget.h.
bool psMainWidget::GetMesgOption | ( | int | mesgType | ) |
Gets an on-screen message option.
mesgType | The id of the message. |
csHash<mesgOption, int>::GlobalIterator psMainWidget::GetMesgOptionsIterator | ( | ) | [inline] |
Returns an iterator to iterate the options about on-screen messages.
Definition at line 170 of file psmainwidget.h.
const char* psMainWidget::HandleCommand | ( | const char * | ) | [inline, virtual] |
Handles commands (unused for now)
Implements psCmdBase.
Definition at line 108 of file psmainwidget.h.
void psMainWidget::HandleMessage | ( | MsgEntry * | message | ) | [virtual] |
Handles server messages.
Implements psCmdBase.
bool psMainWidget::IsPlayerLocked | ( | ) | [inline] |
Definition at line 92 of file psmainwidget.h.
bool psMainWidget::LoadConfigFromFile | ( | ) |
Loads the configuration of this widget.
For now it loads just the options about the on-screen messages to show/hide.
void psMainWidget::LockPlayer | ( | ) | [inline] |
Definition at line 91 of file psmainwidget.h.
Manage mouse double click event.
Reimplemented from pawsMainWidget.
bool psMainWidget::OnKeyDown | ( | utf32_char | keyCode, |
utf32_char | keyChar, | ||
int | modifiers | ||
) | [virtual] |
Process keydown messages.
keyCode | The code for the pressed key. |
keyChar | The key pressed. |
modifiers | Used to modify tab behavior. |
Reimplemented from pawsMainWidget.
Manage mouse down event to test for and apply window changes.
button | Type of button: 1 resizable or movable, 2 context menu or config window. |
modifiers | Used with PAWS_CONSTRUCTION. |
x | Used to test for resize. |
y | Used to test for resize. |
Reimplemented from pawsMainWidget.
Manage mouse up event.
Reimplemented from pawsMainWidget.
Print a message on screen.
This function is called when a system message is received. To print a message on screen fire a system message of type MSG_ERROR(Red), MSG_OK(Green), MSG_RESULT(Yellow) or MSG_ACK(Blue)
text | The text to be printed on screen. Have to be at lest 2 chars or it will be ignored. |
color | The color to be used on the text. |
ymod | Where on screen should the message be displayed. Default in center. |
bool psMainWidget::SaveConfigToFile | ( | ) |
Saves the configuration of this widget.
For now it saves just the options about the on-screen messages to show/hide.
void psMainWidget::SetMesgOption | ( | int | mesgType, |
bool | value | ||
) |
Sets a on screen message option.
mesgType | The id of the message. |
value | The status to set for this message (true is show, false is hide) |
bool psMainWidget::SetupMain | ( | ) |
void psMainWidget::UnlockPlayer | ( | ) | [inline] |
Definition at line 93 of file psmainwidget.h.