/
CDChatWindowChat.uc
865 lines (734 loc) · 23.7 KB
/
CDChatWindowChat.uc
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
/*
* --------------------------
* | CDChatWindowChat.uc
* --------------------------
* This file is part of ChatDiamond for UT99.
*
* ChatDiamond is free software: you can redistribute and/or modify
* it under the terms of the Open Unreal Mod License version 1.1.
*
* ChatDiamond is distributed in the hope and belief that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the Open Unreal Mod License
* along with ChatDiamond. If not, see
* <https://beyondunrealwiki.github.io/pages/openunrealmodlicense.html>.
*
* Timeline:
* Before November, 2022: ProAsm and No0ne developed UTChat
* (https://ut99.org/viewtopic.php?f=7&t=14356)
* November, 2022: Transitioning from UTChat to ChatDiamond
* (https://ut99.org/viewtopic.php?f=7&t=14356&start=30#p139510)
* December, 2022: Native experiments
* April, 2023: Native - scripting hybrid progress
*/
//==============================================================================
// CDChatWindowChat
//
//- Here we can keep the record of just the Human (and or bot) sent messages
//==============================================================================
class CDChatWindowChat extends UWindowPageWindow config (ChatDiamond);
// About the naming, Kernel is defined
// "the central or most important part of something."
#exec AUDIO IMPORT FILE="Sounds\telegram.wav" NAME=MessageKernel GROUP="Sound"
var() config string IgnorableStrings[40];
var() config bool bIgnoreMessageFilter;
var config bool bUserWantsMessageSound;
var UMenuLabelControl lblHeading;
var CDUTChatTextTextureAnimEmoteArea TheTextArea;
var UWindowEditControl EditMesg;
var UWindowSmallButton ButSend;
var UWindowSmallButton ButSave;
var UWindowSmallButton ButtonPlaySpectate;
var UWindowSmallButton ButtonDisconnectAndQuit;
var CDModMenuWindowFrame FrameWindow;
var GameReplicationInfo CDGRI;
var PlayerReplicationInfo LocalPRI;
var bool bIsWindowChatFunctional;
var CDUTConsole ChatDiamondConsole;
var CDChatWindowEmojis EmoWindowPage;
// Server being visited
struct VisitingServerInformation
{
var string CDServerName;
// Dragon's barbed alogrithm, in uscript, for identification
var string CDMD5Hash;
};
var VisitingServerInformation VSRP;// Visiting Server Relevant Platter
var string TemporaryServerHash;
var string TemporaryServerName;
var config string Chat[200];
var CDDiscordActor CDDA;
var color GrnColor, SilColor, YelColor, TxtColor;
var int iTick;
//---------------------------- Options ---------------------------------
var int ChatNum;
var bool bAdmin, bChat;
var string OldHelpKey;
var float PrevWinWidth, PrevWinHeight;
function Created ()
{
Super.Created();
CDGRI = Root.GetPlayerOwner().GameReplicationInfo;
LocalPRI = Root.GetPlayerOwner().PlayerReplicationInfo;
CDDA = Root.GetPlayerOwner().Spawn(class'CDDiscordActor', Root.GetPlayerOwner());
VSRP.CDServerName = GenerateServerName();
VSRP.CDMD5Hash = class'CDHash'.static.MD5(VSRP.CDServerName);
lblHeading = UMenuLabelControl(CreateControl(Class'UMenuLabelControl', 0, 0, 200, 16));
lblHeading.Font = F_Bold;
lblHeading.SetText(" Date Message ");
lblHeading.Align = TA_Left;
lblHeading.SetTextColor(GrnColor);
TheTextArea = CDUTChatTextTextureAnimEmoteArea(CreateControl(Class'CDUTChatTextTextureAnimEmoteArea', 1, 16, 385, 212));
TheTextArea.AbsoluteFont = Font(DynamicLoadObject("UWindowFonts.TahomaB12", class'Font'));
TheTextArea.bAutoScrollbar = False;
TheTextArea.SetTextColor(SilColor);
TheTextArea.Clear();
TheTextArea.bChat = True;
TheTextArea.bVariableRowHeight = True;
TheTextArea.bScrollOnResize = True;
TheTextArea.CDChatWindow = self;
ButSave = UWindowSmallButton(CreateControl(class'UWindowSmallButton', 4, 230, 50, 25));
ButSave.SetText("Save");
ButSave.DownSound = sound'UnrealShare.FSHLITE2';
ButSend = UWindowSmallButton(CreateControl(class'UWindowSmallButton', 278, 230, 50, 25));
ButSend.SetText("Send");
ButSend.DownSound = sound'UnrealShare.FSHLITE2';
ButtonDisconnectAndQuit = UWindowSmallButton(CreateControl(class'UWindowSmallButton', 333, 230, 50, 25));
ButtonDisconnectAndQuit.SetText("RAGE");//("Goodbye!");
ButtonDisconnectAndQuit.DownSound = sound'UnrealShare.FSHLITE2';
ButtonPlaySpectate = UWindowSmallButton(CreateControl(class'UWindowSmallButton', 4, 255, 380, 25));
if(GetPlayerOwner().GetDefaultURL("OverrideClass") == "Botpack.CHSpectator")
{
ButtonPlaySpectate.SetText("Play");
}
else
{
ButtonPlaySpectate.SetText("Spectate");
}
ButtonPlaySpectate.DownSound = sound'UnrealShare.FSHLITE2';
// must go here to get 1st focus
EditMesg = UWindowEditControl(CreateControl(Class'UWindowEditControl', 56, 230, 217, 16));
EditMesg.EditBoxWidth = 217;
EditMesg.SetNumericOnly(False);
EditMesg.SetFont(0);
EditMesg.SetHistory(True);
EditMesg.SetValue("");
EditMesg.Align = TA_Left;
SetAcceptsFocus();
iTick = 50; // LoadMessages();
PrevWinWidth = WinWidth;
PrevWinHeight = WinHeight;
}
function LoadMessages(optional string sMesg, optional bool bTalkMessage)
{
local string sTemp;
local int i;
if (sMesg != "")
{
TheTextArea.AddText(sMesg);
CDDA.CacheChatLine(sMesg);
ButSave.bDisabled = false;
if(bTalkMessage && bUserWantsMessageSound)
{
Root.GetPlayerOwner().ClientPlaySound(sound'MessageKernel');
}
}
else
{
TheTextArea.Clear();
for (i = FrameWindow.LastHistoricMessagesNumber; i > 0; i--)
{
sTemp = CDDA.GetLineFromCacheBottom(i);
if (i > 0 && sTemp == "")
{
break;
}
TheTextArea.AddText(sTemp);
}
}
}
function PadVerticallyWithHorizontal(optional int VerticalPaddingAmount)
{
local int Counter, MaximumPadCount;
if(VerticalPaddingAmount > 0)
{
MaximumPadCount = VerticalPaddingAmount;
}
else
{
MaximumPadCount = 4;
}
for(Counter = 0; Counter < MaximumPadCount; Counter++)
{
TheTextArea.AddText("");
}
}
/*******************************************************************************
* Routine to generate message string and display the same
* Please note: The message from spectators are of type `Event` and not
* distinguishable from messages different from Say or TeamSay
*
* TODO:
* 1. Server Information
* 2. Tab for history. Public chat should be cleaned everytime game is loaded. Force clean?
* 3. Contextual deletion of History?
* 4. Filter default messages (for instance I have got the flag! or custom cmds)
* 5. Face loading (done)
* 6. Player Join/Leave notififcation with time stamp
*
* @PARAM PRI The PlayerReplicationInfo of involved individual
* Behavior differs (as far as I understand)
* 1. Multiplay: PRI is that of client
* 2. Single Player: PRI can be of Human or bot
* @PARAM Message The actual message of type `Say` or `TeamSay` etc
* may contain sender's name in multiplay games
* @PARAM MessageType The type of message like so
* Say, TeamSay, and Event (should be enough here)
*
*******************************************************************************
*/
function InterpretAndDisplayTextClientSide(PlayerReplicationInfo PRI, coerce string Message, name MessageType)
{
local string SkinName, FaceName, DisplayableSpectatorMessage, SenderString;
local Pawn LP;
local PlayerReplicationInfo SpectatorLPRI, SomeDifferentPRI;
if(Message == "" || (bIgnoreMessageFilter && IsMessageIgnorable(Message)))
{
return;
}
if(MessageType == 'Say' || MessageType == 'TeamSay')
{
if(PRI != none)
{
LP = Pawn(PRI.Owner);
LP.GetMultiSkin(LP, SkinName, FaceName);
}
else
{
FaceName = "";
SkinName = "";
}
if(FaceName == "")
{
FaceName = "Dummy";
}
if(SkinName == "")
{
SkinName = "Dummy";
}
CDDA.ResetJsonContainer();
CDDA.AddJsonKeyValue("FaceName", FaceName);
CDDA.AddJsonKeyValue("SkinName", SkinName);
CDDA.AddJsonKeyValue("LocalTime", LocalTimeAndMPOVMarker());
CDDA.AddJsonKeyValue("PlayerName", PRI.PlayerName);
CDDA.AddJsonKeyValue("ChatMessage", Message);
if(PRI.bAdmin)
{
CDDA.AddJsonKeyValue("Team", "Admin");
}
else if(PRI.Team == 0)
{
CDDA.AddJsonKeyValue("Team", "Red");
}
else if(PRI.Team == 1)
{
CDDA.AddJsonKeyValue("Team", "Blue");
}
else // for 4-way I need to think
{
CDDA.AddJsonKeyValue("Team", "Unknowm");
}
LoadMessages(CDDA.SerializeJson(), true);
CDDA.ResetJsonContainer();
}
else
{
}
if(PRI != none)
{
// Maybe exhaustive.
// Well, player join leave and server adds and whatnot. So we shall use
// our filter. Spectators' message is of the form
// Message = The_Cowboy:Howdy!
if(FilterSenderName(Message) == PRI.PlayerName)
{
DisplayableSpectatorMessage = PrepareSpectatorMessageForDisplay(Message, SpectatorLPRI);
LP = Pawn(SpectatorLPRI.Owner);
LP.GetMultiSkin(LP, SkinName, FaceName);
if(FaceName == "")
{
FaceName = "Dummy";
}
if(SkinName == "")
{
SkinName = "Dummy";
}
CDDA.ResetJsonContainer();
CDDA.AddJsonKeyValue("FaceName", FaceName);
CDDA.AddJsonKeyValue("SkinName", SkinName);
CDDA.AddJsonKeyValue("LocalTime", LocalTimeAndMPOVMarker());
CDDA.AddJsonKeyValue("PlayerName", PRI.PlayerName);
CDDA.AddJsonKeyValue("ChatMessage", DisplayableSpectatorMessage);
CDDA.AddJsonKeyValue("Team", "Spectator");
LoadMessages(CDDA.SerializeJson(), true);
CDDA.ResetJsonContainer();
}
else
{
SenderString = FilterSenderName(Message);
foreach Root.GetPlayerOwner().AllActors(class'PlayerReplicationInfo', SomeDifferentPRI)
{
if(SomeDifferentPRI.PlayerName == SenderString)
{
break;
}
return;
}
// Ok the message may be of the case
// (somespectator name):hola
// SomeDifferentPRI seems like spectator pri
if(SomeDifferentPRI != none)
{
DisplayableSpectatorMessage = PrepareSpectatorMessageForDisplay(Message, SpectatorLPRI);
LP = Pawn(SpectatorLPRI.Owner);
LP.GetMultiSkin(LP, SkinName, FaceName);
if(FaceName == "")
{
FaceName = "Dummy";
}
if(SkinName == "")
{
SkinName = "Dummy";
}
CDDA.ResetJsonContainer();
CDDA.AddJsonKeyValue("FaceName", FaceName);
CDDA.AddJsonKeyValue("SkinName", SkinName);
CDDA.AddJsonKeyValue("LocalTime", LocalTimeAndMPOVMarker());
CDDA.AddJsonKeyValue("PlayerName", PRI.PlayerName);
CDDA.AddJsonKeyValue("ChatMessage", DisplayableSpectatorMessage);
CDDA.AddJsonKeyValue("Team", "Spectator");
LoadMessages(CDDA.SerializeJson(), true);
CDDA.ResetJsonContainer();
}
}
}
else
{
Log("PRI is none, message is: " @ Message @ " isspectator: " @ PRI.bIsSpectator @ MessageType @ PRI.PlayerName);
}
}
function string PrepareSpectatorMessageForDisplay(string SpectatorMessage, optional out PlayerReplicationInfo RelevantPRI)
{
local string TempoString, SpectatorName;
local int NameEndPosition;
// Assuming name has no funny character, i.e delimiter itself
NameEndPosition = Instr(SpectatorMessage, ":");
if(NameEndPosition != -1)
{
SpectatorName = Left(SpectatorMessage, NameEndPosition);
}
TempoString = Mid(SpectatorMessage, NameEndPosition + 1);
foreach Root.GetPlayerOwner().AllActors(class'PlayerReplicationInfo', RelevantPRI)
{
if(RelevantPRI.PlayerName == SpectatorName)
{
break;
}
}
return TempoString;
}
function string FilterSenderName(coerce string Message)
{
local int NameEndPosition;
local string SenderName;
// Assuming name has no funny character, i.e delimiter itself
NameEndPosition = Instr(Message, ":");
if(NameEndPosition != -1)
{
SenderName = Left(Message, NameEndPosition);
}
else
{
SenderName = "";
}
return SenderName;
}
/*******************************************************************************
* A routine to gauge what to ignore and what not!
*
* @PARAM Message The message to be gauged
* @return True if the message is to be ignored
* False if the message is not to be ignored
*
*******************************************************************************
*/
function bool IsMessageIgnorable(coerce string Message)
{
local int IgnorableMessageCounter;
// Lot of string comparison
for(IgnorableMessageCounter = 0; IgnorableMessageCounter < 40; IgnorableMessageCounter++)
{
// Remember the continuation concept
if(IgnorableStrings[IgnorableMessagecounter] == "")
{
return false;
}
if(instr(Message, IgnorableStrings[IgnorableMessageCounter]) != -1)
{
return true;
}
}
return false;
}
function string GenerateServerName()
{
local string GeneratedServerName;
if(CDGRI != none)
{
GeneratedServerName = CDGRI.ServerName;
}
else
{
GeneratedServerName = "";
}
return GeneratedServerName;
}
/*******************************************************************************
* Routine for modifying the console message as per our interpretation
* and encode the deliminators accordingly
*******************************************************************************
*/
function string LocalTimeAndMPOVMarker()
{
local string Mon, Day, Min, Hour;
local PlayerPawn PlayerOwner;
PlayerOwner = Root.GetPlayerOwner();
Min = string(PlayerOwner.Level.Minute);
if(int(Min) < 10) Min = "0" $ Min;
switch(PlayerOwner.Level.month)
{
case 1: Mon = "Jan"; break;
case 2: Mon = "Feb"; break;
case 3: Mon = "Mar"; break;
case 4: Mon = "Apr"; break;
case 5: Mon = "May"; break;
case 6: Mon = "Jun"; break;
case 7: Mon = "Jul"; break;
case 8: Mon = "Aug"; break;
case 9: Mon = "Sep"; break;
case 10: Mon = "Oct"; break;
case 11: Mon = "Nov"; break;
case 12: Mon = "Dec"; break;
}
switch(PlayerOwner.Level.dayOfWeek)
{
case 0: Day = "Sunday"; break;
case 1: Day = "Monday"; break;
case 2: Day = "Tuesday"; break;
case 3: Day = "Wednesday"; break;
case 4: Day = "Thursday"; break;
case 5: Day = "Friday"; break;
case 6: Day = "Saturday"; break;
}
if(PlayerOwner.Level.Hour < 10)
{
Hour = 0 $ string(PlayerOwner.Level.Hour);
}
else
{
Hour = string(PlayerOwner.Level.Hour);
}
return Day @ PlayerOwner.Level.Day @ Mon @ PlayerOwner.Level.Year @ Hour $ ":" $ Min;
}
function SetChatTextStatus(string Text)
{
FrameWindow.StatusBarText = Text;
TheTextArea.bIsStatusSetByChatMessage = true;
}
function Notify (UWindowDialogControl C, byte E)
{
Super.Notify(C,E);
if(E == DE_MouseMove)
{
if(C == ButSend)
{
FrameWindow.StatusBarText = "Send the message!";
TheTextArea.bIsStatusSetByChatMessage = false;
}
if(C == ButSave)
{
FrameWindow.StatusBarText = "Save the messages in ChatDiamond.ini!";
TheTextArea.bIsStatusSetByChatMessage = false;
}
if(C == ButtonPlaySpectate)
{
FrameWindow.StatusBarText = "Based on the context, play or spectate!";
TheTextArea.bIsStatusSetByChatMessage = false;
}
if(C == ButtonDisconnectAndQuit)
{
FrameWindow.StatusBarText = "Shut down the game and do `better` things!";
TheTextArea.bIsStatusSetByChatMessage = false;
}
if(C == EditMesg)
{
FrameWindow.StatusBarText = "Type a message for everyone!";
TheTextArea.bIsStatusSetByChatMessage = false;
}
}
if(E == DE_MouseLeave)
{
if(C == EditMesg)
{
FrameWindow.StatusBarText = "";
}
if(C == ButSend)
{
FrameWindow.StatusBarText = "";
}
if(C == ButSave)
{
FrameWindow.StatusBarText = "";
}
if(C == ButtonPlaySpectate)
{
FrameWindow.StatusBarText = "";
}
if(C == ButtonDisconnectAndQuit)
{
FrameWindow.StatusBarText = "";
}
}
Switch(E)
{
case DE_Change:
switch(C)
{
case EditMesg:
if(EmoWindowPage != None && EditMesg.GetValue() != "" && EmoWindowPage.EditMesg.GetValue() != EditMesg.GetValue())
{
EmoWindowPage.EditMesg.SetValue(EditMesg.GetValue());
}
break;
}
break;
case DE_Click:
switch(C)
{
case ButSave:
SaveConfig();
ButSave.bDisabled = True;
GetPlayerOwner().ClientMessage("All Messages have been saved to ChatDiamond.ini");
break;
case ButSend:
//class'CDDiscordActor'.static.CacheListOfFiles(EditMesg.GetValue(), class'CDDiscordActor'.static.GetGameSystemPath());
SendMessage();
//class'CDDiscordActor'.static.OpenNativeTestWindow(true, FrameWindow);
break;
case ButtonDisconnectAndQuit:
Root.QuitGame();
break;
// Courtsey ProAsm's UTCmds8
case ButtonPlaySpectate:
if(GetPlayerOwner().PlayerReplicationInfo.bIsSpectator)
{
GetPlayerOwner().PreClientTravel();
GetPlayerOwner().ClientTravel("?OverrideClass=", TRAVEL_Relative, False);
ButtonPlaySpectate.SetText("Spectate");
}
else
{
GetPlayerOwner().PreClientTravel();
GetPlayerOwner().ClientTravel("?OverrideClass=Botpack.CHSpectator", TRAVEL_Relative, False);
ButtonPlaySpectate.SetText("Play");
}
break;
}
break;
case 7:
SendMessage();
break;
default:
break;
}
}
function SendMessage(optional UWindowEditControl EditMessage)
{
if(EditMessage != none && EditMessage.GetValue() != "")
{
GetPlayerOwner().ConsoleCommand("SAY " $ EditMessage.GetValue());
EditMessage.SetValue("");
EditMesg.SetValue("");
}
else// this class operation
{
if (EditMesg.GetValue() != "")
{
GetPlayerOwner().ConsoleCommand("SAY " $ EditMesg.GetValue());
EditMesg.SetValue("");
EmoWindowPage.EditMesg.SetValue("");
}
}
}
function Tick(float delta)
{
if(Root.GetPlayerOwner().GameReplicationInfo != CDGRI)
{
CDGRI = Root.GetPlayerOwner().GameReplicationInfo;
TemporaryServerName = GenerateServerName();
if(TemporaryServerName != "" && TemporaryServerName != "Another UT Server")// ye I don't know what you are doing playing on such server anyways
{
TemporaryServerHash = class'CDHash'.static.MD5(TemporaryServerName);
if(VSRP.CDMD5Hash != TemporaryServerHash)
{
VSRP.CDServerName = TemporaryServerName;
VSRP.CDMD5Hash = TemporaryServerHash;
class'CDDiscordActor'.static.ResetJsonContainer();
class'CDDiscordActor'.static.AddJsonKeyValue("ServerName", VSRP.CDServerName);
class'CDDiscordActor'.static.AddJsonKeyValue("LocalTime", LocalTimeAndMPOVMarker());
class'CDDiscordActor'.static.AddJsonKeyValue("ServerAddress", Root.GetPlayerOwner().Level.GetAddressURL());
LoadMessages(class'CDDiscordActor'.static.SerializeJson());
class'CDDiscordActor'.static.ResetJsonContainer();
}
}
}
if (iTick > 0)
{
iTick--;
if (iTick == 0)
{
LoadMessages();
}
}
Super.Tick(delta);
}
function Resized()
{
Super.Resized();
Resize();
TheTextArea.EmoSizeMultiplier = FrameWindow.EmoSize;
TheTextArea.TickCounterWarpNumber = (int(FrameWindow.EmoteAnimSpeed) / 24);
TheTextArea.AnimShockEmote.TexChatSizeFraction = 0.08 * FrameWindow.EmoSize;
TheTextArea.AnimTrashTalkEmote.TexChatSizeFraction = 0.08 * FrameWindow.EmoSize;
}
function ChatConfigurationUpdated()
{
TheTextArea.EmoSizeMultiplier = FrameWindow.EmoSize;
TheTextArea.TickCounterWarpNumber = (int(FrameWindow.EmoteAnimSpeed) / 24);
TheTextArea.AnimShockEmote.TexChatSizeFraction = 0.08 * FrameWindow.EmoSize;
TheTextArea.AnimTrashTalkEmote.TexChatSizeFraction = 0.08 * FrameWindow.EmoSize;
LoadMessages();
}
function Resize()
{
local float DiffX, DiffY;
DiffX = WinWidth - PrevWinWidth;
DiffY = WinHeight - PrevWinHeight;
if (DiffX != 0 || DiffY != 0)
{
TheTextArea.SetSize(TheTextArea.WinWidth + DiffX, TheTextArea.WinHeight + DiffY);
TheTextArea.WrapWidth = WinWidth - 80;;
ButSave.WinTop += DiffY;
ButSend.WinLeft += DiffX;
ButSend.WinTop += DiffY;
ButtonDisconnectAndQuit.WinLeft += DiffX;
ButtonDisconnectAndQuit.WinTop += DiffY;
EditMesg.WinTop += DiffY;
EditMesg.SetSize(EditMesg.WinWidth + DiffX, EditMesg.WinHeight);
EditMesg.EditBoxWidth = EditMesg.WinWidth;
ButtonPlaySpectate.WinTop += DiffY;
ButtonPlaySpectate.SetSize(ButtonPlaySpectate.WinWidth + DiffX, ButtonPlaySpectate.WinHeight);
}
PrevWinWidth = WinWidth;
PrevWinHeight = WinHeight;
}
function BeforePaint( Canvas C, float X, float Y )
{
Super.BeforePaint(C, X, Y);
Resize();
}
function Paint(Canvas C, float MouseX, float MouseY)
{
// local Texture SomeTextureImportedNatively;
Super.Paint(C, MouseX, MouseY);
// SomeTextureImportedNatively = CDDA.LoadTextureFromFileOnTheRun("hmm"); //class'CDDiscordActor'.static.LoadTextureFromFileOnTheRun("hmm");
if(FrameWindow.bApplyBGToChatWindow)
{
C.DrawColor = FrameWindow.BackGroundColor;
DrawStretchedTexture(C, 0, 0, WinWidth, WinHeight, Texture'BackgroundGradation');
}
else
{
DrawStretchedTexture(C, 0, 0, WinWidth, WinHeight, Texture'BlackTexture');
}
}
function Close(optional bool bByParent)
{
Super.Close(bByParent);
SaveConfig();
}
// How about all the talk messages on ignore list?
defaultproperties
{
SilColor=(R=180,G=180,B=180)
GrnColor=(R=0,G=255,B=32)
TxtColor=(R=255,G=255,B=255,A=0)
YelColor=(R=192,G=192,B=1)
IgnorableStrings(0)="Base is uncovered!"
IgnorableStrings(1)="Somebody get our flag back!"
IgnorableStrings(2)="I've got the flag."
IgnorableStrings(3)="I've got your back."
IgnorableStrings(4)="I'm hit! I'm hit!"
IgnorableStrings(5)="Man down!"
IgnorableStrings(6)="I'm under heavy attack!"
IgnorableStrings(7)="You got point."
IgnorableStrings(8)="I've got our flag."
IgnorableStrings(9)="I'm in position."
IgnorableStrings(10)="Hang in there."
IgnorableStrings(11)="Control point is secure."
IgnorableStrings(12)="Enemy flag carrier is here."
IgnorableStrings(13)="I need some backup."
IgnorableStrings(14)="Incoming!"
IgnorableStrings(15)="I've got your back."
IgnorableStrings(16)="Objective destroyed."
bIgnoreMessageFilter=true
}
/*
*
* /\
* / /
* /\| |
* | | |/\
* | | / /
* | ` /
* `\ (___
* _.-> ,-.-.
* _.' | \ \
* / _____| 0 |0\
* | /` `^-.\.-'`-._
* | | `-._
* | : `.
* \ `._ `-.__ O.'
* _.--, \ `._ __.^--._O_..-'
* `---, `. `\ /` ` `
* `\ `, `\ |
* | : ; |
* / `. ___|__|___
* / `. ( )
* / `---.:____...---' `--------`.
* / ( `. __ `.
* | `---------' _ / \ \
* | .-. _._ (_) `--' \
* | ( ) / \ \
* \ `-' \ / ;-._
* \ `-' \ .' `.
* /`. `\ `\ _.-'`-. `.___
* | `-._ `\ `\.-' `-. ,--`
* \ `--.___ ___`\ \ ||^\\
* `._ | ``----'' `. `\ `' `
* `--; \ jgs `. `.
* //^||^\\ //^||^\\
* ' `' ` ' ' `
*/