diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/CMakeLists.txt b/Sources/Plasma/FeatureLib/pfGameGUIMgr/CMakeLists.txt index 7bc38022..729586aa 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/CMakeLists.txt +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/CMakeLists.txt @@ -43,7 +43,7 @@ set(pfGameGUIMgr_HEADERS pfGUICtrlGenerator.h pfGUIDialogHandlers.h pfGUIDialogMod.h - pfGUIDialogNotifyProc.cpp + pfGUIDialogNotifyProc.h pfGUIDragBarCtrl.h pfGUIDraggableMod.h pfGUIDynDisplayCtrl.h diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogNotifyProc.cpp b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogNotifyProc.cpp index 5c923bbe..a5d3c081 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogNotifyProc.cpp +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogNotifyProc.cpp @@ -97,6 +97,16 @@ void pfGUIDialogNotifyProc::DoSomething( pfGUIControlMod *ctrl ) ISendNotify( ctrl->GetKey(), pfGUINotifyMsg::kValueChanged ); } +void pfGUIDialogNotifyProc::HandleExtendedEvent( pfGUIControlMod *ctrl, uint32_t event ) +{ + pfGUIEditBoxMod *edit = pfGUIEditBoxMod::ConvertNoRef( ctrl ); + if(edit != nil && event == pfGUIEditBoxMod::kWantAutocomplete) + { + //send notify, somebody will do something with that (like python script) + ISendNotify( ctrl->GetKey(), pfGUINotifyMsg::kSpecialAction ); + } +} + void pfGUIDialogNotifyProc::OnInit( void ) { if ( fDialog ) diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogNotifyProc.h b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogNotifyProc.h index 81927a10..e84ec6d5 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogNotifyProc.h +++ b/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_t event ); virtual void OnInit( void ); virtual void OnShow( void ); virtual void OnHide( void ); diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp index b87da3e2..b285d409 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp @@ -379,6 +379,11 @@ hsBool pfGUIEditBoxMod::HandleKeyEvent( pfGameGUIMgr::EventType event, plKeyDef DoSomething(); // Query WasEscaped() to see if it was escape vs enter return true; } + else if (key == KEY_TAB) + { + //Send notify for python scripts + HandleExtendedEvent(kWantAutocomplete); + } else if (modifiers & pfGameGUIMgr::kCtrlDown) { if (key == KEY_C) diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.h b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.h index 4da5ba9a..6a76ad5a 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.h +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.h @@ -129,7 +129,8 @@ class pfGUIEditBoxMod : public pfGUIControlMod // Extended event types enum ExtendedEvents { - kValueChanging + kValueChanging, + kWantAutocomplete }; }; diff --git a/Sources/Plasma/FeatureLib/pfMessage/CMakeLists.txt b/Sources/Plasma/FeatureLib/pfMessage/CMakeLists.txt index ca4a400b..6ea4780a 100644 --- a/Sources/Plasma/FeatureLib/pfMessage/CMakeLists.txt +++ b/Sources/Plasma/FeatureLib/pfMessage/CMakeLists.txt @@ -14,6 +14,7 @@ set(pfMessage_SOURCES set(pfMessage_HEADERS pfBackdoorMsg.h pfGameGUIMsg.h + pfGUINotifyMsg.h pfKIMsg.h pfMarkerMsg.h pfMessageCreatable.h diff --git a/Sources/Plasma/FeatureLib/pfMessage/pfGUINotifyMsg.h b/Sources/Plasma/FeatureLib/pfMessage/pfGUINotifyMsg.h index 82afa406..cc9b4e90 100644 --- a/Sources/Plasma/FeatureLib/pfMessage/pfGUINotifyMsg.h +++ b/Sources/Plasma/FeatureLib/pfMessage/pfGUINotifyMsg.h @@ -83,6 +83,7 @@ public: kFocusChange, // when one of its controls loses focus to another kExitMode, // GUI Exit Mode key was pressed kInterestingEvent, // GUI interesting-ness has changed + kSpecialAction, // meaning depends on control functionality (see below) kEndEventList }; @@ -97,6 +98,7 @@ public: // kAction - single click on item(s) // kEditBox // kAction - enter key hit +// kSpecialAction - tab key hit (for autocompletion on Python side) // kUpDownPair // kValueChanged - the value of the pair has been changed // kKnob