Planeshift
Classes | Public Member Functions

pawsNpcDialogWindow Class Reference

This window shows the popup menu of available responses when talking to an NPC. More...

#include <pawsnpcdialog.h>

List of all members.

Classes

struct  QuestInfo

Public Member Functions

virtual void BringToTop (pawsWidget *widget)
 Move this widget up the z order to the top.
void CleanBubbles ()
 empties all bubbles structures and hides them.
void DisplayQuestBubbles (unsigned int index)
 Display quests in bubbles.
virtual void Draw ()
 Handles timing to make bubbles disappear in the bubbles npc dialog mode.
virtual void DrawBackground ()
 Has a real functionality only when using the bubbles npc dialog.
float GetNpcMsgTimeoutScale ()
 Getter for npc messsage timeout.
float GetNpcMsgTimeoutScaleMax ()
 Getter for npc messsage timeout.
bool GetUseBubbles ()
 Getter for useBubbles, which states if we use the bubbles based npcdialog interface.
void HandleMessage (MsgEntry *me)
virtual void Hide ()
 Makes widget invisible and removes focus if widget has current focus.
void LoadQuest (csString xmlstr)
 Load quest info from xmlbinding message.
bool LoadSetting ()
 Loads the settings from the config files and sets the window appropriately.
void NpcSays ()
 Display NPC's chat text.
bool OnButtonPressed (int button, int keyModifier, pawsWidget *widget)
 callback function called when a pawsButton (bubble) is clicked
bool OnKeyDown (utf32_char keyCode, utf32_char key, int modifiers)
 Process keydown messages.
void OnListAction (pawsListBox *widget, int status)
 Called whenever an item in a child list box is selected.
bool OnMouseDown (int button, int modifiers, int x, int y)
 Manage mouse down event to test for and apply window changes.
void OnStringEntered (const char *name, int param, const char *value)
 When the pawsStringPromptWindow is created, a ptr to a class which implements this function is provided, and a "name" string is provided, so that a single window can use 1 callback for many fields.
 pawsNpcDialogWindow ()
bool PostSetup ()
 Aquire pointers to widgets and load settings for the npc dialog.
void SaveSetting ()
 Saves the setting of the menu used for later use.
void SetNpcMsgTimeoutScale (float timeoutScale)
 Setter for npc messsage timeout.
void SetupWindowWidgets ()
 Sets the widget appropriate for display depending on the type of npc dialog menu used.
void SetUseBubbles (bool useBubblesNew)
 Sets if we have to use the bubbles based npc dialog interface (true) or the classic menu based one (false).
virtual void Show ()
 Shows the window and applies some special handling to fix up the window Behaviour and graphics correctly depending if we use the classic menu or the bubble menu.
void ShowIfBubbles ()
 Shows the window only if it's in bubbles mode, else does nothing.
void ShowOnlyFreeText ()
 Hides all bubbles except freetext and bye.
void ShowSpeechBubble ()
 Shows the npc chat window and hides the menu bubbles.

Detailed Description

This window shows the popup menu of available responses when talking to an NPC.

Definition at line 38 of file pawsnpcdialog.h.


Constructor & Destructor Documentation

pawsNpcDialogWindow::pawsNpcDialogWindow ( )

Member Function Documentation

virtual void pawsNpcDialogWindow::BringToTop ( pawsWidget widget) [inline, virtual]

Move this widget up the z order to the top.

If the widget is alwaysOnTop, it will be placed in position 0. If the widget is not alwaysOnTop, it will be placed after the last alwaysOnTop widget. Will also recurse up through the parents to bring it up as well.

Parameters:
widgetWidget to bring forward.

Reimplemented from pawsWidget.

Definition at line 97 of file pawsnpcdialog.h.

void pawsNpcDialogWindow::CleanBubbles ( )

empties all bubbles structures and hides them.

void pawsNpcDialogWindow::DisplayQuestBubbles ( unsigned int  index)

Display quests in bubbles.

Parameters:
indexFrom which index in questInfo array the quest info will be displayed in bubbles.
virtual void pawsNpcDialogWindow::Draw ( ) [virtual]

Handles timing to make bubbles disappear in the bubbles npc dialog mode.

Reimplemented from pawsWidget.

virtual void pawsNpcDialogWindow::DrawBackground ( ) [virtual]

Has a real functionality only when using the bubbles npc dialog.

It will avoid drawing the background in order to make it transparent

Reimplemented from pawsWidget.

float pawsNpcDialogWindow::GetNpcMsgTimeoutScale ( ) [inline]

Getter for npc messsage timeout.

The timeout determines how long a npc message is displayed. Apparently this is just a scaling factor for shortening or prolonging the display.

Definition at line 164 of file pawsnpcdialog.h.

float pawsNpcDialogWindow::GetNpcMsgTimeoutScaleMax ( ) [inline]

Getter for npc messsage timeout.

The maximum timeout determines how long a npc message is displayed at maximum.

Returns:
maximum scaling factor

Definition at line 194 of file pawsnpcdialog.h.

bool pawsNpcDialogWindow::GetUseBubbles ( ) [inline]

Getter for useBubbles, which states if we use the bubbles based npcdialog interface.

Returns:
TRUE if we are using the bubbles based npc dialog interface FALSE if we are using the menu based npc dialog interface

Definition at line 145 of file pawsnpcdialog.h.

void pawsNpcDialogWindow::HandleMessage ( MsgEntry me) [virtual]

Implements psClientNetSubscriber.

virtual void pawsNpcDialogWindow::Hide ( ) [virtual]

Makes widget invisible and removes focus if widget has current focus.

Sets visible FALSE, hides border if present and then if focused when called it calls SetCurrentFocusedWidget(NULL).

Reimplemented from pawsWidget.

void pawsNpcDialogWindow::LoadQuest ( csString  xmlstr)

Load quest info from xmlbinding message.

Parameters:
xmlstrAn xml string which contains quest info
bool pawsNpcDialogWindow::LoadSetting ( )

Loads the settings from the config files and sets the window appropriately.

Returns:
TRUE if loading succeded
void pawsNpcDialogWindow::NpcSays ( )

Display NPC's chat text.

Parameters:
inTextContent that the NPC's chat text
actorThe target NPC name
bool pawsNpcDialogWindow::OnButtonPressed ( int  button,
int  keyModifier,
pawsWidget widget 
) [virtual]

callback function called when a pawsButton (bubble) is clicked

Reimplemented from pawsWidget.

bool pawsNpcDialogWindow::OnKeyDown ( utf32_char  keyCode,
utf32_char  keyChar,
int  modifiers 
) [virtual]

Process keydown messages.

Parameters:
keyCodeThe code for the pressed key.
keyCharThe key pressed.
modifiersUsed to modify tab behavior.
Returns:
bool TRUE for success FALSE if no action.
Remarks:
If you override this, be sure to also override GetFocusOverridesControls() as returning true

Reimplemented from pawsWidget.

void pawsNpcDialogWindow::OnListAction ( pawsListBox selected,
int  status 
) [virtual]

Called whenever an item in a child list box is selected.

Parameters:
selectedThe listbox that has the item selected.
statusFrom listbox when a row is selected.

Reimplemented from pawsWidget.

bool pawsNpcDialogWindow::OnMouseDown ( int  button,
int  modifiers,
int  x,
int  y 
) [virtual]

Manage mouse down event to test for and apply window changes.

Parameters:
buttonType of button: 1 resizable or movable, 2 context menu or config window.
modifiersUsed with PAWS_CONSTRUCTION.
xUsed to test for resize.
yUsed to test for resize.
Returns:
bool TRUE if movable or resizable.
Remarks:
calls OnMouseDown on it's parent.

Reimplemented from pawsWidget.

void pawsNpcDialogWindow::OnStringEntered ( const char *  name,
int  param,
const char *  value 
) [virtual]

When the pawsStringPromptWindow is created, a ptr to a class which implements this function is provided, and a "name" string is provided, so that a single window can use 1 callback for many fields.

Implements iOnStringEnteredAction.

bool pawsNpcDialogWindow::PostSetup ( ) [virtual]

Aquire pointers to widgets and load settings for the npc dialog.

Reimplemented from pawsWidget.

void pawsNpcDialogWindow::SaveSetting ( )

Saves the setting of the menu used for later use.

void pawsNpcDialogWindow::SetNpcMsgTimeoutScale ( float  timeoutScale) [inline]

Setter for npc messsage timeout.

The timeout determines how long a npc message is displayed. Apparently this is just a scaling factor for shortening or prolonging the display.

Parameters:
timeoutScaleis multiplied with the real factor.

Definition at line 175 of file pawsnpcdialog.h.

void pawsNpcDialogWindow::SetupWindowWidgets ( )

Sets the widget appropriate for display depending on the type of npc dialog menu used.

void pawsNpcDialogWindow::SetUseBubbles ( bool  useBubblesNew) [inline]

Sets if we have to use the bubbles based npc dialog interface (true) or the classic menu based one (false).

Note:
This doesn't reconfigure the widgets for the new modality.

Definition at line 154 of file pawsnpcdialog.h.

virtual void pawsNpcDialogWindow::Show ( ) [virtual]

Shows the window and applies some special handling to fix up the window Behaviour and graphics correctly depending if we use the classic menu or the bubble menu.

Reimplemented from pawsWidget.

void pawsNpcDialogWindow::ShowIfBubbles ( )

Shows the window only if it's in bubbles mode, else does nothing.

void pawsNpcDialogWindow::ShowOnlyFreeText ( )

Hides all bubbles except freetext and bye.

void pawsNpcDialogWindow::ShowSpeechBubble ( )

Shows the npc chat window and hides the menu bubbles.


The documentation for this class was generated from the following file: