-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathMenuExample.cs
More file actions
2163 lines (1935 loc) · 123 KB
/
Copy pathMenuExample.cs
File metadata and controls
2163 lines (1935 loc) · 123 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
using CitizenFX.Core;
using CitizenFX.Core.Native;
using CitizenFX.Core.UI;
using ScaleformUI;
using ScaleformUI.Elements;
using ScaleformUI.LobbyMenu;
using ScaleformUI.Menu;
using ScaleformUI.Menus;
using ScaleformUI.PauseMenu;
using ScaleformUI.PauseMenus.Elements;
using ScaleformUI.PauseMenus.Elements.Columns;
using ScaleformUI.PauseMenus.Elements.Items;
using ScaleformUI.PauseMenus.Elements.Panels;
using ScaleformUI.Radial;
using ScaleformUI.Radio;
using ScaleformUI.Scaleforms;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Threading.Tasks;
public class MenuExample : BaseScript
{
private bool enabled = true;
private string dish = "Banana";
//private TimerBarPool _timerBarPool;
private long txd;
private Random Random = new Random(API.GetGameTimer());
private UIMenu exampleMenu = new UIMenu("ScaleformUI", "ScaleformUI ~o~SHOWCASE", new PointF(376, 50), "commonmenu", "interaction_bgd", true, true, MenuAlignment.RIGHT);
#region UIMenu
public async void ExampleMenu()
{
long _titledui = API.CreateDui("https://media.tenor.com/-sL5lSwzQSkAAAAi/rolling-cute.gif", 288, 130);
API.CreateRuntimeTextureFromDuiHandle(txd, "bannerbackground", API.GetDuiHandle(_titledui));
long _kitten = API.CreateDui("https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExczA0dXhscDRqbHBmb3I2bmk4dDVzd25uNmhhbHNmMnE5N3hkYTM0MiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/tY27Dk0H8IisGidQv6/giphy.gif", 480, 480);
API.CreateRuntimeTextureFromDuiHandle(txd, "kitty", API.GetDuiHandle(_kitten));
// first true means add menu Glare scaleform to the menu
// last true means it's using the alternative title style
exampleMenu = new UIMenu("ScaleformUI", "ScaleformUI ~o~SHOWCASE", new PointF(376, 50), "commonmenu", "interaction_bgd", true, true, MenuAlignment.RIGHT);
exampleMenu.MaxItemsOnScreen = 7; // To decide max items on screen at time, default 7
exampleMenu.SetMouse(true, false, true, false, false);
//exampleMenu.CounterColor = HudColor.HUD_COLOUR_PINK;
// let's add the menu to the Pool
#region Menu Declaration
#region Big Message
UIMenuItem bigMessageItem = new UIMenuItem("~g~Big~s~ Message ~r~Examples~s~", "Select me to switch to the BigMessage menu!");
bigMessageItem.KeepTextColorWhite = true;
bigMessageItem.SetCustomLeftBadge("scaleformui", "kitty");
bigMessageItem.SetCustomRightBadge("scaleformui", "kitty");
UIMenu uiMenuBigMessage = new UIMenu("Big Message", "Big Message");
exampleMenu.AddItem(bigMessageItem);
UIMenuListItem uiListBigMessageTransition = new UIMenuListItem("Big Message", new List<dynamic>() { "TRANSITION_OUT", "TRANSITION_UP", "TRANSITION_DOWN" }, 0);
uiListBigMessageTransition.Description = "Transition type for the big message when disposing";
uiMenuBigMessage.AddItem(uiListBigMessageTransition);
UIMenuCheckboxItem uiCheckboxBigMessageManualDispose = new UIMenuCheckboxItem("Manual Dispose", false, "If enabled, you will have to manually dispose the big message");
uiMenuBigMessage.AddItem(uiCheckboxBigMessageManualDispose);
UIMenuListItem uiListBigMessageType = new UIMenuListItem("Message Type", new List<dynamic>() { "Mission Passed", "Coloured Shard", "Old Message", "Simple Shard", "Rank Up", "MP Message Large",
"MP Wasted Message", "Mission Passed: Label" }, 0);
uiListBigMessageType.Description = "Message type for the big message, press ~INPUT_FRONTEND_ACCEPT~ to show the message";
uiMenuBigMessage.AddItem(uiListBigMessageType);
UIMenuItem uiItemBigMessageDispose = new UIMenuItem("Dispose Big Message", "Dispose the big message");
uiItemBigMessageDispose.Enabled = false;
uiMenuBigMessage.AddItem(uiItemBigMessageDispose);
uiMenuBigMessage.OnCheckboxChange += (sender, item, _checked) =>
{
if (item == uiCheckboxBigMessageManualDispose)
{
if (_checked)
uiItemBigMessageDispose.Enabled = true;
else
uiItemBigMessageDispose.Enabled = false;
}
};
uiMenuBigMessage.OnItemSelect += (sender, item, index) =>
{
if (item == uiItemBigMessageDispose)
{
if (uiCheckboxBigMessageManualDispose.Checked)
ScaleformUI.Main.BigMessageInstance.Dispose();
}
};
uiMenuBigMessage.OnListSelect += (sender, item, index) =>
{
if (item == uiListBigMessageTransition)
{
switch (index)
{
case 0:
ScaleformUI.Main.BigMessageInstance.Transition = "TRANSITION_OUT";
break;
case 1:
ScaleformUI.Main.BigMessageInstance.Transition = "TRANSITION_UP";
break;
case 2:
ScaleformUI.Main.BigMessageInstance.Transition = "TRANSITION_Down";
break;
}
}
else if (item == uiListBigMessageType)
{
switch (index)
{
case 0:
ScaleformUI.Main.BigMessageInstance.ShowMissionPassedMessage("Mission Passed", manualDispose: uiCheckboxBigMessageManualDispose.Checked);
break;
case 1:
ScaleformUI.Main.BigMessageInstance.ShowColoredShard("Coloured Shard", "Showing the coloured shared", HudColor.HUD_COLOUR_WHITE, HudColor.HUD_COLOUR_FREEMODE, manualDispose: uiCheckboxBigMessageManualDispose.Checked);
break;
case 2:
ScaleformUI.Main.BigMessageInstance.ShowOldMessage("Old Message", manualDispose: uiCheckboxBigMessageManualDispose.Checked);
break;
case 3:
ScaleformUI.Main.BigMessageInstance.ShowSimpleShard("Simple Shard", "Showing the simple shard", manualDispose: uiCheckboxBigMessageManualDispose.Checked);
break;
case 4:
ScaleformUI.Main.BigMessageInstance.ShowRankupMessage("Rank Up", "Showing the rank up message", 10, manualDispose: uiCheckboxBigMessageManualDispose.Checked);
break;
case 5:
ScaleformUI.Main.BigMessageInstance.ShowMpMessageLarge("MP Message Large", manualDispose: uiCheckboxBigMessageManualDispose.Checked);
break;
case 6:
ScaleformUI.Main.BigMessageInstance.ShowMpWastedMessage("MP Wasted Message", "Wasted", manualDispose: uiCheckboxBigMessageManualDispose.Checked);
break;
case 7:
const string CUSTOM_LABEL = "SCALEFORMUI_CUSTOM_LABEL";
API.AddTextEntry(CUSTOM_LABEL, "ScaleformUI is the best solution!");
ScaleformLabel scaleformLabel = CUSTOM_LABEL;
ScaleformUI.Main.BigMessageInstance.ShowMissionPassedMessage(scaleformLabel, manualDispose: uiCheckboxBigMessageManualDispose.Checked);
break;
}
}
};
bigMessageItem.Activated += (menu, item) =>
{
menu.SwitchTo(uiMenuBigMessage, inheritOldMenuParams: true);
};
#endregion
UIMenuCheckboxItem ketchupItem = new UIMenuCheckboxItem("~g~Scrolling animation enabled? ~b~in a very long label to ~o~test the text scrolling feature!", UIMenuCheckboxStyle.Tick, enabled, "Do you wish to enable the scrolling animation?");
long _paneldui = API.CreateDui("https://i.imgur.com/mH0Y65C.gif", 288, 160);
API.CreateRuntimeTextureFromDuiHandle(txd, "panelbackground", API.GetDuiHandle(_paneldui));
UIMissionDetailsPanel sidePanel = new UIMissionDetailsPanel(PanelSide.Right, "Side Panel", false, "scaleformui", "bannerbackground");
UIFreemodeDetailsItem detailItem1 = new UIFreemodeDetailsItem("Left Label", "RIGHT LABEL", ScaleformFonts.SIGNPAINTER_HOUSESCRIPT, ScaleformFonts.GTAV_TAXI_DIGITAL, BadgeIcon.BRIEFCASE, SColor.FromRandomValues());
UIFreemodeDetailsItem detailItem2 = new UIFreemodeDetailsItem("Left Label", "RIGHT LABEL", ScaleformFonts.SIGNPAINTER_HOUSESCRIPT, ScaleformFonts.GTAV_TAXI_DIGITAL, BadgeIcon.MISSION_STAR, SColor.FromRandomValues());
UIFreemodeDetailsItem detailItem3 = new UIFreemodeDetailsItem("Left Label", "RIGHT LABEL", ScaleformFonts.SIGNPAINTER_HOUSESCRIPT, ScaleformFonts.GTAV_TAXI_DIGITAL, BadgeIcon.ARMOR, SColor.FromRandomValues());
UIFreemodeDetailsItem detailItem4 = new UIFreemodeDetailsItem("Left Label", "RIGHT LABEL", ScaleformFonts.SIGNPAINTER_HOUSESCRIPT, ScaleformFonts.GTAV_TAXI_DIGITAL, BadgeIcon.BRAND_DILETTANTE, SColor.FromRandomValues());
UIFreemodeDetailsItem detailItem5 = new UIFreemodeDetailsItem("Left Label", "RIGHT LABEL", ScaleformFonts.SIGNPAINTER_HOUSESCRIPT, ScaleformFonts.GTAV_TAXI_DIGITAL, BadgeIcon.COUNTRY_ITALY, SColor.White);
sidePanel.AddItem(detailItem1);
sidePanel.AddItem(detailItem2);
sidePanel.AddItem(detailItem3);
sidePanel.AddItem(detailItem4);
sidePanel.AddItem(detailItem5);
ketchupItem.AddSidePanel(sidePanel);
ketchupItem.SetLeftBadge(BadgeIcon.STAR);
exampleMenu.AddItem(ketchupItem);
UIMenuItem cookItem = new UIMenuItem("Cook! in a very long label to test the text scrolling feature!", "Cook the dish with the appropiate ingredients and ketchup.");
cookItem.SetRightLabel("rightLabel");
cookItem.LabelFont = ScaleformFonts.ENGRAVERS_OLD_ENGLISH_MT_STD;
cookItem.RightLabelFont = ScaleformFonts.PRICEDOWN_GTAV_INT;
exampleMenu.AddItem(cookItem);
UIVehicleColourPickerPanel sidePanelB = new UIVehicleColourPickerPanel(PanelSide.Right, "ColorPicker");
cookItem.AddSidePanel(sidePanelB);
cookItem.SetRightBadge(BadgeIcon.STAR);
sidePanelB.OnVehicleColorPickerSelect += (item, panel, value, color) =>
{
Notifications.ShowNotification($"Vehicle Color: {(VehicleColor)value}");
sidePanelB.Title = ((VehicleColor)value).ToString();
};
UIMenuListItem scrollType = new UIMenuListItem("Choose how this menu will scroll!", new List<dynamic>() { "~r~CLASSIC", "~g~PAGINATED", "~b~ENDLESS" }, (int)exampleMenu.ScrollingType);
exampleMenu.AddItem(scrollType);
scrollType.OnListChanged += (item, index) =>
{
exampleMenu.ScrollingType = (ScrollingType)index;
};
UIMenuItem colorItem = new UIMenuItem("UIMenuItem with Colors", "~b~Look!!~r~I can be colored ~y~too!!~w~~n~Every item now supports custom colors!", SColor.HUD_Purple, SColor.HUD_Pink);
exampleMenu.AddItem(colorItem);
float dynamicvalue = 0f;
UIMenuDynamicListItem dynamicItem = new UIMenuDynamicListItem("Dynamic List Item", "Try pressing ~INPUT_FRONTEND_LEFT~ or ~INPUT_FRONTEND_RIGHT~", dynamicvalue.ToString("F3"), async (sender, direction) =>
{
if (direction == ChangeDirection.Left) dynamicvalue -= 0.01f;
else dynamicvalue += 0.01f;
return dynamicvalue.ToString("F3");
});
dynamicItem.BlinkDescription = true;
exampleMenu.AddItem(dynamicItem);
List<dynamic> foodsList = new List<dynamic>
{
"LINEAR",
"QUADRATIC_IN",
"QUADRATIC_OUT",
"QUADRATIC_INOUT",
"CUBIC_IN",
"CUBIC_OUT",
"CUBIC_INOUT",
"QUARTIC_IN",
"QUARTIC_OUT",
"QUARTIC_INOUT",
"SINE_IN",
"SINE_OUT",
"SINE_INOUT",
"BACK_IN",
"BACK_OUT",
"BACK_INOUT",
"CIRCULAR_IN",
"CIRCULAR_OUT",
"CIRCULAR_INOUT"
};
UIMenuSeparatorItem BlankItem = new UIMenuSeparatorItem("Separator (Jumped)", true);
UIMenuSeparatorItem BlankItem_2 = new UIMenuSeparatorItem("Separator (not Jumped)", false);
exampleMenu.AddItem(BlankItem);
exampleMenu.AddItem(BlankItem_2);
UIMenuSliderItem slider = new UIMenuSliderItem("Slider Item", "Cool!", true); // by default max is 100 and multipler 5 = 20 steps.
exampleMenu.AddItem(slider);
UIMenuProgressItem progress = new UIMenuProgressItem("Slider Progress Item", 10, 0);
exampleMenu.AddItem(progress);
UIMenuItem listPanelItem0 = new UIMenuItem("Change Color", "It can be whatever item you want it to be");
UIMenuColorPanel ColorPanel = new UIMenuColorPanel("Color Panel Example", ColorPanelType.Hair);
// you can choose between hair palette or makeup palette or custom
exampleMenu.AddItem(listPanelItem0);
listPanelItem0.AddPanel(ColorPanel);
UIMenuItem listPanelItem1 = new UIMenuItem("Custom palette panel");
UIMenuColorPanel ColorPanelCustom = new UIMenuColorPanel("Custom Palette Example", new List<SColor> { SColor.FromRandomValues(), SColor.FromRandomValues(), SColor.FromRandomValues(), SColor.FromRandomValues(), SColor.FromRandomValues() }, 0);
exampleMenu.AddItem(listPanelItem1);
listPanelItem1.AddPanel(ColorPanelCustom);
UIMenuItem listPanelItem2 = new UIMenuItem("Change Percentage", "It can be whatever item you want it to be");
UIMenuPercentagePanel PercentagePanel = new UIMenuPercentagePanel("Percentage Panel", "0%", "100%");
// You can change every text in this Panel
exampleMenu.AddItem(listPanelItem2);
listPanelItem2.AddPanel(PercentagePanel);
UIMenuListItem listPanelItem3 = new UIMenuListItem("Change Grid Position", new List<dynamic>() { "It", "can", "be", "whatever", "item", "you", "want", "it", "to", "be" }, 0);
UIMenuGridPanel GridPanel = new UIMenuGridPanel("Up", "Left", "Right", "Down", new System.Drawing.PointF(.5f, .5f));
UIMenuGridPanel HorizontalGridPanel = new UIMenuGridPanel("Left", "Right", new System.Drawing.PointF(.5f, .5f));
// you can choose the text in every position and where to place the starting position of the cirlce
exampleMenu.AddItem(listPanelItem3);
listPanelItem3.AddPanel(GridPanel);
listPanelItem3.AddPanel(HorizontalGridPanel);
listPanelItem3.OnListChanged += (a, b) =>
{
var rand = new Random();
((UIMenuGridPanel)listPanelItem3.Panels[0]).CirclePosition = new PointF((float)rand.NextDouble(), (float)rand.NextDouble());
};
UIMenuListItem listPanelItem4 = new UIMenuListItem("Look at Statistics", new List<object> { "Example", "example2" }, 0);
UIMenuStatisticsPanel statistics = new UIMenuStatisticsPanel();
exampleMenu.AddItem(listPanelItem4);
listPanelItem4.AddPanel(statistics);
statistics.AddStatistics("Look at this!", 0);
statistics.AddStatistics("I'm a statistic too!", 0);
statistics.AddStatistics("Am i not?!", 0);
//you can add as menu statistics you want
statistics.UpdateStatistic(0, 10f);
statistics.UpdateStatistic(1, 50f);
statistics.UpdateStatistic(2, 100f);
listPanelItem4.OnListChanged += (a, b) =>
{
switch (b)
{
case 0:
statistics.UpdateStatistic(0, 10f);
statistics.UpdateStatistic(1, 50f);
statistics.UpdateStatistic(2, 100f);
break;
case 1:
statistics.UpdateStatistic(0, 100f);
statistics.UpdateStatistic(1, 50f);
statistics.UpdateStatistic(2, 10f);
break;
}
};
//and you can get / set their percentage
#region Windows SubMenu
UIMenuItem windowsItem = new UIMenuItem("Windows SubMenu item label", "this is the submenu binded item description");
UIMenuColourPickePanel p = new UIMenuColourPickePanel(ColorPickerType.Classic);
windowsItem.AddPanel(p);
windowsItem.SetRightLabel(">>>");
exampleMenu.AddItem(windowsItem);
UIMenu windowSubmenu = new UIMenu("Windows Menu", "submenu description");
UIMenuHeritageWindow heritageWindow = new UIMenuHeritageWindow(0, 0);
UIMenuDetailsWindow statsWindow = new UIMenuDetailsWindow("Parents resemblance", "Dad:", "Mom:", true, new List<UIDetailStat>());
windowSubmenu.AddWindow(heritageWindow);
windowSubmenu.AddWindow(statsWindow);
List<dynamic> momfaces = new List<dynamic>() { "Hannah", "Audrey", "Jasmine", "Giselle", "Amelia", "Isabella", "Zoe", "Ava", "Camilla", "Violet", "Sophia", "Eveline", "Nicole", "Ashley", "Grace", "Brianna", "Natalie", "Olivia", "Elizabeth", "Charlotte", "Emma", "Misty" };
List<dynamic> dadfaces = new List<dynamic>() { "Benjamin", "Daniel", "Joshua", "Noah", "Andrew", "Joan", "Alex", "Isaac", "Evan", "Ethan", "Vincent", "Angel", "Diego", "Adrian", "Gabriel", "Michael", "Santiago", "Kevin", "Louis", "Samuel", "Anthony", "Claude", "Niko", "John" };
UIMenuListItem mom = new UIMenuListItem("Mom", momfaces, 0);
UIMenuListItem dad = new UIMenuListItem("Dad", dadfaces, 0);
UIMenuSliderItem newItem = new UIMenuSliderItem("Heritage Slider", "This is Useful on heritage", 100, 5, 50, true);
windowSubmenu.AddItem(mom);
windowSubmenu.AddItem(dad);
windowSubmenu.AddItem(newItem);
statsWindow.DetailMid = "Dad: " + newItem.Value + "%";
statsWindow.DetailBottom = "Mom: " + (100 - newItem.Value) + "%";
statsWindow.DetailStats = new List<UIDetailStat>()
{
new UIDetailStat(100-newItem.Value, SColor.HUD_Pink),
new UIDetailStat(newItem.Value, SColor.HUD_Freemode),
};
windowsItem.Activated += (sender, e) =>
{
sender.SwitchTo(windowSubmenu, inheritOldMenuParams: true);
};
#endregion
#region Scaleforms SubMenu
UIMenuItem scaleformItem = new UIMenuItem("Scaleforms Showdown", "Let's try them!");
scaleformItem.SetRightLabel(">>>");
exampleMenu.AddItem(scaleformItem);
UIMenu scaleformMenu = new("Scaleforms Showdown", "Let's try them!");
UIMenuItem showSimplePopup = new UIMenuItem("Show PopupWarning example", "You can customize it to your needs");
UIMenuItem showPopupButtons = new UIMenuItem("Show PopupWarning with buttons", "It waits until a button has been pressed!");
UIMenuListItem customInstr = new UIMenuListItem("SavingNotification", Enum.GetNames(typeof(LoadingSpinnerType)).Cast<dynamic>().ToList(), 0, "InstructionalButtons now give you the ability to dynamically edit, add, remove, customize your buttons, you can even use them outside the menu ~y~without having to run multiple instances of the same scaleform~w~, aren't you happy??");
UIMenuItem customInstr2 = new UIMenuItem("Add a random InstructionalButton!", "InstructionalButtons now give you the ability to dynamically edit, add, remove, customize your buttons, you can even use them outside the menu ~y~without having to run multiple instances of the same scaleform~w~, aren't you happy??");
UIMenuItem bigMessage = new UIMenuItem("BigMessage example", "");
UIMenuItem midMessage = new UIMenuItem("MediumMessage example", "");
scaleformMenu.AddItem(showSimplePopup);
scaleformMenu.AddItem(showPopupButtons);
scaleformMenu.AddItem(customInstr);
scaleformMenu.AddItem(customInstr2);
scaleformMenu.AddItem(bigMessage);
scaleformMenu.AddItem(midMessage);
scaleformItem.Activated += (sender, args) =>
{
sender.SwitchTo(scaleformMenu, inheritOldMenuParams: true);
};
#endregion
#region Notifications SubMenu
UIMenuItem notificationsItem = new UIMenuItem("This item goes to the notifications", "Let's try them!");
notificationsItem.SetRightLabel(">>>");
exampleMenu.AddItem(notificationsItem);
UIMenu notificationsMenu = new("Notifications Showdown", "Let's try them!");
List<dynamic> colors = Enum.GetNames(typeof(NotificationColor)).ToList<dynamic>();
colors.Add("Classic");
List<dynamic> char_sprites = new List<dynamic>() { "Abigail", "Amanda", "Ammunation", "Andreas", "Antonia", "Ashley", "BankOfLiberty", "BankFleeca", "BankMaze", "Barry", "Beverly", "BikeSite", "BlankEntry", "Blimp", "Blocked", "BoatSite", "BrokenDownGirl", "BugStars", "Call911", "LegendaryMotorsport", "SSASuperAutos", "Castro", "ChatCall", "Chef", "Cheng", "ChengSenior", "Chop", "Cris", "Dave", "Default", "Denise", "DetonateBomb", "DetonatePhone", "Devin", "SubMarine", "Dom", "DomesticGirl", "Dreyfuss", "DrFriedlander", "Epsilon", "EstateAgent", "Facebook", "FilmNoire", "Floyd", "Franklin", "FranklinTrevor", "GayMilitary", "Hao", "HitcherGirl", "Hunter", "Jimmy", "JimmyBoston", "Joe", "Josef", "Josh", "LamarDog", "Lester", "Skull", "LesterFranklin", "LesterMichael", "LifeInvader", "LsCustoms", "LSTI", "Manuel", "Marnie", "Martin", "MaryAnn", "Maude", "Mechanic", "Michael", "MichaelFranklin", "MichaelTrevor", "WarStock", "Minotaur", "Molly", "MorsMutual", "ArmyContact", "Brucie", "FibContact", "RockStarLogo", "Gerald", "Julio", "MechanicChinese", "MerryWeather", "Unicorn", "Mom", "MrsThornhill", "PatriciaTrevor", "PegasusDelivery", "ElitasTravel", "Sasquatch", "Simeon", "SocialClub", "Solomon", "Taxi", "Trevor", "YouTube", "Wade" };
UIMenuListItem noti1 = new UIMenuListItem("Simple Notification", colors, colors.Count - 1, "Can be colored too! Change color and / or select this item to show the notification.");
UIMenuListItem noti2 = new UIMenuListItem("Advanced Notification", char_sprites, 0, "Change the char and see the notification example! (It can be colored too like the simple notification)");
UIMenuItem noti3 = new UIMenuItem("Help Notification", "Insert your text and see the example.");
UIMenuItem noti4 = new UIMenuItem("Floating Help Notification", "This is tricky, it's a 3D notification, you'll have to input a Vector3 to show it!");
UIMenuItem noti5 = new UIMenuItem("Stats Notification", "This is the notification you see in GTA:O when you improve one of your skills.");
UIMenuItem noti6 = new UIMenuItem("VS Notification", "This is the notification you see in GTA:O when you kill someone or get revenge.");
UIMenuItem noti7 = new UIMenuItem("3D Text", "This is known a lot.. let's you draw a 3D text in a precise world coordinates.");
UIMenuItem noti8 = new UIMenuItem("Simple Text", "This will let you draw a 2D text on screen, you'll have to input the 2D (X, Y) coordinates.");
notificationsMenu.AddItem(noti1);
notificationsMenu.AddItem(noti2);
notificationsMenu.AddItem(noti3);
notificationsMenu.AddItem(noti4);
notificationsMenu.AddItem(noti5);
notificationsMenu.AddItem(noti6);
notificationsMenu.AddItem(noti7);
notificationsMenu.AddItem(noti8);
notificationsItem.Activated += (sender, args) =>
{
sender.SwitchTo(notificationsMenu, inheritOldMenuParams: true);
};
#endregion
#region PauseMenu Enabler
UIMenuItem pause = new UIMenuItem("Open Pause Menu");
exampleMenu.AddItem(pause);
pause.Activated += (menu, item) =>
{
PauseMenuShowcase(menu);
};
UIMenuItem itemFilter = new UIMenuItem("Item filtering", "Select this item to filter items based on their labels");
itemFilter.Activated += async (menu, item) =>
{
string filter = await Game.GetUserInput(10);
menu.FilterMenuItems((mb) => mb.Label.ToLower().Contains(filter.ToLower()));
};
UIMenuItem itemSorter = new UIMenuItem("Item sorting", "Activate this item to sort items alphabetically");
itemSorter.Activated += (menu, item) =>
{
menu.SortMenuItems((pair1, pair2) => pair1.Label.ToString().ToLower().CompareTo(pair2.Label.ToString().ToLower()));
};
UIMenuItem ResetFiltering = new UIMenuItem("Reset item filters", "Select this item to reset any filtering");
ResetFiltering.Activated += (menu, item) =>
{
menu.ResetFilter();
};
exampleMenu.AddItem(itemFilter);
exampleMenu.AddItem(itemSorter);
exampleMenu.AddItem(ResetFiltering);
#endregion
#region Offset Changer
UIMenuItem offsetItem = new UIMenuItem("Change Offset", "Change the offset of the menu");
offsetItem.SetRightLabel(">>>");
exampleMenu.AddItem(offsetItem);
UIMenu offsetMenu = new UIMenu("Offset Menu", "Change the offset of the menu");
UIMenuListItem align = new UIMenuListItem("Align Menu", new List<dynamic>() { "Left", "Right" }, (int)exampleMenu.MenuAlignment, "Aligns the menu Left or Right side while still be dependant to SafeZone and offsets");
align.OnListChanged += (item, index) =>
{
item.Parent.MenuAlignment = (MenuAlignment)index;
exampleMenu.MenuAlignment = (MenuAlignment)index;
};
UIMenuDynamicListItem offsetX = new UIMenuDynamicListItem("Offset X", "Change the X offset of the menu", exampleMenu.Offset.X.ToString("F3"), async (sender, direction) =>
{
var offset = exampleMenu.Offset.X;
if (direction == ChangeDirection.Left)
offset--;
else
offset++;
sender.Parent.SetMenuOffset(new PointF(offset, exampleMenu.Offset.Y));
exampleMenu.SetMenuOffset(new PointF(offset, exampleMenu.Offset.Y));
return exampleMenu.Offset.X.ToString("F3");
});
UIMenuDynamicListItem offsetY = new UIMenuDynamicListItem("Offset Y", "Change the Y offset of the menu", exampleMenu.Offset.Y.ToString("F3"), async (sender, direction) =>
{
var offset = exampleMenu.Offset.Y;
if (direction == ChangeDirection.Left)
offset--;
else
offset++;
sender.Parent.SetMenuOffset(new PointF(exampleMenu.Offset.X, offset));
exampleMenu.SetMenuOffset(new PointF(exampleMenu.Offset.X, offset));
return exampleMenu.Offset.Y.ToString("F3");
});
offsetMenu.AddItem(align);
offsetMenu.AddItem(offsetX);
offsetMenu.AddItem(offsetY);
offsetItem.Activated += (sender, args) =>
{
sender.SwitchTo(offsetMenu, inheritOldMenuParams: true);
};
#endregion
#endregion
#region Menu Events
// here you can handle all the events for the mainMenu and its submenus or items themselves.. there's not a real order and if you want you can place these events
// right under the place where their menus/items were declared, i place them here for a creation order.
// ====================================================================
// =--------------------------- [Items] ------------------------------=
// ====================================================================
slider.OnSliderChanged += (item, index) =>
{
Screen.ShowSubtitle($"Slider changed => {index}");
};
progress.OnProgressChanged += (item, index) =>
{
Screen.ShowSubtitle($"Progress changed => {index}");
};
// ====================================================================
// =--------------------------- [Panels] -----------------------------=
// ====================================================================
// THERE ARE NOW EVENT FOR PANELS.. WHEN YOU CHANGE WHAT IS CHANGABLE THE PANEL ITSELF WILL DO WHATEVER YOU TELL HIM TO DO
ColorPanel.OnColorPanelChange += (item, panel, index) =>
{
Notifications.ShowNotification($"ColorPanel index => {index}");
};
ColorPanelCustom.OnColorPanelChange += (item, panel, index) =>
{
Notifications.ShowNotification($"ColorPanel index => {index}");
};
PercentagePanel.OnPercentagePanelChange += (item, panel, index) =>
{
Screen.ShowSubtitle("Percentage = " + index + "...");
};
GridPanel.OnGridPanelChange += (item, panel, value) =>
{
Screen.ShowSubtitle("GridPosition = " + value + "...");
};
HorizontalGridPanel.OnGridPanelChange += (item, panel, value) =>
{
Screen.ShowSubtitle("HorizontalGridPosition = " + value + "...");
};
// ====================================================================
// =---------------------- [Heritage SubMenu] ------------------------=
// ====================================================================
int MomIndex = 0;
int DadIndex = 0;
windowSubmenu.OnListChange += async (_sender, _listItem, _newIndex) =>
{
if (_listItem == mom)
{
MomIndex = _newIndex;
heritageWindow.Index(MomIndex, DadIndex);
}
else if (_listItem == dad)
{
DadIndex = _newIndex;
heritageWindow.Index(MomIndex, DadIndex);
}
// This way the heritage window changes only if you change a list item!
};
windowSubmenu.OnSliderChange += (sender, item, value) =>
{
statsWindow.DetailStats[0].Percentage = 100 - value;
statsWindow.DetailStats[0].HudColor = SColor.HUD_Pink;
statsWindow.DetailStats[1].Percentage = value;
statsWindow.DetailStats[1].HudColor = SColor.HUD_Freemode;
statsWindow.UpdateStatsToWheel();
statsWindow.UpdateLabels("Parents resemblance", "Dad: " + value + "%", "Mom: " + (100 - value) + "%");
};
// ====================================================================
// =--------------------- [Scaleforms SubMenu] -----------------------=
// ====================================================================
scaleformMenu.OnItemSelect += async (sender, item, index) =>
{
if (item == showSimplePopup)
{
ScaleformUI.Main.Warning.ShowWarning("This is the title", "This is the subtitle", "This is the prompt.. you have 6 seconds left", "This is the error message, ScaleformUI Ver. 3.0");
await Delay(1000);
for (int i = 5; i > -1; i--)
{
ScaleformUI.Main.Warning.UpdateWarning("This is the title", "This is the subtitle", $"This is the prompt.. you have {i} seconds left", "This is the error message, ScaleformUI Ver. 3.0");
await Delay(1000);
}
ScaleformUI.Main.Warning.Dispose();
}
else if (item == showPopupButtons)
{
List<InstructionalButton> buttons = new List<InstructionalButton>()
{
new InstructionalButton(Control.FrontendDown, "Accept only with Keyboard", PadCheck.Keyboard),
new InstructionalButton(Control.FrontendY, "Cancel only with GamePad", PadCheck.Controller),
new InstructionalButton(Control.FrontendX, Control.Detonate, "This will change button if you're using gamepad or keyboard"),
new InstructionalButton(new List<Control> { Control.MoveUpOnly, Control.MoveLeftOnly , Control.MoveDownOnly , Control.MoveRightOnly }, "Woow multiple buttons at once??"),
new InstructionalButton(InputGroup.INPUTGROUP_LOOK, "InputGroup example")
};
ScaleformUI.Main.Warning.ShowWarningWithButtons("This is the title", "This is the subtitle", "This is the prompt, press any button", buttons, "This is the error message, ScaleformUI Ver. 3.0");
ScaleformUI.Main.Warning.OnButtonPressed += (button) =>
{
Debug.WriteLine($"You pressed a Button => {button.Text}");
};
}
else if (item == customInstr2)
{
if (ScaleformUI.Main.InstructionalButtons.ControlButtons.Count >= 6) return;
ScaleformUI.Main.InstructionalButtons.AddInstructionalButton(new InstructionalButton((Control)new Random().Next(0, 250), "I'm a new button look at me!"));
}
else if (item == bigMessage)
{
ScaleformUI.Main.BigMessageInstance.ShowSimpleShard("TITLE", "SUBTITLE");
}
else if (item == midMessage)
{
ScaleformUI.Main.MedMessageInstance.ShowColoredShard("TITLE", "SUBTITLE", HudColor.HUD_COLOUR_FREEMODE);
}
};
customInstr.OnListSelected += (item, index) =>
{
if (ScaleformUI.Main.InstructionalButtons.IsSaving) return;
ScaleformUI.Main.InstructionalButtons.AddSavingText((LoadingSpinnerType)(index + 1), "I'm a saving text", 3000);
};
// ====================================================================
// =------------------- [Notifications SubMenu] ----------------------=
// ====================================================================
ScaleformUI.ScaleformUINotification notification = null;
notificationsMenu.OnListChange += (_menu, _item, _index) =>
{
if (_item == noti1)
{
if (notification != null)
notification.Hide();
if (_index == (colors.Count - 1))
notification = Notifications.ShowNotification("This is a simple notification without color and look how long it is wooow!", true, true);
else
{
switch (_index)
{
case 0:
notification = Notifications.ShowNotification("This is a simple colored notification and look how long it is wooow!", NotificationColor.Gold, true, true);
break;
case 1:
notification = Notifications.ShowNotification("This is a simple colored notification and look how long it is wooow!", NotificationColor.Red, true, true);
break;
case 2:
notification = Notifications.ShowNotification("This is a simple colored notification and look how long it is wooow!", NotificationColor.Rose, true, true);
break;
case 3:
notification = Notifications.ShowNotification("This is a simple colored notification and look how long it is wooow!", NotificationColor.GreenLight, true, true);
break;
case 4:
notification = Notifications.ShowNotification("This is a simple colored notification and look how long it is wooow!", NotificationColor.GreenDark, true, true);
break;
case 5:
notification = Notifications.ShowNotification("This is a simple colored notification and look how long it is wooow!", NotificationColor.Cyan, true, true);
break;
case 6:
notification = Notifications.ShowNotification("This is a simple colored notification and look how long it is wooow!", NotificationColor.Purple, true, true);
break;
case 7:
notification = Notifications.ShowNotification("This is a simple colored notification and look how long it is wooow!", NotificationColor.Yellow, true, true);
break;
case 8:
notification = Notifications.ShowNotification("This is a simple colored notification and look how long it is wooow!", NotificationColor.Blue, true, true);
break;
}
}
}
else if (_item == noti2)
{
string selectedChar = NotificationChar.Abigail;
#region SwitchStatement
switch (_item.Items[_index])
{
case "Abigail":
selectedChar = NotificationChar.Abigail;
break;
case "Amanda":
selectedChar = NotificationChar.Amanda;
break;
case "Ammunation":
selectedChar = NotificationChar.Ammunation;
break;
case "Andreas":
selectedChar = NotificationChar.Andreas;
break;
case "Antonia":
selectedChar = NotificationChar.Antonia;
break;
case "Ashley":
selectedChar = NotificationChar.Ashley;
break;
case "BankOfLiberty":
selectedChar = NotificationChar.BankOfLiberty;
break;
case "BankFleeca":
selectedChar = NotificationChar.BankFleeca;
break;
case "BankMaze":
selectedChar = NotificationChar.BankMaze;
break;
case "Barry":
selectedChar = NotificationChar.Barry;
break;
case "Beverly":
selectedChar = NotificationChar.Beverly;
break;
case "BikeSite":
selectedChar = NotificationChar.BikeSite;
break;
case "BlankEntry":
selectedChar = NotificationChar.BlankEntry;
break;
case "Blimp":
selectedChar = NotificationChar.Blimp;
break;
case "Blocked":
selectedChar = NotificationChar.Blocked;
break;
case "BoatSite":
selectedChar = NotificationChar.BoatSite;
break;
case "BrokenDownGirl":
selectedChar = NotificationChar.BrokenDownGirl;
break;
case "BugStars":
selectedChar = NotificationChar.BugStars;
break;
case "Call911":
selectedChar = NotificationChar.Call911;
break;
case "LegendaryMotorsport":
selectedChar = NotificationChar.LegendaryMotorsport;
break;
case "SSASuperAutos":
selectedChar = NotificationChar.SSASuperAutos;
break;
case "Castro":
selectedChar = NotificationChar.Castro;
break;
case "ChatCall":
selectedChar = NotificationChar.ChatCall;
break;
case "Chef":
selectedChar = NotificationChar.Chef;
break;
case "Cheng":
selectedChar = NotificationChar.Cheng;
break;
case "ChengSenior":
selectedChar = NotificationChar.ChengSenior;
break;
case "Chop":
selectedChar = NotificationChar.Chop;
break;
case "Cris":
selectedChar = NotificationChar.Cris;
break;
case "Dave":
selectedChar = NotificationChar.Dave;
break;
case "Default":
selectedChar = NotificationChar.Default;
break;
case "Denise":
selectedChar = NotificationChar.Denise;
break;
case "DetonateBomb":
selectedChar = NotificationChar.DetonateBomb;
break;
case "DetonatePhone":
selectedChar = NotificationChar.DetonatePhone;
break;
case "Devin":
selectedChar = NotificationChar.Devin;
break;
case "SubMarine":
selectedChar = NotificationChar.SubMarine;
break;
case "Dom":
selectedChar = NotificationChar.Dom;
break;
case "DomesticGirl":
selectedChar = NotificationChar.DomesticGirl;
break;
case "Dreyfuss":
selectedChar = NotificationChar.Dreyfuss;
break;
case "DrFriedlander":
selectedChar = NotificationChar.DrFriedlander;
break;
case "Epsilon":
selectedChar = NotificationChar.Epsilon;
break;
case "EstateAgent":
selectedChar = NotificationChar.EstateAgent;
break;
case "Facebook":
selectedChar = NotificationChar.Facebook;
break;
case "FilmNoire":
selectedChar = NotificationChar.FilmNoire;
break;
case "Floyd":
selectedChar = NotificationChar.Floyd;
break;
case "Franklin":
selectedChar = NotificationChar.Franklin;
break;
case "FranklinTrevor":
selectedChar = NotificationChar.FranklinTrevor;
break;
case "GayMilitary":
selectedChar = NotificationChar.GayMilitary;
break;
case "Hao":
selectedChar = NotificationChar.Hao;
break;
case "HitcherGirl":
selectedChar = NotificationChar.HitcherGirl;
break;
case "Hunter":
selectedChar = NotificationChar.Hunter;
break;
case "Jimmy":
selectedChar = NotificationChar.Jimmy;
break;
case "JimmyBoston":
selectedChar = NotificationChar.JimmyBoston;
break;
case "Joe":
selectedChar = NotificationChar.Joe;
break;
case "Josef":
selectedChar = NotificationChar.Josef;
break;
case "Josh":
selectedChar = NotificationChar.Josh;
break;
case "LamarDog":
selectedChar = NotificationChar.LamarDog;
break;
case "Lester":
selectedChar = NotificationChar.Lester;
break;
case "Skull":
selectedChar = NotificationChar.Skull;
break;
case "LesterFranklin":
selectedChar = NotificationChar.LesterFranklin;
break;
case "LesterMichael":
selectedChar = NotificationChar.LesterMichael;
break;
case "LifeInvader":
selectedChar = NotificationChar.LifeInvader;
break;
case "LsCustoms":
selectedChar = NotificationChar.LsCustoms;
break;
case "LSTI":
selectedChar = NotificationChar.LSTI;
break;
case "Manuel":
selectedChar = NotificationChar.Manuel;
break;
case "Marnie":
selectedChar = NotificationChar.Marnie;
break;
case "Martin":
selectedChar = NotificationChar.Martin;
break;
case "MaryAnn":
selectedChar = NotificationChar.MaryAnn;
break;
case "Maude":
selectedChar = NotificationChar.Maude;
break;
case "Mechanic":
selectedChar = NotificationChar.Mechanic;
break;
case "Michael":
selectedChar = NotificationChar.Michael;
break;
case "MichaelFranklin":
selectedChar = NotificationChar.MichaelFranklin;
break;
case "MichaelTrevor":
selectedChar = NotificationChar.MichaelTrevor;
break;
case "WarStock":
selectedChar = NotificationChar.WarStock;
break;
case "Minotaur":
selectedChar = NotificationChar.Minotaur;
break;
case "Molly":
selectedChar = NotificationChar.Molly;
break;
case "MorsMutual":
selectedChar = NotificationChar.MorsMutual;
break;
case "ArmyContact":
selectedChar = NotificationChar.ArmyContact;
break;
case "Brucie":
selectedChar = NotificationChar.Brucie;
break;
case "FibContact":
selectedChar = NotificationChar.FibContact;
break;
case "RockStarLogo":
selectedChar = NotificationChar.RockStarLogo;
break;
case "Gerald":
selectedChar = NotificationChar.Gerald;
break;
case "Julio":
selectedChar = NotificationChar.Julio;
break;
case "MechanicChinese":
selectedChar = NotificationChar.MechanicChinese;
break;
case "MerryWeather":
selectedChar = NotificationChar.MerryWeather;
break;
case "Unicorn":
selectedChar = NotificationChar.Unicorn;
break;
case "Mom":
selectedChar = NotificationChar.Mom;
break;
case "MrsThornhill":
selectedChar = NotificationChar.MrsThornhill;
break;
case "PatriciaTrevor":
selectedChar = NotificationChar.PatriciaTrevor;
break;
case "PegasusDelivery":
selectedChar = NotificationChar.PegasusDelivery;
break;
case "ElitasTravel":
selectedChar = NotificationChar.ElitasTravel;
break;
case "Sasquatch":
selectedChar = NotificationChar.Sasquatch;
break;
case "Simeon":
selectedChar = NotificationChar.Simeon;
break;
case "SocialClub":
selectedChar = NotificationChar.SocialClub;
break;
case "Solomon":
selectedChar = NotificationChar.Solomon;
break;
case "Taxi":
selectedChar = NotificationChar.Taxi;
break;
case "Trevor":
selectedChar = NotificationChar.Trevor;
break;
case "YouTube":
selectedChar = NotificationChar.YouTube;
break;
case "Wade":
selectedChar = NotificationChar.Wade;
break;
}
#endregion
if (notification != null) notification.Hide();
notification = Notifications.ShowAdvancedNotification("This is the title!!", "This is the subtitle!", "This is the main text!!", selectedChar, selectedChar, HudColor.NONE, SColor.AliceBlue, true, NotificationType.Default, true, true);
}
};
notificationsMenu.OnItemSelect += async (_menu, _item, _index) =>
{
API.AddTextEntry("FMMC_KEY_TIP8", "Insert text (Max 10 chars):");
string text = await Game.GetUserInput("", 10); // i set max 50 chars here as example but it can be way more!
if (_item == noti3)
{
Notifications.ShowHelpNotification(text, 5000);
}
else if (_item == noti4)
{
_text = text;
_timer = Game.GameTime + 1;
Tick += FloatingHelpTimer;
}
else if (_item == noti5)
{
await Notifications.ShowStatNotification(75, 50, text, true, true);
}
else if (_item == noti6)
{
await Notifications.ShowVSNotification(12, HudColor.HUD_COLOUR_BLUE, Game.PlayerPed, 3, HudColor.HUD_COLOUR_RED);
// you must specify 1 or 2 peds for this.. in this case i use the player ped twice for the sake of the example.
}
else if (_item == noti7)
{
_text = text;
_timer = Game.GameTime + 1;