Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement chat history browsing (Client and Python) #416

Merged
merged 1 commit into from
May 10, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ void pfGUIDialogNotifyProc::HandleExtendedEvent( pfGUIControlMod *ctrl, uint32_t
//send notify, somebody will do something with that (like python script)
ISendNotify( ctrl->GetKey(), pfGUINotifyMsg::kSpecialAction );
}
else if(edit && event == pfGUIEditBoxMod::kWantMessageHistoryUp)
{
ISendNotify( ctrl->GetKey(), pfGUINotifyMsg::kMessageHistoryUp );
}
else if(edit && event == pfGUIEditBoxMod::kWantMessageHistoryDown)
{
ISendNotify( ctrl->GetKey(), pfGUINotifyMsg::kMessageHistoryDown );
}
}

void pfGUIDialogNotifyProc::OnInit( void )
Expand Down
16 changes: 13 additions & 3 deletions Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,11 @@ bool pfGUIEditBoxMod::HandleKeyEvent( pfGameGUIMgr::EventType event, plKeyDef
{
fFirstHalfExitKeyPushed = false;
// Use arrow keys to do our dirty work
if( key == KEY_UP || key == KEY_HOME )
if( key == KEY_HOME )
{
SetCursorToHome();
}
else if( key == KEY_DOWN || key == KEY_END )
else if( key == KEY_END )
{
SetCursorToEnd();
}
Expand Down Expand Up @@ -381,9 +381,19 @@ bool pfGUIEditBoxMod::HandleKeyEvent( pfGameGUIMgr::EventType event, plKeyDef
}
else if (key == KEY_TAB)
{
//Send notify for python scripts
// Send notify for python scripts
HandleExtendedEvent(kWantAutocomplete);
}
else if (key == KEY_UP)
{
// Send notify for python scripts
HandleExtendedEvent(kWantMessageHistoryUp);
}
else if (key == KEY_DOWN)
{
// Send notify for python scripts
HandleExtendedEvent(kWantMessageHistoryDown);
}
else if (modifiers & pfGameGUIMgr::kCtrlDown)
{
if (key == KEY_C)
Expand Down
4 changes: 3 additions & 1 deletion Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ class pfGUIEditBoxMod : public pfGUIControlMod
enum ExtendedEvents
{
kValueChanging,
kWantAutocomplete
kWantAutocomplete,
kWantMessageHistoryUp,
kWantMessageHistoryDown
};
};

Expand Down
4 changes: 4 additions & 0 deletions Sources/Plasma/FeatureLib/pfMessage/pfGUINotifyMsg.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ class pfGUINotifyMsg : public plMessage
kExitMode, // GUI Exit Mode key was pressed
kInterestingEvent, // GUI interesting-ness has changed
kSpecialAction, // meaning depends on control functionality (see below)
kMessageHistoryUp, // up key to scroll back in history
kMessageHistoryDown,// down key to scroll forward in history
kEndEventList
};

Expand All @@ -99,6 +101,8 @@ class pfGUINotifyMsg : public plMessage
// kEditBox
// kAction - enter key hit
// kSpecialAction - tab key hit (for autocompletion on Python side)
// kMessageHistoryUp - up key hit
// kMessageHistoryDown - down key hit
// kUpDownPair
// kValueChanged - the value of the pair has been changed
// kKnob
Expand Down