19 #ifndef PAWS_NPC_DIALOG 20 #define PAWS_NPC_DIALOG 29 #define CONFIG_NPCDIALOG_FILE_NAME "/planeshift/userdata/options/npcdialog.xml" 30 #define CONFIG_NPCDIALOG_FILE_NAME_DEF "/planeshift/data/options/npcdialog_def.xml" 89 bool OnKeyDown(utf32_char keyCode, utf32_char key,
int modifiers);
90 bool OnMouseDown(
int button,
int modifiers,
int x ,
int y);
156 useBubbles = useBubblesNew;
166 return npcMsgTimeoutScale;
177 if (timeoutScale < 0)
179 npcMsgTimeoutScale = 0.0;
180 }
else if (timeoutScale > npcMsgTimeoutScaleMax)
182 npcMsgTimeoutScale = npcMsgTimeoutScaleMax;
185 npcMsgTimeoutScale = timeoutScale;
196 return npcMsgTimeoutScaleMax;
212 void AdjustForPromptWindow();
216 void DisplayTextInChat(
const char *sayWhat);
220 float npcMsgTimeoutScale;
221 float npcMsgTimeoutScaleMax;
224 csArray<QuestInfo> questInfo;
225 unsigned int displayIndex;
228 bool clickedOnResponseBubble;
231 bool displaysNewMenu;
244 csArray<csString> npcMsgQueue;
bool OnKeyDown(utf32_char keyCode, utf32_char key, int modifiers)
Process keydown messages.
void DisplayQuestBubbles(unsigned int index)
Display quests in bubbles.
bool OnMouseDown(int button, int modifiers, int x, int y)
Manage mouse down event to test for and apply window changes.
This window shows the popup menu of available responses when talking to an NPC.
void ShowIfBubbles()
Shows the window only if it's in bubbles mode, else does nothing.
void OnListAction(pawsListBox *widget, int status)
Called whenever an item in a child list box is selected.
virtual void DrawBackground()
Has a real functionality only when using the bubbles npc dialog.
CREATE_PAWS_FACTORY(pawsNpcDialogWindow)
void ShowSpeechBubble()
Shows the npc chat window and hides the menu bubbles.
virtual void BringToTop(pawsWidget *widget)
Move this widget up the z order to the top.
The structure of 1 queue entry (pointer to a message)
void SaveSetting()
Saves the setting of the menu used for later use.
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 provid...
void SetNpcMsgTimeoutScale(float timeoutScale)
Setter for npc messsage timeout.
bool OnButtonPressed(int button, int keyModifier, pawsWidget *widget)
callback function called when a pawsButton (bubble) is clicked
virtual void Draw()
Handles timing to make bubbles disappear in the bubbles npc dialog mode.
float GetNpcMsgTimeoutScaleMax()
Getter for npc messsage timeout.
A simple list box widget.
float GetNpcMsgTimeoutScale()
Getter for npc messsage timeout.
void LoadQuest(csString xmlstr)
Load quest info from xmlbinding message.
void SetupWindowWidgets()
Sets the widget appropriate for display depending on the type of npc dialog menu used.
bool LoadSetting()
Loads the settings from the config files and sets the window appropriately.
bool GetUseBubbles()
Getter for useBubbles, which states if we use the bubbles based npcdialog interface.
virtual void Hide()
Makes widget invisible and removes focus if widget has current focus.
void HandleMessage(MsgEntry *me)
bool PostSetup()
Aquire pointers to widgets and load settings for the npc dialog.
void SetUseBubbles(bool useBubblesNew)
Sets if we have to use the bubbles based npc dialog interface (true) or the classic menu based one (f...
This interface defines the callback used by pawsStringPromptWindow to notify another window of a supp...
void CleanBubbles()
empties all bubbles structures and hides them.
void NpcSays()
Display NPC's chat text.
virtual void Show()
Shows the window and applies some special handling to fix up the window Behaviour and graphics correc...
void ShowOnlyFreeText()
Hides all bubbles except freetext and bye.