@@ -45,6 +45,9 @@ namespace sub
4545
4646 namespace AnimationSub_catind
4747 {
48+ std::string _searchStr = std::string();
49+ void ClearSearchStr () { _searchStr.clear (); }
50+
4851 // struct NamedAnimation { std::string caption; std::string animDict, animName; };
4952 const std::vector<AnimationSub_catind::NamedAnimation> vPresetPedAnims
5053 {
@@ -174,13 +177,13 @@ namespace sub
174177
175178 AddOption (_searchStr.empty () ? " SEARCH" : boost::to_upper_copy (_searchStr), searchobj, nullFunc, -1 , true ); if (searchobj)
176179 {
177- _searchStr = Game::InputBox (_searchStr, 126U , " " , _searchStr);
180+ _searchStr = Game::InputBox (_searchStr, 126U , " SEARCH " , _searchStr);
178181 boost::to_lower (_searchStr);
179182 // OnscreenKeyboard::State::Set(OnscreenKeyboard::Purpose::SearchToLower, _searchStr, 126U, std::string(), _searchStr);
180183 // OnscreenKeyboard::State::arg1._ptr = reinterpret_cast<void*>(&_searchStr);
181184 }
182185
183- AddOption (" Stop Animation" , null , AnimationSub_StopAnimationCallback);
186+ AddTickol (" Stop Animation" , true , AnimationSub_StopAnimationCallback, AnimationSub_StopAnimationCallback, TICKOL::CROSS );
184187
185188 for (auto & current : vAllPedAnims)
186189 {
@@ -193,9 +196,14 @@ namespace sub
193196 notFoundInDict = true ;
194197 for (auto & current2 : current.second )
195198 {
196- if (current2.find (_searchStr) != std::string::npos) { notFoundInDict = false ; break ; }
199+ if (current2.find (_searchStr) != std::string::npos)
200+ {
201+ notFoundInDict = false ;
202+ break ;
203+ }
197204 }
198- if (notFoundInDict) { continue ; }
205+ if (notFoundInDict)
206+ continue ;
199207 }
200208 }
201209
@@ -437,7 +445,7 @@ namespace sub
437445 SET_PED_IS_IGNORED_BY_AUTO_OPEN_DOORS (Static_241, TRUE );
438446
439447 AddTitle (" Animations" );
440- AddOption (" Stop Animation" , null , AnimationSub_StopAnimationCallback);
448+ AddTickol (" Stop Animation" , true , AnimationSub_StopAnimationCallback, AnimationSub_StopAnimationCallback, TICKOL::CROSS );
441449 AddanimOption_ (" Pole Dance" , " mini@strip_club@pole_dance@pole_dance3" , " pd_dance_03" );
442450 AddanimOption_ (" Hood Dance" , " missfbi3_sniping" , " dance_m_default" );
443451 AddanimOption_ (" Burning" , " ragdoll@human" , " on_fire" );
@@ -561,16 +569,34 @@ namespace sub
561569 Menu::SetSub_previous ();
562570 return ;
563571 }
564-
565572 auto nodeAnims = doc.child (" PedAnims" );
566573
574+ Menu::OnSubBack = AnimationSub_catind::ClearSearchStr;
575+ auto & _searchStr = AnimationSub_catind::_searchStr;
576+
567577 AddTitle (" Favourites" );
568578
579+ bool bSearchPressed = false ;
580+ AddOption (_searchStr.empty () ? " SEARCH" : boost::to_upper_copy (_searchStr), bSearchPressed, nullFunc, -1 , true ); if (bSearchPressed)
581+ {
582+ _searchStr = Game::InputBox (_searchStr, 126U , " SEARCH" , _searchStr);
583+ boost::to_lower (_searchStr);
584+ // OnscreenKeyboard::State::Set(OnscreenKeyboard::Purpose::SearchToUpper, _searchStr, 126U, std::string(), _searchStr);
585+ // OnscreenKeyboard::State::arg1._ptr = reinterpret_cast<void*>(&_searchStr);
586+ }
587+
569588 for (auto nodeAnim = nodeAnims.first_child (); nodeAnim; nodeAnim = nodeAnim.next_sibling ())
570589 {
571590 std::string dict = nodeAnim.attribute (" dict" ).as_string ();
572591 std::string name = nodeAnim.attribute (" name" ).as_string ();
573592
593+ if (!_searchStr.empty ())
594+ {
595+ if (dict.find (_searchStr) == std::string::npos &&
596+ name.find (_searchStr) == std::string::npos)
597+ continue ;
598+ }
599+
574600 AddanimOption_ (dict + " , " + name, dict, name);
575601 }
576602 }
@@ -1156,7 +1182,7 @@ namespace sub
11561182 AddOption (" ALL SCENARIOS" , clearSearchStr, nullFunc, SUB::ANIMATIONSUB_TASKSCENARIOS2); if (clearSearchStr)
11571183 _searchStr.clear ();
11581184
1159- AddOption (" End Scenarios" , null , stopScenarioPls);
1185+ AddTickol (" End Scenarios" , true , stopScenarioPls, stopScenarioPls, TICKOL::CROSS );
11601186
11611187 for (auto & scen : vNamedScenarios)
11621188 {
@@ -1171,13 +1197,13 @@ namespace sub
11711197
11721198 AddOption (_searchStr.empty () ? " SEARCH" : boost::to_upper_copy (_searchStr), searchobj, nullFunc, -1 , true ); if (searchobj)
11731199 {
1174- _searchStr = Game::InputBox (_searchStr, 126U , " " , _searchStr);
1200+ _searchStr = Game::InputBox (_searchStr, 126U , " SEARCH " , _searchStr);
11751201 boost::to_lower (_searchStr);
11761202 // OnscreenKeyboard::State::Set(OnscreenKeyboard::Purpose::SearchToLower, _searchStr, 126U, std::string(), _searchStr);
11771203 // OnscreenKeyboard::State::arg1._ptr = reinterpret_cast<void*>(&_searchStr);
11781204 }
11791205
1180- AddOption (" End Scenarios" , null , stopScenarioPls);
1206+ AddTickol (" End Scenarios" , true , stopScenarioPls, stopScenarioPls, TICKOL::CROSS );
11811207
11821208 for (auto & current : vValues_TaskScenarios)
11831209 {
0 commit comments