Browse Source

Merge branch 'marten/Filtik-chat-history-browsing'

close #3
marten/Filtik-chat-history-browsing
rarified 4 years ago
parent
commit
5cf75b4552
  1. 14
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogNotifyProc.cpp
  2. 1
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogNotifyProc.h
  3. 14
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp
  4. 4
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.h
  5. 4
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfMessage/pfGUINotifyMsg.h

14
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogNotifyProc.cpp

@ -97,6 +97,20 @@ void pfGUIDialogNotifyProc::DoSomething( pfGUIControlMod *ctrl )
ISendNotify( ctrl->GetKey(), pfGUINotifyMsg::kValueChanged );
}
void pfGUIDialogNotifyProc::HandleExtendedEvent( pfGUIControlMod *ctrl, UInt32 event )
{
pfGUIEditBoxMod *edit = pfGUIEditBoxMod::ConvertNoRef( ctrl );
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 )
{
if ( fDialog )

1
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogNotifyProc.h

@ -70,6 +70,7 @@ class pfGUIDialogNotifyProc : public pfGUIDialogProc
pfGUIDialogNotifyProc( plKey &r );
virtual void DoSomething( pfGUIControlMod *ctrl );
virtual void HandleExtendedEvent( pfGUIControlMod *ctrl, UInt32 event );
virtual void OnInit( void );
virtual void OnShow( void );
virtual void OnHide( void );

14
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp

@ -458,11 +458,11 @@ hsBool 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();
}
@ -502,6 +502,16 @@ hsBool pfGUIEditBoxMod::HandleKeyEvent( pfGameGUIMgr::EventType event, plKeyDef
DoSomething(); // Query WasEscaped() to see if it was escape vs enter
return true;
}
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)

4
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.h

@ -134,7 +134,9 @@ class pfGUIEditBoxMod : public pfGUIControlMod
// Extended event types
enum ExtendedEvents
{
kValueChanging
kValueChanging,
kWantMessageHistoryUp,
kWantMessageHistoryDown
};
};

4
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfMessage/pfGUINotifyMsg.h

@ -83,6 +83,8 @@ public:
kFocusChange, // when one of its controls loses focus to another
kExitMode, // GUI Exit Mode key was pressed
kInterestingEvent, // GUI interesting-ness has changed
kMessageHistoryUp = 9, // up key to scroll back in history
kMessageHistoryDown,// down key to scroll forward in history
kEndEventList
};
@ -97,6 +99,8 @@ public:
// kAction - single click on item(s)
// kEditBox
// kAction - enter key hit
// kMessageHistoryUp - up key hit
// kMessageHistoryDown - down key hit
// kUpDownPair
// kValueChanged - the value of the pair has been changed
// kKnob

Loading…
Cancel
Save