DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Файл ScriptConsoleEnfScriptTab.c

См. исходные тексты.

Структуры данных

class  ScriptConsoleEnfScriptTab
 

Функции

ScriptConsoleEnfScriptTab ScriptConsoleTabBase OnSelected ()
 
void ScriptConsoleEnfScriptTab (Widget root, ScriptConsole console, Widget button, ScriptConsoleTabBase parent=null)
 
void ~ScriptConsoleEnfScriptTab ()
 
static void PrintS (string message)
 
static void PrintS (bool message)
 
static void PrintS (int message)
 
static void PrintS (float message)
 
static void PrintS (vector message)
 
static void PrintS (Object message)
 
void Add (string message, bool isReload=false)
 
void Clear (bool clearFile=false)
 
void ReloadScriptOutput ()
 
void HistoryBack ()
 
void HistoryForward ()
 
void RunEnscript ()
 
void ColorRunButton (bool success)
 
void ResetRunButtonColor ()
 
void RunEnscriptServer ()
 
void EnscriptHistoryBack ()
 
void EnscriptHistoryForward ()
 
override void OnRPCEx (int rpc_type, ParamsReadContext ctx)
 
override bool OnClick (Widget w, int x, int y, int button)
 
override bool OnChange (Widget w, int x, int y, bool finished)
 
override void Show (bool show, ScriptConsoleTabBase selectedHandler)
 

Переменные

static ScriptConsoleEnfScriptTab m_Instance
 
int m_EnscriptHistoryRow
 
int m_EnscriptHistoryRowServer
 
ref TStringArray m_EnscriptConsoleHistory
 
ref TStringArray m_EnscriptConsoleHistoryServer
 
PluginLocalEnscriptHistory m_ModuleLocalEnscriptHistory
 
PluginLocalEnscriptHistoryServer m_ModuleLocalEnscriptHistoryServer
 
MultilineEditBoxWidget m_EnfScriptEdit
 
ButtonWidget m_EnfScriptRun
 
ButtonWidget m_EnfScriptClear
 
TextListboxWidget m_ScriptOutputListbox
 
bool m_AllowScriptOutput
 
int m_RunColor
 
static ref TStringArray m_ScriptOutputHistory = new TStringArray()
 

Функции

◆ Add()

void Add ( string message,
bool isReload = false )
protected

◆ Clear()

void Clear ( bool clearFile = false)
protected
360{
361 protected static ScriptConsoleEnfScriptTab m_Instance;
362 protected int m_EnscriptHistoryRow;
363 protected int m_EnscriptHistoryRowServer;
372 protected bool m_AllowScriptOutput;
373 protected int m_RunColor;
374
376
378 {
379 m_Instance = this;
384 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget("MultilineEditBoxWidget0"));
385 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget("RunButton"));
386 m_EnfScriptClear = ButtonWidget.Cast(root.FindAnyWidget("ClearButton"));
387 m_ScriptOutputListbox = TextListboxWidget.Cast(root.FindAnyWidget("ScriptOutputListbox"));
388 m_RunColor = m_EnfScriptRun.GetColor();
389 }
390
392 {
394 }
395
396 override void OnSelected()
397 {
399 if (m_EnscriptConsoleHistory.IsValidIndex(index))
400 {
401 string text = m_EnscriptConsoleHistory.Get(index);
402 m_EnfScriptEdit.SetText(text);
403 }
405 }
406
407 static void PrintS(string message)
408 {
409 Print(message);
410 if (m_Instance)
411 m_Instance.Add(message);
412 }
413
414 static void PrintS(bool message)
415 {
416 PrintS(message.ToString());
417 }
418
419 static void PrintS(int message)
420 {
421 PrintS(message.ToString());
422 }
423
424 static void PrintS(float message)
425 {
426 PrintS(message.ToString());
427 }
428
429 static void PrintS(vector message)
430 {
431 PrintS(message.ToString());
432 }
433
434 static void PrintS(Object message)
435 {
436 PrintS(message.ToString());
437 }
438
439
440 void Add(string message, bool isReload = false)
441 {
442 if (message != string.Empty)
443 {
445 {
446 if (!isReload)
449 m_ScriptOutputListbox.EnsureVisible(m_ScriptOutputListbox.GetNumItems());
450 }
451 }
452 }
453
454 protected void Clear(bool clearFile = false)
455 {
456 if(clearFile)
458 m_ScriptOutputListbox.ClearItems();
459 }
460
461
462
463 protected void ReloadScriptOutput()
464 {
465 m_ScriptOutputListbox.ClearItems();
466 m_AllowScriptOutput = true;
467 foreach ( string s: m_ScriptOutputHistory)
468 {
469 Add(s, true);
470 }
471 m_AllowScriptOutput = false;
472 }
473
474 void HistoryBack()
475 {
476
478 }
479
480 void HistoryForward()
481 {
483 }
484
485 protected void RunEnscript()
486 {
487 #ifdef DEVELOPER
488 string code;
489 m_EnfScriptEdit.GetText(code);
490 string codeNoReplace = code;
492 m_AllowScriptOutput = true;
493 code.Replace("Print(","ScriptConsoleEnfScriptTab.PrintS(");
494 code.Replace("Print (","ScriptConsoleEnfScriptTab.PrintS(");
495 bool success = GetGame().ExecuteEnforceScript("void scConsMain() \n{\n" + code + "\n}\n", "scConsMain");
496 m_AllowScriptOutput = false;
498
501 #endif
502 }
503
504 protected void ColorRunButton(bool success)
505 {
506 if (success)
507 {
508 m_EnfScriptRun.SetColor(ARGB(255,0,255,0));
509 }
510 else
511 {
512 m_EnfScriptRun.SetColor(ARGB(255,255,0,0));
513 }
514 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(ResetRunButtonColor,600);
515 }
516
517 protected void ResetRunButtonColor()
518 {
519 m_EnfScriptRun.SetColor(m_RunColor);
520 }
521
522 protected void RunEnscriptServer()
523 {
524 string code;
525 m_EnfScriptEdit.GetText(code);
529 GetGame().RPCSingleParam(GetGame().GetPlayer(), ERPCs.DEV_RPC_SERVER_SCRIPT, CachedObjectsParams.PARAM1_STRING, true, GetGame().GetPlayer().GetIdentity());
530 }
531
532 protected void EnscriptHistoryBack()
533 {
534 int history_index;
535 if (m_EnfScriptEdit)
536 {
539 if (history_index > -1)
540 {
542 }
544 }
545 }
546
547
548 protected void EnscriptHistoryForward()
549 {
550 if (m_EnfScriptEdit)
551 {
552 int history_index;
556 {
558 }
560 }
561 }
562
563 override void OnRPCEx(int rpc_type, ParamsReadContext ctx)
564 {
565 super.OnRPCEx(rpc_type, ctx);
566 #ifdef DIAG_DEVELOPER
567 switch (rpc_type)
568 {
569 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
570 {
572 {
574 }
575 break;
576 }
577 }
578 #endif
579 }
580
581 override bool OnClick(Widget w, int x, int y, int button)
582 {
583 super.OnClick(w,x,y,button);
584 if (w == m_EnfScriptRun)
585 {
586 RunEnscript();
587 return true;
588 }
589 else if (w == m_EnfScriptClear)
590 {
591 m_ScriptOutputListbox.ClearItems();
592 m_ScriptOutputHistory.Clear();
593 return true;
594 }
595
596 return false;
597 }
598
599 override bool OnChange(Widget w, int x, int y, bool finished)
600 {
601 super.OnChange(w, x, y, finished);
602 return false;
603 }
604
605
606 override void Show(bool show, ScriptConsoleTabBase selectedHandler)
607 {
609 {
610 //do nothing
611 }
612 else
613 {
614 m_Root.Show(show);
615 m_Root.Enable(show);
616 }
617 }
618
619}
620
622{
623 override void OnSelected()
624 {
626 if (m_EnscriptConsoleHistoryServer.IsValidIndex(index))
627 {
629 m_EnfScriptEdit.SetText(text);
630 }
632 }
633
634 override protected void EnscriptHistoryBack()
635 {
636 int history_index;
637 if (m_EnfScriptEdit)
638 {
641 if (history_index > -1)
642 {
644 }
646 }
647 }
648
649 override protected void EnscriptHistoryForward()
650 {
651 if (m_EnfScriptEdit)
652 {
653 int history_index;
654
658 {
660 }
662 }
663 }
664
665 override bool OnClick(Widget w, int x, int y, int button)
666 {
667 if (w == m_EnfScriptRun)
668 {
670 return true;
671 }
672 else if (w == m_EnfScriptClear)
673 {
674 m_ScriptOutputListbox.ClearItems();
675 m_ScriptOutputHistory.Clear();
676 return true;
677 }
678
679 return false;
680 }
681
682}
void Show()
Definition DayZGame.c:157
override bool OnClick(Widget w, int x, int y, int button)
buttons clicks
Definition DayZGame.c:146
ERPCs
Definition ERPCs.c:2
Empty
Definition Hand_States.c:14
Icon x
Icon y
PlayerBase GetPlayer()
Definition ModifierBase.c:51
PluginBase GetPlugin(typename plugin_type)
Definition PluginManager.c:316
PlayerBase _player
Definition QuickBarBase.c:18
ref TStringArray m_EnscriptConsoleHistoryServer
Definition ScriptConsoleEnfScriptTab.c:270
int m_EnscriptHistoryRowServer
Definition ScriptConsoleEnfScriptTab.c:268
override bool OnChange(Widget w, int x, int y, bool finished)
Definition ScriptConsoleEnfScriptTab.c:504
ButtonWidget m_EnfScriptClear
Definition ScriptConsoleEnfScriptTab.c:275
ScriptConsoleEnfScriptTab ScriptConsoleTabBase OnSelected()
Definition ScriptConsoleEnfScriptTab.c:265
void ReloadScriptOutput()
Definition ScriptConsoleEnfScriptTab.c:368
TextListboxWidget m_ScriptOutputListbox
Definition ScriptConsoleEnfScriptTab.c:276
void ResetRunButtonColor()
Definition ScriptConsoleEnfScriptTab.c:422
void Add(string message, bool isReload=false)
Definition ScriptConsoleEnfScriptTab.c:345
void ScriptConsoleEnfScriptTab(Widget root, ScriptConsole console, Widget button, ScriptConsoleTabBase parent=null)
Definition ScriptConsoleEnfScriptTab.c:282
void ColorRunButton(bool success)
Definition ScriptConsoleEnfScriptTab.c:409
void RunEnscriptServer()
Definition ScriptConsoleEnfScriptTab.c:427
bool m_AllowScriptOutput
Definition ScriptConsoleEnfScriptTab.c:277
override void OnRPCEx(int rpc_type, ParamsReadContext ctx)
Definition ScriptConsoleEnfScriptTab.c:468
static ref TStringArray m_ScriptOutputHistory
Definition ScriptConsoleEnfScriptTab.c:280
int m_RunColor
Definition ScriptConsoleEnfScriptTab.c:278
PluginLocalEnscriptHistoryServer m_ModuleLocalEnscriptHistoryServer
Definition ScriptConsoleEnfScriptTab.c:272
ButtonWidget m_EnfScriptRun
Definition ScriptConsoleEnfScriptTab.c:274
void Clear(bool clearFile=false)
Definition ScriptConsoleEnfScriptTab.c:359
void EnscriptHistoryBack()
Definition ScriptConsoleEnfScriptTab.c:437
void ~ScriptConsoleEnfScriptTab()
Definition ScriptConsoleEnfScriptTab.c:296
static void PrintS(string message)
Definition ScriptConsoleEnfScriptTab.c:312
void RunEnscript()
Definition ScriptConsoleEnfScriptTab.c:390
void HistoryForward()
Definition ScriptConsoleEnfScriptTab.c:385
void HistoryBack()
Definition ScriptConsoleEnfScriptTab.c:379
int m_EnscriptHistoryRow
Definition ScriptConsoleEnfScriptTab.c:267
PluginLocalEnscriptHistory m_ModuleLocalEnscriptHistory
Definition ScriptConsoleEnfScriptTab.c:271
ref TStringArray m_EnscriptConsoleHistory
Definition ScriptConsoleEnfScriptTab.c:269
static ScriptConsoleEnfScriptTab m_Instance
Definition ScriptConsoleEnfScriptTab.c:266
MultilineEditBoxWidget m_EnfScriptEdit
Definition ScriptConsoleEnfScriptTab.c:273
override bool OnClick(Widget w, int x, int y, int button)
Definition ScriptConsoleEnfScriptTab.c:486
void EnscriptHistoryForward()
Definition ScriptConsoleEnfScriptTab.c:453
Widget m_Root
Definition SizeToChild.c:91
Definition UtilityClasses.c:10
static ref Param1< bool > PARAM1_BOOL
Definition UtilityClasses.c:12
static ref Param1< string > PARAM1_STRING
Definition UtilityClasses.c:14
Definition Debug.c:14
static void ClearLogs()
Definition Debug.c:563
Definition ObjectTyped.c:2
Definition EntityAI.c:95
Definition PlayerBaseClient.c:2
Definition ScriptConsoleEnfScriptTab.c:2
Definition ScriptConsoleTabBase.c:2
Serialization general interface. Serializer API works with:
Definition Serializer.c:56
Definition EnWidgets.c:190
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Definition IsBoxCollidingGeometryProxyClasses.c:28
Definition EnConvert.c:106
proto native CGame GetGame()
proto void Print(void var)
Prints content of variable to console/log.
array< string > TStringArray
Definition EnScript.c:685
string String(string s)
Helper for passing string expression to functions with void parameter. Example: Print(String("Hello "...
Definition EnScript.c:339
const int CALL_CATEGORY_SYSTEM
Definition tools.c:8
int ARGB(int a, int r, int g, int b)
Definition proto.c:322

Используется в CallQueue::Tick(), multiMap< Class K, Class V >::~multiMap() и array< TimerBase >::~TimerQueue().

◆ ColorRunButton()

void ColorRunButton ( bool success)
protected
410{
411 protected static ScriptConsoleEnfScriptTab m_Instance;
412 protected int m_EnscriptHistoryRow;
413 protected int m_EnscriptHistoryRowServer;
422 protected bool m_AllowScriptOutput;
423 protected int m_RunColor;
424
426
428 {
429 m_Instance = this;
434 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget("MultilineEditBoxWidget0"));
435 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget("RunButton"));
436 m_EnfScriptClear = ButtonWidget.Cast(root.FindAnyWidget("ClearButton"));
437 m_ScriptOutputListbox = TextListboxWidget.Cast(root.FindAnyWidget("ScriptOutputListbox"));
438 m_RunColor = m_EnfScriptRun.GetColor();
439 }
440
442 {
444 }
445
446 override void OnSelected()
447 {
449 if (m_EnscriptConsoleHistory.IsValidIndex(index))
450 {
451 string text = m_EnscriptConsoleHistory.Get(index);
452 m_EnfScriptEdit.SetText(text);
453 }
455 }
456
457 static void PrintS(string message)
458 {
459 Print(message);
460 if (m_Instance)
461 m_Instance.Add(message);
462 }
463
464 static void PrintS(bool message)
465 {
466 PrintS(message.ToString());
467 }
468
469 static void PrintS(int message)
470 {
471 PrintS(message.ToString());
472 }
473
474 static void PrintS(float message)
475 {
476 PrintS(message.ToString());
477 }
478
479 static void PrintS(vector message)
480 {
481 PrintS(message.ToString());
482 }
483
484 static void PrintS(Object message)
485 {
486 PrintS(message.ToString());
487 }
488
489
490 void Add(string message, bool isReload = false)
491 {
492 if (message != string.Empty)
493 {
495 {
496 if (!isReload)
499 m_ScriptOutputListbox.EnsureVisible(m_ScriptOutputListbox.GetNumItems());
500 }
501 }
502 }
503
504 protected void Clear(bool clearFile = false)
505 {
506 if(clearFile)
508 m_ScriptOutputListbox.ClearItems();
509 }
510
511
512
513 protected void ReloadScriptOutput()
514 {
515 m_ScriptOutputListbox.ClearItems();
516 m_AllowScriptOutput = true;
517 foreach ( string s: m_ScriptOutputHistory)
518 {
519 Add(s, true);
520 }
521 m_AllowScriptOutput = false;
522 }
523
524 void HistoryBack()
525 {
526
528 }
529
530 void HistoryForward()
531 {
533 }
534
535 protected void RunEnscript()
536 {
537 #ifdef DEVELOPER
538 string code;
539 m_EnfScriptEdit.GetText(code);
540 string codeNoReplace = code;
542 m_AllowScriptOutput = true;
543 code.Replace("Print(","ScriptConsoleEnfScriptTab.PrintS(");
544 code.Replace("Print (","ScriptConsoleEnfScriptTab.PrintS(");
545 bool success = GetGame().ExecuteEnforceScript("void scConsMain() \n{\n" + code + "\n}\n", "scConsMain");
546 m_AllowScriptOutput = false;
548
551 #endif
552 }
553
554 protected void ColorRunButton(bool success)
555 {
556 if (success)
557 {
558 m_EnfScriptRun.SetColor(ARGB(255,0,255,0));
559 }
560 else
561 {
562 m_EnfScriptRun.SetColor(ARGB(255,255,0,0));
563 }
564 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(ResetRunButtonColor,600);
565 }
566
567 protected void ResetRunButtonColor()
568 {
569 m_EnfScriptRun.SetColor(m_RunColor);
570 }
571
572 protected void RunEnscriptServer()
573 {
574 string code;
575 m_EnfScriptEdit.GetText(code);
579 GetGame().RPCSingleParam(GetGame().GetPlayer(), ERPCs.DEV_RPC_SERVER_SCRIPT, CachedObjectsParams.PARAM1_STRING, true, GetGame().GetPlayer().GetIdentity());
580 }
581
582 protected void EnscriptHistoryBack()
583 {
584 int history_index;
585 if (m_EnfScriptEdit)
586 {
589 if (history_index > -1)
590 {
592 }
594 }
595 }
596
597
598 protected void EnscriptHistoryForward()
599 {
600 if (m_EnfScriptEdit)
601 {
602 int history_index;
606 {
608 }
610 }
611 }
612
613 override void OnRPCEx(int rpc_type, ParamsReadContext ctx)
614 {
615 super.OnRPCEx(rpc_type, ctx);
616 #ifdef DIAG_DEVELOPER
617 switch (rpc_type)
618 {
619 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
620 {
622 {
624 }
625 break;
626 }
627 }
628 #endif
629 }
630
631 override bool OnClick(Widget w, int x, int y, int button)
632 {
633 super.OnClick(w,x,y,button);
634 if (w == m_EnfScriptRun)
635 {
636 RunEnscript();
637 return true;
638 }
639 else if (w == m_EnfScriptClear)
640 {
641 m_ScriptOutputListbox.ClearItems();
642 m_ScriptOutputHistory.Clear();
643 return true;
644 }
645
646 return false;
647 }
648
649 override bool OnChange(Widget w, int x, int y, bool finished)
650 {
651 super.OnChange(w, x, y, finished);
652 return false;
653 }
654
655
656 override void Show(bool show, ScriptConsoleTabBase selectedHandler)
657 {
659 {
660 //do nothing
661 }
662 else
663 {
664 m_Root.Show(show);
665 m_Root.Enable(show);
666 }
667 }
668
669}
670
672{
673 override void OnSelected()
674 {
676 if (m_EnscriptConsoleHistoryServer.IsValidIndex(index))
677 {
679 m_EnfScriptEdit.SetText(text);
680 }
682 }
683
684 override protected void EnscriptHistoryBack()
685 {
686 int history_index;
687 if (m_EnfScriptEdit)
688 {
691 if (history_index > -1)
692 {
694 }
696 }
697 }
698
699 override protected void EnscriptHistoryForward()
700 {
701 if (m_EnfScriptEdit)
702 {
703 int history_index;
704
708 {
710 }
712 }
713 }
714
715 override bool OnClick(Widget w, int x, int y, int button)
716 {
717 if (w == m_EnfScriptRun)
718 {
720 return true;
721 }
722 else if (w == m_EnfScriptClear)
723 {
724 m_ScriptOutputListbox.ClearItems();
725 m_ScriptOutputHistory.Clear();
726 return true;
727 }
728
729 return false;
730 }
731
732}

◆ EnscriptHistoryBack()

void EnscriptHistoryBack ( )
protected
438{
439 protected static ScriptConsoleEnfScriptTab m_Instance;
440 protected int m_EnscriptHistoryRow;
441 protected int m_EnscriptHistoryRowServer;
450 protected bool m_AllowScriptOutput;
451 protected int m_RunColor;
452
454
456 {
457 m_Instance = this;
462 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget("MultilineEditBoxWidget0"));
463 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget("RunButton"));
464 m_EnfScriptClear = ButtonWidget.Cast(root.FindAnyWidget("ClearButton"));
465 m_ScriptOutputListbox = TextListboxWidget.Cast(root.FindAnyWidget("ScriptOutputListbox"));
466 m_RunColor = m_EnfScriptRun.GetColor();
467 }
468
470 {
472 }
473
474 override void OnSelected()
475 {
477 if (m_EnscriptConsoleHistory.IsValidIndex(index))
478 {
479 string text = m_EnscriptConsoleHistory.Get(index);
480 m_EnfScriptEdit.SetText(text);
481 }
483 }
484
485 static void PrintS(string message)
486 {
487 Print(message);
488 if (m_Instance)
489 m_Instance.Add(message);
490 }
491
492 static void PrintS(bool message)
493 {
494 PrintS(message.ToString());
495 }
496
497 static void PrintS(int message)
498 {
499 PrintS(message.ToString());
500 }
501
502 static void PrintS(float message)
503 {
504 PrintS(message.ToString());
505 }
506
507 static void PrintS(vector message)
508 {
509 PrintS(message.ToString());
510 }
511
512 static void PrintS(Object message)
513 {
514 PrintS(message.ToString());
515 }
516
517
518 void Add(string message, bool isReload = false)
519 {
520 if (message != string.Empty)
521 {
523 {
524 if (!isReload)
527 m_ScriptOutputListbox.EnsureVisible(m_ScriptOutputListbox.GetNumItems());
528 }
529 }
530 }
531
532 protected void Clear(bool clearFile = false)
533 {
534 if(clearFile)
536 m_ScriptOutputListbox.ClearItems();
537 }
538
539
540
541 protected void ReloadScriptOutput()
542 {
543 m_ScriptOutputListbox.ClearItems();
544 m_AllowScriptOutput = true;
545 foreach ( string s: m_ScriptOutputHistory)
546 {
547 Add(s, true);
548 }
549 m_AllowScriptOutput = false;
550 }
551
552 void HistoryBack()
553 {
554
556 }
557
558 void HistoryForward()
559 {
561 }
562
563 protected void RunEnscript()
564 {
565 #ifdef DEVELOPER
566 string code;
567 m_EnfScriptEdit.GetText(code);
568 string codeNoReplace = code;
570 m_AllowScriptOutput = true;
571 code.Replace("Print(","ScriptConsoleEnfScriptTab.PrintS(");
572 code.Replace("Print (","ScriptConsoleEnfScriptTab.PrintS(");
573 bool success = GetGame().ExecuteEnforceScript("void scConsMain() \n{\n" + code + "\n}\n", "scConsMain");
574 m_AllowScriptOutput = false;
576
579 #endif
580 }
581
582 protected void ColorRunButton(bool success)
583 {
584 if (success)
585 {
586 m_EnfScriptRun.SetColor(ARGB(255,0,255,0));
587 }
588 else
589 {
590 m_EnfScriptRun.SetColor(ARGB(255,255,0,0));
591 }
592 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(ResetRunButtonColor,600);
593 }
594
595 protected void ResetRunButtonColor()
596 {
597 m_EnfScriptRun.SetColor(m_RunColor);
598 }
599
600 protected void RunEnscriptServer()
601 {
602 string code;
603 m_EnfScriptEdit.GetText(code);
607 GetGame().RPCSingleParam(GetGame().GetPlayer(), ERPCs.DEV_RPC_SERVER_SCRIPT, CachedObjectsParams.PARAM1_STRING, true, GetGame().GetPlayer().GetIdentity());
608 }
609
610 protected void EnscriptHistoryBack()
611 {
612 int history_index;
613 if (m_EnfScriptEdit)
614 {
617 if (history_index > -1)
618 {
620 }
622 }
623 }
624
625
626 protected void EnscriptHistoryForward()
627 {
628 if (m_EnfScriptEdit)
629 {
630 int history_index;
634 {
636 }
638 }
639 }
640
641 override void OnRPCEx(int rpc_type, ParamsReadContext ctx)
642 {
643 super.OnRPCEx(rpc_type, ctx);
644 #ifdef DIAG_DEVELOPER
645 switch (rpc_type)
646 {
647 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
648 {
650 {
652 }
653 break;
654 }
655 }
656 #endif
657 }
658
659 override bool OnClick(Widget w, int x, int y, int button)
660 {
661 super.OnClick(w,x,y,button);
662 if (w == m_EnfScriptRun)
663 {
664 RunEnscript();
665 return true;
666 }
667 else if (w == m_EnfScriptClear)
668 {
669 m_ScriptOutputListbox.ClearItems();
670 m_ScriptOutputHistory.Clear();
671 return true;
672 }
673
674 return false;
675 }
676
677 override bool OnChange(Widget w, int x, int y, bool finished)
678 {
679 super.OnChange(w, x, y, finished);
680 return false;
681 }
682
683
684 override void Show(bool show, ScriptConsoleTabBase selectedHandler)
685 {
687 {
688 //do nothing
689 }
690 else
691 {
692 m_Root.Show(show);
693 m_Root.Enable(show);
694 }
695 }
696
697}
698
700{
701 override void OnSelected()
702 {
704 if (m_EnscriptConsoleHistoryServer.IsValidIndex(index))
705 {
707 m_EnfScriptEdit.SetText(text);
708 }
710 }
711
712 override protected void EnscriptHistoryBack()
713 {
714 int history_index;
715 if (m_EnfScriptEdit)
716 {
719 if (history_index > -1)
720 {
722 }
724 }
725 }
726
727 override protected void EnscriptHistoryForward()
728 {
729 if (m_EnfScriptEdit)
730 {
731 int history_index;
732
736 {
738 }
740 }
741 }
742
743 override bool OnClick(Widget w, int x, int y, int button)
744 {
745 if (w == m_EnfScriptRun)
746 {
748 return true;
749 }
750 else if (w == m_EnfScriptClear)
751 {
752 m_ScriptOutputListbox.ClearItems();
753 m_ScriptOutputHistory.Clear();
754 return true;
755 }
756
757 return false;
758 }
759
760}

◆ EnscriptHistoryForward()

void EnscriptHistoryForward ( )
protected
454{
455 protected static ScriptConsoleEnfScriptTab m_Instance;
456 protected int m_EnscriptHistoryRow;
457 protected int m_EnscriptHistoryRowServer;
466 protected bool m_AllowScriptOutput;
467 protected int m_RunColor;
468
470
472 {
473 m_Instance = this;
478 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget("MultilineEditBoxWidget0"));
479 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget("RunButton"));
480 m_EnfScriptClear = ButtonWidget.Cast(root.FindAnyWidget("ClearButton"));
481 m_ScriptOutputListbox = TextListboxWidget.Cast(root.FindAnyWidget("ScriptOutputListbox"));
482 m_RunColor = m_EnfScriptRun.GetColor();
483 }
484
486 {
488 }
489
490 override void OnSelected()
491 {
493 if (m_EnscriptConsoleHistory.IsValidIndex(index))
494 {
495 string text = m_EnscriptConsoleHistory.Get(index);
496 m_EnfScriptEdit.SetText(text);
497 }
499 }
500
501 static void PrintS(string message)
502 {
503 Print(message);
504 if (m_Instance)
505 m_Instance.Add(message);
506 }
507
508 static void PrintS(bool message)
509 {
510 PrintS(message.ToString());
511 }
512
513 static void PrintS(int message)
514 {
515 PrintS(message.ToString());
516 }
517
518 static void PrintS(float message)
519 {
520 PrintS(message.ToString());
521 }
522
523 static void PrintS(vector message)
524 {
525 PrintS(message.ToString());
526 }
527
528 static void PrintS(Object message)
529 {
530 PrintS(message.ToString());
531 }
532
533
534 void Add(string message, bool isReload = false)
535 {
536 if (message != string.Empty)
537 {
539 {
540 if (!isReload)
543 m_ScriptOutputListbox.EnsureVisible(m_ScriptOutputListbox.GetNumItems());
544 }
545 }
546 }
547
548 protected void Clear(bool clearFile = false)
549 {
550 if(clearFile)
552 m_ScriptOutputListbox.ClearItems();
553 }
554
555
556
557 protected void ReloadScriptOutput()
558 {
559 m_ScriptOutputListbox.ClearItems();
560 m_AllowScriptOutput = true;
561 foreach ( string s: m_ScriptOutputHistory)
562 {
563 Add(s, true);
564 }
565 m_AllowScriptOutput = false;
566 }
567
568 void HistoryBack()
569 {
570
572 }
573
574 void HistoryForward()
575 {
577 }
578
579 protected void RunEnscript()
580 {
581 #ifdef DEVELOPER
582 string code;
583 m_EnfScriptEdit.GetText(code);
584 string codeNoReplace = code;
586 m_AllowScriptOutput = true;
587 code.Replace("Print(","ScriptConsoleEnfScriptTab.PrintS(");
588 code.Replace("Print (","ScriptConsoleEnfScriptTab.PrintS(");
589 bool success = GetGame().ExecuteEnforceScript("void scConsMain() \n{\n" + code + "\n}\n", "scConsMain");
590 m_AllowScriptOutput = false;
592
595 #endif
596 }
597
598 protected void ColorRunButton(bool success)
599 {
600 if (success)
601 {
602 m_EnfScriptRun.SetColor(ARGB(255,0,255,0));
603 }
604 else
605 {
606 m_EnfScriptRun.SetColor(ARGB(255,255,0,0));
607 }
608 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(ResetRunButtonColor,600);
609 }
610
611 protected void ResetRunButtonColor()
612 {
613 m_EnfScriptRun.SetColor(m_RunColor);
614 }
615
616 protected void RunEnscriptServer()
617 {
618 string code;
619 m_EnfScriptEdit.GetText(code);
623 GetGame().RPCSingleParam(GetGame().GetPlayer(), ERPCs.DEV_RPC_SERVER_SCRIPT, CachedObjectsParams.PARAM1_STRING, true, GetGame().GetPlayer().GetIdentity());
624 }
625
626 protected void EnscriptHistoryBack()
627 {
628 int history_index;
629 if (m_EnfScriptEdit)
630 {
633 if (history_index > -1)
634 {
636 }
638 }
639 }
640
641
642 protected void EnscriptHistoryForward()
643 {
644 if (m_EnfScriptEdit)
645 {
646 int history_index;
650 {
652 }
654 }
655 }
656
657 override void OnRPCEx(int rpc_type, ParamsReadContext ctx)
658 {
659 super.OnRPCEx(rpc_type, ctx);
660 #ifdef DIAG_DEVELOPER
661 switch (rpc_type)
662 {
663 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
664 {
666 {
668 }
669 break;
670 }
671 }
672 #endif
673 }
674
675 override bool OnClick(Widget w, int x, int y, int button)
676 {
677 super.OnClick(w,x,y,button);
678 if (w == m_EnfScriptRun)
679 {
680 RunEnscript();
681 return true;
682 }
683 else if (w == m_EnfScriptClear)
684 {
685 m_ScriptOutputListbox.ClearItems();
686 m_ScriptOutputHistory.Clear();
687 return true;
688 }
689
690 return false;
691 }
692
693 override bool OnChange(Widget w, int x, int y, bool finished)
694 {
695 super.OnChange(w, x, y, finished);
696 return false;
697 }
698
699
700 override void Show(bool show, ScriptConsoleTabBase selectedHandler)
701 {
703 {
704 //do nothing
705 }
706 else
707 {
708 m_Root.Show(show);
709 m_Root.Enable(show);
710 }
711 }
712
713}
714
716{
717 override void OnSelected()
718 {
720 if (m_EnscriptConsoleHistoryServer.IsValidIndex(index))
721 {
723 m_EnfScriptEdit.SetText(text);
724 }
726 }
727
728 override protected void EnscriptHistoryBack()
729 {
730 int history_index;
731 if (m_EnfScriptEdit)
732 {
735 if (history_index > -1)
736 {
738 }
740 }
741 }
742
743 override protected void EnscriptHistoryForward()
744 {
745 if (m_EnfScriptEdit)
746 {
747 int history_index;
748
752 {
754 }
756 }
757 }
758
759 override bool OnClick(Widget w, int x, int y, int button)
760 {
761 if (w == m_EnfScriptRun)
762 {
764 return true;
765 }
766 else if (w == m_EnfScriptClear)
767 {
768 m_ScriptOutputListbox.ClearItems();
769 m_ScriptOutputHistory.Clear();
770 return true;
771 }
772
773 return false;
774 }
775
776}

◆ HistoryBack()

void HistoryBack ( )
protected
380{
381 protected static ScriptConsoleEnfScriptTab m_Instance;
382 protected int m_EnscriptHistoryRow;
383 protected int m_EnscriptHistoryRowServer;
392 protected bool m_AllowScriptOutput;
393 protected int m_RunColor;
394
396
398 {
399 m_Instance = this;
404 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget("MultilineEditBoxWidget0"));
405 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget("RunButton"));
406 m_EnfScriptClear = ButtonWidget.Cast(root.FindAnyWidget("ClearButton"));
407 m_ScriptOutputListbox = TextListboxWidget.Cast(root.FindAnyWidget("ScriptOutputListbox"));
408 m_RunColor = m_EnfScriptRun.GetColor();
409 }
410
412 {
414 }
415
416 override void OnSelected()
417 {
419 if (m_EnscriptConsoleHistory.IsValidIndex(index))
420 {
421 string text = m_EnscriptConsoleHistory.Get(index);
422 m_EnfScriptEdit.SetText(text);
423 }
425 }
426
427 static void PrintS(string message)
428 {
429 Print(message);
430 if (m_Instance)
431 m_Instance.Add(message);
432 }
433
434 static void PrintS(bool message)
435 {
436 PrintS(message.ToString());
437 }
438
439 static void PrintS(int message)
440 {
441 PrintS(message.ToString());
442 }
443
444 static void PrintS(float message)
445 {
446 PrintS(message.ToString());
447 }
448
449 static void PrintS(vector message)
450 {
451 PrintS(message.ToString());
452 }
453
454 static void PrintS(Object message)
455 {
456 PrintS(message.ToString());
457 }
458
459
460 void Add(string message, bool isReload = false)
461 {
462 if (message != string.Empty)
463 {
465 {
466 if (!isReload)
469 m_ScriptOutputListbox.EnsureVisible(m_ScriptOutputListbox.GetNumItems());
470 }
471 }
472 }
473
474 protected void Clear(bool clearFile = false)
475 {
476 if(clearFile)
478 m_ScriptOutputListbox.ClearItems();
479 }
480
481
482
483 protected void ReloadScriptOutput()
484 {
485 m_ScriptOutputListbox.ClearItems();
486 m_AllowScriptOutput = true;
487 foreach ( string s: m_ScriptOutputHistory)
488 {
489 Add(s, true);
490 }
491 m_AllowScriptOutput = false;
492 }
493
494 void HistoryBack()
495 {
496
498 }
499
500 void HistoryForward()
501 {
503 }
504
505 protected void RunEnscript()
506 {
507 #ifdef DEVELOPER
508 string code;
509 m_EnfScriptEdit.GetText(code);
510 string codeNoReplace = code;
512 m_AllowScriptOutput = true;
513 code.Replace("Print(","ScriptConsoleEnfScriptTab.PrintS(");
514 code.Replace("Print (","ScriptConsoleEnfScriptTab.PrintS(");
515 bool success = GetGame().ExecuteEnforceScript("void scConsMain() \n{\n" + code + "\n}\n", "scConsMain");
516 m_AllowScriptOutput = false;
518
521 #endif
522 }
523
524 protected void ColorRunButton(bool success)
525 {
526 if (success)
527 {
528 m_EnfScriptRun.SetColor(ARGB(255,0,255,0));
529 }
530 else
531 {
532 m_EnfScriptRun.SetColor(ARGB(255,255,0,0));
533 }
534 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(ResetRunButtonColor,600);
535 }
536
537 protected void ResetRunButtonColor()
538 {
539 m_EnfScriptRun.SetColor(m_RunColor);
540 }
541
542 protected void RunEnscriptServer()
543 {
544 string code;
545 m_EnfScriptEdit.GetText(code);
549 GetGame().RPCSingleParam(GetGame().GetPlayer(), ERPCs.DEV_RPC_SERVER_SCRIPT, CachedObjectsParams.PARAM1_STRING, true, GetGame().GetPlayer().GetIdentity());
550 }
551
552 protected void EnscriptHistoryBack()
553 {
554 int history_index;
555 if (m_EnfScriptEdit)
556 {
559 if (history_index > -1)
560 {
562 }
564 }
565 }
566
567
568 protected void EnscriptHistoryForward()
569 {
570 if (m_EnfScriptEdit)
571 {
572 int history_index;
576 {
578 }
580 }
581 }
582
583 override void OnRPCEx(int rpc_type, ParamsReadContext ctx)
584 {
585 super.OnRPCEx(rpc_type, ctx);
586 #ifdef DIAG_DEVELOPER
587 switch (rpc_type)
588 {
589 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
590 {
592 {
594 }
595 break;
596 }
597 }
598 #endif
599 }
600
601 override bool OnClick(Widget w, int x, int y, int button)
602 {
603 super.OnClick(w,x,y,button);
604 if (w == m_EnfScriptRun)
605 {
606 RunEnscript();
607 return true;
608 }
609 else if (w == m_EnfScriptClear)
610 {
611 m_ScriptOutputListbox.ClearItems();
612 m_ScriptOutputHistory.Clear();
613 return true;
614 }
615
616 return false;
617 }
618
619 override bool OnChange(Widget w, int x, int y, bool finished)
620 {
621 super.OnChange(w, x, y, finished);
622 return false;
623 }
624
625
626 override void Show(bool show, ScriptConsoleTabBase selectedHandler)
627 {
629 {
630 //do nothing
631 }
632 else
633 {
634 m_Root.Show(show);
635 m_Root.Enable(show);
636 }
637 }
638
639}
640
642{
643 override void OnSelected()
644 {
646 if (m_EnscriptConsoleHistoryServer.IsValidIndex(index))
647 {
649 m_EnfScriptEdit.SetText(text);
650 }
652 }
653
654 override protected void EnscriptHistoryBack()
655 {
656 int history_index;
657 if (m_EnfScriptEdit)
658 {
661 if (history_index > -1)
662 {
664 }
666 }
667 }
668
669 override protected void EnscriptHistoryForward()
670 {
671 if (m_EnfScriptEdit)
672 {
673 int history_index;
674
678 {
680 }
682 }
683 }
684
685 override bool OnClick(Widget w, int x, int y, int button)
686 {
687 if (w == m_EnfScriptRun)
688 {
690 return true;
691 }
692 else if (w == m_EnfScriptClear)
693 {
694 m_ScriptOutputListbox.ClearItems();
695 m_ScriptOutputHistory.Clear();
696 return true;
697 }
698
699 return false;
700 }
701
702}

◆ HistoryForward()

void HistoryForward ( )
protected
386{
387 protected static ScriptConsoleEnfScriptTab m_Instance;
388 protected int m_EnscriptHistoryRow;
389 protected int m_EnscriptHistoryRowServer;
398 protected bool m_AllowScriptOutput;
399 protected int m_RunColor;
400
402
404 {
405 m_Instance = this;
410 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget("MultilineEditBoxWidget0"));
411 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget("RunButton"));
412 m_EnfScriptClear = ButtonWidget.Cast(root.FindAnyWidget("ClearButton"));
413 m_ScriptOutputListbox = TextListboxWidget.Cast(root.FindAnyWidget("ScriptOutputListbox"));
414 m_RunColor = m_EnfScriptRun.GetColor();
415 }
416
418 {
420 }
421
422 override void OnSelected()
423 {
425 if (m_EnscriptConsoleHistory.IsValidIndex(index))
426 {
427 string text = m_EnscriptConsoleHistory.Get(index);
428 m_EnfScriptEdit.SetText(text);
429 }
431 }
432
433 static void PrintS(string message)
434 {
435 Print(message);
436 if (m_Instance)
437 m_Instance.Add(message);
438 }
439
440 static void PrintS(bool message)
441 {
442 PrintS(message.ToString());
443 }
444
445 static void PrintS(int message)
446 {
447 PrintS(message.ToString());
448 }
449
450 static void PrintS(float message)
451 {
452 PrintS(message.ToString());
453 }
454
455 static void PrintS(vector message)
456 {
457 PrintS(message.ToString());
458 }
459
460 static void PrintS(Object message)
461 {
462 PrintS(message.ToString());
463 }
464
465
466 void Add(string message, bool isReload = false)
467 {
468 if (message != string.Empty)
469 {
471 {
472 if (!isReload)
475 m_ScriptOutputListbox.EnsureVisible(m_ScriptOutputListbox.GetNumItems());
476 }
477 }
478 }
479
480 protected void Clear(bool clearFile = false)
481 {
482 if(clearFile)
484 m_ScriptOutputListbox.ClearItems();
485 }
486
487
488
489 protected void ReloadScriptOutput()
490 {
491 m_ScriptOutputListbox.ClearItems();
492 m_AllowScriptOutput = true;
493 foreach ( string s: m_ScriptOutputHistory)
494 {
495 Add(s, true);
496 }
497 m_AllowScriptOutput = false;
498 }
499
500 void HistoryBack()
501 {
502
504 }
505
506 void HistoryForward()
507 {
509 }
510
511 protected void RunEnscript()
512 {
513 #ifdef DEVELOPER
514 string code;
515 m_EnfScriptEdit.GetText(code);
516 string codeNoReplace = code;
518 m_AllowScriptOutput = true;
519 code.Replace("Print(","ScriptConsoleEnfScriptTab.PrintS(");
520 code.Replace("Print (","ScriptConsoleEnfScriptTab.PrintS(");
521 bool success = GetGame().ExecuteEnforceScript("void scConsMain() \n{\n" + code + "\n}\n", "scConsMain");
522 m_AllowScriptOutput = false;
524
527 #endif
528 }
529
530 protected void ColorRunButton(bool success)
531 {
532 if (success)
533 {
534 m_EnfScriptRun.SetColor(ARGB(255,0,255,0));
535 }
536 else
537 {
538 m_EnfScriptRun.SetColor(ARGB(255,255,0,0));
539 }
540 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(ResetRunButtonColor,600);
541 }
542
543 protected void ResetRunButtonColor()
544 {
545 m_EnfScriptRun.SetColor(m_RunColor);
546 }
547
548 protected void RunEnscriptServer()
549 {
550 string code;
551 m_EnfScriptEdit.GetText(code);
555 GetGame().RPCSingleParam(GetGame().GetPlayer(), ERPCs.DEV_RPC_SERVER_SCRIPT, CachedObjectsParams.PARAM1_STRING, true, GetGame().GetPlayer().GetIdentity());
556 }
557
558 protected void EnscriptHistoryBack()
559 {
560 int history_index;
561 if (m_EnfScriptEdit)
562 {
565 if (history_index > -1)
566 {
568 }
570 }
571 }
572
573
574 protected void EnscriptHistoryForward()
575 {
576 if (m_EnfScriptEdit)
577 {
578 int history_index;
582 {
584 }
586 }
587 }
588
589 override void OnRPCEx(int rpc_type, ParamsReadContext ctx)
590 {
591 super.OnRPCEx(rpc_type, ctx);
592 #ifdef DIAG_DEVELOPER
593 switch (rpc_type)
594 {
595 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
596 {
598 {
600 }
601 break;
602 }
603 }
604 #endif
605 }
606
607 override bool OnClick(Widget w, int x, int y, int button)
608 {
609 super.OnClick(w,x,y,button);
610 if (w == m_EnfScriptRun)
611 {
612 RunEnscript();
613 return true;
614 }
615 else if (w == m_EnfScriptClear)
616 {
617 m_ScriptOutputListbox.ClearItems();
618 m_ScriptOutputHistory.Clear();
619 return true;
620 }
621
622 return false;
623 }
624
625 override bool OnChange(Widget w, int x, int y, bool finished)
626 {
627 super.OnChange(w, x, y, finished);
628 return false;
629 }
630
631
632 override void Show(bool show, ScriptConsoleTabBase selectedHandler)
633 {
635 {
636 //do nothing
637 }
638 else
639 {
640 m_Root.Show(show);
641 m_Root.Enable(show);
642 }
643 }
644
645}
646
648{
649 override void OnSelected()
650 {
652 if (m_EnscriptConsoleHistoryServer.IsValidIndex(index))
653 {
655 m_EnfScriptEdit.SetText(text);
656 }
658 }
659
660 override protected void EnscriptHistoryBack()
661 {
662 int history_index;
663 if (m_EnfScriptEdit)
664 {
667 if (history_index > -1)
668 {
670 }
672 }
673 }
674
675 override protected void EnscriptHistoryForward()
676 {
677 if (m_EnfScriptEdit)
678 {
679 int history_index;
680
684 {
686 }
688 }
689 }
690
691 override bool OnClick(Widget w, int x, int y, int button)
692 {
693 if (w == m_EnfScriptRun)
694 {
696 return true;
697 }
698 else if (w == m_EnfScriptClear)
699 {
700 m_ScriptOutputListbox.ClearItems();
701 m_ScriptOutputHistory.Clear();
702 return true;
703 }
704
705 return false;
706 }
707
708}

◆ OnChange()

override bool OnChange ( Widget w,
int x,
int y,
bool finished )
protected
505{
506 protected static ScriptConsoleEnfScriptTab m_Instance;
507 protected int m_EnscriptHistoryRow;
508 protected int m_EnscriptHistoryRowServer;
517 protected bool m_AllowScriptOutput;
518 protected int m_RunColor;
519
521
523 {
524 m_Instance = this;
529 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget("MultilineEditBoxWidget0"));
530 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget("RunButton"));
531 m_EnfScriptClear = ButtonWidget.Cast(root.FindAnyWidget("ClearButton"));
532 m_ScriptOutputListbox = TextListboxWidget.Cast(root.FindAnyWidget("ScriptOutputListbox"));
533 m_RunColor = m_EnfScriptRun.GetColor();
534 }
535
537 {
539 }
540
541 override void OnSelected()
542 {
544 if (m_EnscriptConsoleHistory.IsValidIndex(index))
545 {
546 string text = m_EnscriptConsoleHistory.Get(index);
547 m_EnfScriptEdit.SetText(text);
548 }
550 }
551
552 static void PrintS(string message)
553 {
554 Print(message);
555 if (m_Instance)
556 m_Instance.Add(message);
557 }
558
559 static void PrintS(bool message)
560 {
561 PrintS(message.ToString());
562 }
563
564 static void PrintS(int message)
565 {
566 PrintS(message.ToString());
567 }
568
569 static void PrintS(float message)
570 {
571 PrintS(message.ToString());
572 }
573
574 static void PrintS(vector message)
575 {
576 PrintS(message.ToString());
577 }
578
579 static void PrintS(Object message)
580 {
581 PrintS(message.ToString());
582 }
583
584
585 void Add(string message, bool isReload = false)
586 {
587 if (message != string.Empty)
588 {
590 {
591 if (!isReload)
594 m_ScriptOutputListbox.EnsureVisible(m_ScriptOutputListbox.GetNumItems());
595 }
596 }
597 }
598
599 protected void Clear(bool clearFile = false)
600 {
601 if(clearFile)
603 m_ScriptOutputListbox.ClearItems();
604 }
605
606
607
608 protected void ReloadScriptOutput()
609 {
610 m_ScriptOutputListbox.ClearItems();
611 m_AllowScriptOutput = true;
612 foreach ( string s: m_ScriptOutputHistory)
613 {
614 Add(s, true);
615 }
616 m_AllowScriptOutput = false;
617 }
618
619 void HistoryBack()
620 {
621
623 }
624
625 void HistoryForward()
626 {
628 }
629
630 protected void RunEnscript()
631 {
632 #ifdef DEVELOPER
633 string code;
634 m_EnfScriptEdit.GetText(code);
635 string codeNoReplace = code;
637 m_AllowScriptOutput = true;
638 code.Replace("Print(","ScriptConsoleEnfScriptTab.PrintS(");
639 code.Replace("Print (","ScriptConsoleEnfScriptTab.PrintS(");
640 bool success = GetGame().ExecuteEnforceScript("void scConsMain() \n{\n" + code + "\n}\n", "scConsMain");
641 m_AllowScriptOutput = false;
643
646 #endif
647 }
648
649 protected void ColorRunButton(bool success)
650 {
651 if (success)
652 {
653 m_EnfScriptRun.SetColor(ARGB(255,0,255,0));
654 }
655 else
656 {
657 m_EnfScriptRun.SetColor(ARGB(255,255,0,0));
658 }
659 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(ResetRunButtonColor,600);
660 }
661
662 protected void ResetRunButtonColor()
663 {
664 m_EnfScriptRun.SetColor(m_RunColor);
665 }
666
667 protected void RunEnscriptServer()
668 {
669 string code;
670 m_EnfScriptEdit.GetText(code);
674 GetGame().RPCSingleParam(GetGame().GetPlayer(), ERPCs.DEV_RPC_SERVER_SCRIPT, CachedObjectsParams.PARAM1_STRING, true, GetGame().GetPlayer().GetIdentity());
675 }
676
677 protected void EnscriptHistoryBack()
678 {
679 int history_index;
680 if (m_EnfScriptEdit)
681 {
684 if (history_index > -1)
685 {
687 }
689 }
690 }
691
692
693 protected void EnscriptHistoryForward()
694 {
695 if (m_EnfScriptEdit)
696 {
697 int history_index;
701 {
703 }
705 }
706 }
707
708 override void OnRPCEx(int rpc_type, ParamsReadContext ctx)
709 {
710 super.OnRPCEx(rpc_type, ctx);
711 #ifdef DIAG_DEVELOPER
712 switch (rpc_type)
713 {
714 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
715 {
717 {
719 }
720 break;
721 }
722 }
723 #endif
724 }
725
726 override bool OnClick(Widget w, int x, int y, int button)
727 {
728 super.OnClick(w,x,y,button);
729 if (w == m_EnfScriptRun)
730 {
731 RunEnscript();
732 return true;
733 }
734 else if (w == m_EnfScriptClear)
735 {
736 m_ScriptOutputListbox.ClearItems();
737 m_ScriptOutputHistory.Clear();
738 return true;
739 }
740
741 return false;
742 }
743
744 override bool OnChange(Widget w, int x, int y, bool finished)
745 {
746 super.OnChange(w, x, y, finished);
747 return false;
748 }
749
750
751 override void Show(bool show, ScriptConsoleTabBase selectedHandler)
752 {
754 {
755 //do nothing
756 }
757 else
758 {
759 m_Root.Show(show);
760 m_Root.Enable(show);
761 }
762 }
763
764}
765
767{
768 override void OnSelected()
769 {
771 if (m_EnscriptConsoleHistoryServer.IsValidIndex(index))
772 {
774 m_EnfScriptEdit.SetText(text);
775 }
777 }
778
779 override protected void EnscriptHistoryBack()
780 {
781 int history_index;
782 if (m_EnfScriptEdit)
783 {
786 if (history_index > -1)
787 {
789 }
791 }
792 }
793
794 override protected void EnscriptHistoryForward()
795 {
796 if (m_EnfScriptEdit)
797 {
798 int history_index;
799
803 {
805 }
807 }
808 }
809
810 override bool OnClick(Widget w, int x, int y, int button)
811 {
812 if (w == m_EnfScriptRun)
813 {
815 return true;
816 }
817 else if (w == m_EnfScriptClear)
818 {
819 m_ScriptOutputListbox.ClearItems();
820 m_ScriptOutputHistory.Clear();
821 return true;
822 }
823
824 return false;
825 }
826
827}

◆ OnClick()

override bool OnClick ( Widget w,
int x,
int y,
int button )
protected
487{
488 protected static ScriptConsoleEnfScriptTab m_Instance;
489 protected int m_EnscriptHistoryRow;
490 protected int m_EnscriptHistoryRowServer;
499 protected bool m_AllowScriptOutput;
500 protected int m_RunColor;
501
503
505 {
506 m_Instance = this;
511 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget("MultilineEditBoxWidget0"));
512 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget("RunButton"));
513 m_EnfScriptClear = ButtonWidget.Cast(root.FindAnyWidget("ClearButton"));
514 m_ScriptOutputListbox = TextListboxWidget.Cast(root.FindAnyWidget("ScriptOutputListbox"));
515 m_RunColor = m_EnfScriptRun.GetColor();
516 }
517
519 {
521 }
522
523 override void OnSelected()
524 {
526 if (m_EnscriptConsoleHistory.IsValidIndex(index))
527 {
528 string text = m_EnscriptConsoleHistory.Get(index);
529 m_EnfScriptEdit.SetText(text);
530 }
532 }
533
534 static void PrintS(string message)
535 {
536 Print(message);
537 if (m_Instance)
538 m_Instance.Add(message);
539 }
540
541 static void PrintS(bool message)
542 {
543 PrintS(message.ToString());
544 }
545
546 static void PrintS(int message)
547 {
548 PrintS(message.ToString());
549 }
550
551 static void PrintS(float message)
552 {
553 PrintS(message.ToString());
554 }
555
556 static void PrintS(vector message)
557 {
558 PrintS(message.ToString());
559 }
560
561 static void PrintS(Object message)
562 {
563 PrintS(message.ToString());
564 }
565
566
567 void Add(string message, bool isReload = false)
568 {
569 if (message != string.Empty)
570 {
572 {
573 if (!isReload)
576 m_ScriptOutputListbox.EnsureVisible(m_ScriptOutputListbox.GetNumItems());
577 }
578 }
579 }
580
581 protected void Clear(bool clearFile = false)
582 {
583 if(clearFile)
585 m_ScriptOutputListbox.ClearItems();
586 }
587
588
589
590 protected void ReloadScriptOutput()
591 {
592 m_ScriptOutputListbox.ClearItems();
593 m_AllowScriptOutput = true;
594 foreach ( string s: m_ScriptOutputHistory)
595 {
596 Add(s, true);
597 }
598 m_AllowScriptOutput = false;
599 }
600
601 void HistoryBack()
602 {
603
605 }
606
607 void HistoryForward()
608 {
610 }
611
612 protected void RunEnscript()
613 {
614 #ifdef DEVELOPER
615 string code;
616 m_EnfScriptEdit.GetText(code);
617 string codeNoReplace = code;
619 m_AllowScriptOutput = true;
620 code.Replace("Print(","ScriptConsoleEnfScriptTab.PrintS(");
621 code.Replace("Print (","ScriptConsoleEnfScriptTab.PrintS(");
622 bool success = GetGame().ExecuteEnforceScript("void scConsMain() \n{\n" + code + "\n}\n", "scConsMain");
623 m_AllowScriptOutput = false;
625
628 #endif
629 }
630
631 protected void ColorRunButton(bool success)
632 {
633 if (success)
634 {
635 m_EnfScriptRun.SetColor(ARGB(255,0,255,0));
636 }
637 else
638 {
639 m_EnfScriptRun.SetColor(ARGB(255,255,0,0));
640 }
641 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(ResetRunButtonColor,600);
642 }
643
644 protected void ResetRunButtonColor()
645 {
646 m_EnfScriptRun.SetColor(m_RunColor);
647 }
648
649 protected void RunEnscriptServer()
650 {
651 string code;
652 m_EnfScriptEdit.GetText(code);
656 GetGame().RPCSingleParam(GetGame().GetPlayer(), ERPCs.DEV_RPC_SERVER_SCRIPT, CachedObjectsParams.PARAM1_STRING, true, GetGame().GetPlayer().GetIdentity());
657 }
658
659 protected void EnscriptHistoryBack()
660 {
661 int history_index;
662 if (m_EnfScriptEdit)
663 {
666 if (history_index > -1)
667 {
669 }
671 }
672 }
673
674
675 protected void EnscriptHistoryForward()
676 {
677 if (m_EnfScriptEdit)
678 {
679 int history_index;
683 {
685 }
687 }
688 }
689
690 override void OnRPCEx(int rpc_type, ParamsReadContext ctx)
691 {
692 super.OnRPCEx(rpc_type, ctx);
693 #ifdef DIAG_DEVELOPER
694 switch (rpc_type)
695 {
696 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
697 {
699 {
701 }
702 break;
703 }
704 }
705 #endif
706 }
707
708 override bool OnClick(Widget w, int x, int y, int button)
709 {
710 super.OnClick(w,x,y,button);
711 if (w == m_EnfScriptRun)
712 {
713 RunEnscript();
714 return true;
715 }
716 else if (w == m_EnfScriptClear)
717 {
718 m_ScriptOutputListbox.ClearItems();
719 m_ScriptOutputHistory.Clear();
720 return true;
721 }
722
723 return false;
724 }
725
726 override bool OnChange(Widget w, int x, int y, bool finished)
727 {
728 super.OnChange(w, x, y, finished);
729 return false;
730 }
731
732
733 override void Show(bool show, ScriptConsoleTabBase selectedHandler)
734 {
736 {
737 //do nothing
738 }
739 else
740 {
741 m_Root.Show(show);
742 m_Root.Enable(show);
743 }
744 }
745
746}
747
749{
750 override void OnSelected()
751 {
753 if (m_EnscriptConsoleHistoryServer.IsValidIndex(index))
754 {
756 m_EnfScriptEdit.SetText(text);
757 }
759 }
760
761 override protected void EnscriptHistoryBack()
762 {
763 int history_index;
764 if (m_EnfScriptEdit)
765 {
768 if (history_index > -1)
769 {
771 }
773 }
774 }
775
776 override protected void EnscriptHistoryForward()
777 {
778 if (m_EnfScriptEdit)
779 {
780 int history_index;
781
785 {
787 }
789 }
790 }
791
792 override bool OnClick(Widget w, int x, int y, int button)
793 {
794 if (w == m_EnfScriptRun)
795 {
797 return true;
798 }
799 else if (w == m_EnfScriptClear)
800 {
801 m_ScriptOutputListbox.ClearItems();
802 m_ScriptOutputHistory.Clear();
803 return true;
804 }
805
806 return false;
807 }
808
809}

◆ OnRPCEx()

override void OnRPCEx ( int rpc_type,
ParamsReadContext ctx )
protected
469{
470 protected static ScriptConsoleEnfScriptTab m_Instance;
471 protected int m_EnscriptHistoryRow;
472 protected int m_EnscriptHistoryRowServer;
481 protected bool m_AllowScriptOutput;
482 protected int m_RunColor;
483
485
487 {
488 m_Instance = this;
493 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget("MultilineEditBoxWidget0"));
494 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget("RunButton"));
495 m_EnfScriptClear = ButtonWidget.Cast(root.FindAnyWidget("ClearButton"));
496 m_ScriptOutputListbox = TextListboxWidget.Cast(root.FindAnyWidget("ScriptOutputListbox"));
497 m_RunColor = m_EnfScriptRun.GetColor();
498 }
499
501 {
503 }
504
505 override void OnSelected()
506 {
508 if (m_EnscriptConsoleHistory.IsValidIndex(index))
509 {
510 string text = m_EnscriptConsoleHistory.Get(index);
511 m_EnfScriptEdit.SetText(text);
512 }
514 }
515
516 static void PrintS(string message)
517 {
518 Print(message);
519 if (m_Instance)
520 m_Instance.Add(message);
521 }
522
523 static void PrintS(bool message)
524 {
525 PrintS(message.ToString());
526 }
527
528 static void PrintS(int message)
529 {
530 PrintS(message.ToString());
531 }
532
533 static void PrintS(float message)
534 {
535 PrintS(message.ToString());
536 }
537
538 static void PrintS(vector message)
539 {
540 PrintS(message.ToString());
541 }
542
543 static void PrintS(Object message)
544 {
545 PrintS(message.ToString());
546 }
547
548
549 void Add(string message, bool isReload = false)
550 {
551 if (message != string.Empty)
552 {
554 {
555 if (!isReload)
558 m_ScriptOutputListbox.EnsureVisible(m_ScriptOutputListbox.GetNumItems());
559 }
560 }
561 }
562
563 protected void Clear(bool clearFile = false)
564 {
565 if(clearFile)
567 m_ScriptOutputListbox.ClearItems();
568 }
569
570
571
572 protected void ReloadScriptOutput()
573 {
574 m_ScriptOutputListbox.ClearItems();
575 m_AllowScriptOutput = true;
576 foreach ( string s: m_ScriptOutputHistory)
577 {
578 Add(s, true);
579 }
580 m_AllowScriptOutput = false;
581 }
582
583 void HistoryBack()
584 {
585
587 }
588
589 void HistoryForward()
590 {
592 }
593
594 protected void RunEnscript()
595 {
596 #ifdef DEVELOPER
597 string code;
598 m_EnfScriptEdit.GetText(code);
599 string codeNoReplace = code;
601 m_AllowScriptOutput = true;
602 code.Replace("Print(","ScriptConsoleEnfScriptTab.PrintS(");
603 code.Replace("Print (","ScriptConsoleEnfScriptTab.PrintS(");
604 bool success = GetGame().ExecuteEnforceScript("void scConsMain() \n{\n" + code + "\n}\n", "scConsMain");
605 m_AllowScriptOutput = false;
607
610 #endif
611 }
612
613 protected void ColorRunButton(bool success)
614 {
615 if (success)
616 {
617 m_EnfScriptRun.SetColor(ARGB(255,0,255,0));
618 }
619 else
620 {
621 m_EnfScriptRun.SetColor(ARGB(255,255,0,0));
622 }
623 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(ResetRunButtonColor,600);
624 }
625
626 protected void ResetRunButtonColor()
627 {
628 m_EnfScriptRun.SetColor(m_RunColor);
629 }
630
631 protected void RunEnscriptServer()
632 {
633 string code;
634 m_EnfScriptEdit.GetText(code);
638 GetGame().RPCSingleParam(GetGame().GetPlayer(), ERPCs.DEV_RPC_SERVER_SCRIPT, CachedObjectsParams.PARAM1_STRING, true, GetGame().GetPlayer().GetIdentity());
639 }
640
641 protected void EnscriptHistoryBack()
642 {
643 int history_index;
644 if (m_EnfScriptEdit)
645 {
648 if (history_index > -1)
649 {
651 }
653 }
654 }
655
656
657 protected void EnscriptHistoryForward()
658 {
659 if (m_EnfScriptEdit)
660 {
661 int history_index;
665 {
667 }
669 }
670 }
671
672 override void OnRPCEx(int rpc_type, ParamsReadContext ctx)
673 {
674 super.OnRPCEx(rpc_type, ctx);
675 #ifdef DIAG_DEVELOPER
676 switch (rpc_type)
677 {
678 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
679 {
681 {
683 }
684 break;
685 }
686 }
687 #endif
688 }
689
690 override bool OnClick(Widget w, int x, int y, int button)
691 {
692 super.OnClick(w,x,y,button);
693 if (w == m_EnfScriptRun)
694 {
695 RunEnscript();
696 return true;
697 }
698 else if (w == m_EnfScriptClear)
699 {
700 m_ScriptOutputListbox.ClearItems();
701 m_ScriptOutputHistory.Clear();
702 return true;
703 }
704
705 return false;
706 }
707
708 override bool OnChange(Widget w, int x, int y, bool finished)
709 {
710 super.OnChange(w, x, y, finished);
711 return false;
712 }
713
714
715 override void Show(bool show, ScriptConsoleTabBase selectedHandler)
716 {
718 {
719 //do nothing
720 }
721 else
722 {
723 m_Root.Show(show);
724 m_Root.Enable(show);
725 }
726 }
727
728}
729
731{
732 override void OnSelected()
733 {
735 if (m_EnscriptConsoleHistoryServer.IsValidIndex(index))
736 {
738 m_EnfScriptEdit.SetText(text);
739 }
741 }
742
743 override protected void EnscriptHistoryBack()
744 {
745 int history_index;
746 if (m_EnfScriptEdit)
747 {
750 if (history_index > -1)
751 {
753 }
755 }
756 }
757
758 override protected void EnscriptHistoryForward()
759 {
760 if (m_EnfScriptEdit)
761 {
762 int history_index;
763
767 {
769 }
771 }
772 }
773
774 override bool OnClick(Widget w, int x, int y, int button)
775 {
776 if (w == m_EnfScriptRun)
777 {
779 return true;
780 }
781 else if (w == m_EnfScriptClear)
782 {
783 m_ScriptOutputListbox.ClearItems();
784 m_ScriptOutputHistory.Clear();
785 return true;
786 }
787
788 return false;
789 }
790
791}

◆ OnSelected()

override void OnSelected ( )
266 {
268 if (m_EnscriptConsoleHistoryServer.IsValidIndex(index))
269 {
271 m_EnfScriptEdit.SetText(text);
272 }
274 }

Используется в RecipeBase::OnSelectedRecipe().

◆ PrintS() [1/6]

static void PrintS ( bool message)
staticprotected

◆ PrintS() [2/6]

static void PrintS ( float message)
staticprotected
330{
331 protected static ScriptConsoleEnfScriptTab m_Instance;
332 protected int m_EnscriptHistoryRow;
333 protected int m_EnscriptHistoryRowServer;
342 protected bool m_AllowScriptOutput;
343 protected int m_RunColor;
344
346
348 {
349 m_Instance = this;
354 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget("MultilineEditBoxWidget0"));
355 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget("RunButton"));
356 m_EnfScriptClear = ButtonWidget.Cast(root.FindAnyWidget("ClearButton"));
357 m_ScriptOutputListbox = TextListboxWidget.Cast(root.FindAnyWidget("ScriptOutputListbox"));
358 m_RunColor = m_EnfScriptRun.GetColor();
359 }
360
362 {
364 }
365
366 override void OnSelected()
367 {
369 if (m_EnscriptConsoleHistory.IsValidIndex(index))
370 {
371 string text = m_EnscriptConsoleHistory.Get(index);
372 m_EnfScriptEdit.SetText(text);
373 }
375 }
376
377 static void PrintS(string message)
378 {
379 Print(message);
380 if (m_Instance)
381 m_Instance.Add(message);
382 }
383
384 static void PrintS(bool message)
385 {
386 PrintS(message.ToString());
387 }
388
389 static void PrintS(int message)
390 {
391 PrintS(message.ToString());
392 }
393
394 static void PrintS(float message)
395 {
396 PrintS(message.ToString());
397 }
398
399 static void PrintS(vector message)
400 {
401 PrintS(message.ToString());
402 }
403
404 static void PrintS(Object message)
405 {
406 PrintS(message.ToString());
407 }
408
409
410 void Add(string message, bool isReload = false)
411 {
412 if (message != string.Empty)
413 {
415 {
416 if (!isReload)
419 m_ScriptOutputListbox.EnsureVisible(m_ScriptOutputListbox.GetNumItems());
420 }
421 }
422 }
423
424 protected void Clear(bool clearFile = false)
425 {
426 if(clearFile)
428 m_ScriptOutputListbox.ClearItems();
429 }
430
431
432
433 protected void ReloadScriptOutput()
434 {
435 m_ScriptOutputListbox.ClearItems();
436 m_AllowScriptOutput = true;
437 foreach ( string s: m_ScriptOutputHistory)
438 {
439 Add(s, true);
440 }
441 m_AllowScriptOutput = false;
442 }
443
444 void HistoryBack()
445 {
446
448 }
449
450 void HistoryForward()
451 {
453 }
454
455 protected void RunEnscript()
456 {
457 #ifdef DEVELOPER
458 string code;
459 m_EnfScriptEdit.GetText(code);
460 string codeNoReplace = code;
462 m_AllowScriptOutput = true;
463 code.Replace("Print(","ScriptConsoleEnfScriptTab.PrintS(");
464 code.Replace("Print (","ScriptConsoleEnfScriptTab.PrintS(");
465 bool success = GetGame().ExecuteEnforceScript("void scConsMain() \n{\n" + code + "\n}\n", "scConsMain");
466 m_AllowScriptOutput = false;
468
471 #endif
472 }
473
474 protected void ColorRunButton(bool success)
475 {
476 if (success)
477 {
478 m_EnfScriptRun.SetColor(ARGB(255,0,255,0));
479 }
480 else
481 {
482 m_EnfScriptRun.SetColor(ARGB(255,255,0,0));
483 }
484 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(ResetRunButtonColor,600);
485 }
486
487 protected void ResetRunButtonColor()
488 {
489 m_EnfScriptRun.SetColor(m_RunColor);
490 }
491
492 protected void RunEnscriptServer()
493 {
494 string code;
495 m_EnfScriptEdit.GetText(code);
499 GetGame().RPCSingleParam(GetGame().GetPlayer(), ERPCs.DEV_RPC_SERVER_SCRIPT, CachedObjectsParams.PARAM1_STRING, true, GetGame().GetPlayer().GetIdentity());
500 }
501
502 protected void EnscriptHistoryBack()
503 {
504 int history_index;
505 if (m_EnfScriptEdit)
506 {
509 if (history_index > -1)
510 {
512 }
514 }
515 }
516
517
518 protected void EnscriptHistoryForward()
519 {
520 if (m_EnfScriptEdit)
521 {
522 int history_index;
526 {
528 }
530 }
531 }
532
533 override void OnRPCEx(int rpc_type, ParamsReadContext ctx)
534 {
535 super.OnRPCEx(rpc_type, ctx);
536 #ifdef DIAG_DEVELOPER
537 switch (rpc_type)
538 {
539 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
540 {
542 {
544 }
545 break;
546 }
547 }
548 #endif
549 }
550
551 override bool OnClick(Widget w, int x, int y, int button)
552 {
553 super.OnClick(w,x,y,button);
554 if (w == m_EnfScriptRun)
555 {
556 RunEnscript();
557 return true;
558 }
559 else if (w == m_EnfScriptClear)
560 {
561 m_ScriptOutputListbox.ClearItems();
562 m_ScriptOutputHistory.Clear();
563 return true;
564 }
565
566 return false;
567 }
568
569 override bool OnChange(Widget w, int x, int y, bool finished)
570 {
571 super.OnChange(w, x, y, finished);
572 return false;
573 }
574
575
576 override void Show(bool show, ScriptConsoleTabBase selectedHandler)
577 {
579 {
580 //do nothing
581 }
582 else
583 {
584 m_Root.Show(show);
585 m_Root.Enable(show);
586 }
587 }
588
589}
590
592{
593 override void OnSelected()
594 {
596 if (m_EnscriptConsoleHistoryServer.IsValidIndex(index))
597 {
599 m_EnfScriptEdit.SetText(text);
600 }
602 }
603
604 override protected void EnscriptHistoryBack()
605 {
606 int history_index;
607 if (m_EnfScriptEdit)
608 {
611 if (history_index > -1)
612 {
614 }
616 }
617 }
618
619 override protected void EnscriptHistoryForward()
620 {
621 if (m_EnfScriptEdit)
622 {
623 int history_index;
624
628 {
630 }
632 }
633 }
634
635 override bool OnClick(Widget w, int x, int y, int button)
636 {
637 if (w == m_EnfScriptRun)
638 {
640 return true;
641 }
642 else if (w == m_EnfScriptClear)
643 {
644 m_ScriptOutputListbox.ClearItems();
645 m_ScriptOutputHistory.Clear();
646 return true;
647 }
648
649 return false;
650 }
651
652}

◆ PrintS() [3/6]

static void PrintS ( int message)
staticprotected

◆ PrintS() [4/6]

static void PrintS ( Object message)
staticprotected
340{
341 protected static ScriptConsoleEnfScriptTab m_Instance;
342 protected int m_EnscriptHistoryRow;
343 protected int m_EnscriptHistoryRowServer;
352 protected bool m_AllowScriptOutput;
353 protected int m_RunColor;
354
356
358 {
359 m_Instance = this;
364 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget("MultilineEditBoxWidget0"));
365 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget("RunButton"));
366 m_EnfScriptClear = ButtonWidget.Cast(root.FindAnyWidget("ClearButton"));
367 m_ScriptOutputListbox = TextListboxWidget.Cast(root.FindAnyWidget("ScriptOutputListbox"));
368 m_RunColor = m_EnfScriptRun.GetColor();
369 }
370
372 {
374 }
375
376 override void OnSelected()
377 {
379 if (m_EnscriptConsoleHistory.IsValidIndex(index))
380 {
381 string text = m_EnscriptConsoleHistory.Get(index);
382 m_EnfScriptEdit.SetText(text);
383 }
385 }
386
387 static void PrintS(string message)
388 {
389 Print(message);
390 if (m_Instance)
391 m_Instance.Add(message);
392 }
393
394 static void PrintS(bool message)
395 {
396 PrintS(message.ToString());
397 }
398
399 static void PrintS(int message)
400 {
401 PrintS(message.ToString());
402 }
403
404 static void PrintS(float message)
405 {
406 PrintS(message.ToString());
407 }
408
409 static void PrintS(vector message)
410 {
411 PrintS(message.ToString());
412 }
413
414 static void PrintS(Object message)
415 {
416 PrintS(message.ToString());
417 }
418
419
420 void Add(string message, bool isReload = false)
421 {
422 if (message != string.Empty)
423 {
425 {
426 if (!isReload)
429 m_ScriptOutputListbox.EnsureVisible(m_ScriptOutputListbox.GetNumItems());
430 }
431 }
432 }
433
434 protected void Clear(bool clearFile = false)
435 {
436 if(clearFile)
438 m_ScriptOutputListbox.ClearItems();
439 }
440
441
442
443 protected void ReloadScriptOutput()
444 {
445 m_ScriptOutputListbox.ClearItems();
446 m_AllowScriptOutput = true;
447 foreach ( string s: m_ScriptOutputHistory)
448 {
449 Add(s, true);
450 }
451 m_AllowScriptOutput = false;
452 }
453
454 void HistoryBack()
455 {
456
458 }
459
460 void HistoryForward()
461 {
463 }
464
465 protected void RunEnscript()
466 {
467 #ifdef DEVELOPER
468 string code;
469 m_EnfScriptEdit.GetText(code);
470 string codeNoReplace = code;
472 m_AllowScriptOutput = true;
473 code.Replace("Print(","ScriptConsoleEnfScriptTab.PrintS(");
474 code.Replace("Print (","ScriptConsoleEnfScriptTab.PrintS(");
475 bool success = GetGame().ExecuteEnforceScript("void scConsMain() \n{\n" + code + "\n}\n", "scConsMain");
476 m_AllowScriptOutput = false;
478
481 #endif
482 }
483
484 protected void ColorRunButton(bool success)
485 {
486 if (success)
487 {
488 m_EnfScriptRun.SetColor(ARGB(255,0,255,0));
489 }
490 else
491 {
492 m_EnfScriptRun.SetColor(ARGB(255,255,0,0));
493 }
494 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(ResetRunButtonColor,600);
495 }
496
497 protected void ResetRunButtonColor()
498 {
499 m_EnfScriptRun.SetColor(m_RunColor);
500 }
501
502 protected void RunEnscriptServer()
503 {
504 string code;
505 m_EnfScriptEdit.GetText(code);
509 GetGame().RPCSingleParam(GetGame().GetPlayer(), ERPCs.DEV_RPC_SERVER_SCRIPT, CachedObjectsParams.PARAM1_STRING, true, GetGame().GetPlayer().GetIdentity());
510 }
511
512 protected void EnscriptHistoryBack()
513 {
514 int history_index;
515 if (m_EnfScriptEdit)
516 {
519 if (history_index > -1)
520 {
522 }
524 }
525 }
526
527
528 protected void EnscriptHistoryForward()
529 {
530 if (m_EnfScriptEdit)
531 {
532 int history_index;
536 {
538 }
540 }
541 }
542
543 override void OnRPCEx(int rpc_type, ParamsReadContext ctx)
544 {
545 super.OnRPCEx(rpc_type, ctx);
546 #ifdef DIAG_DEVELOPER
547 switch (rpc_type)
548 {
549 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
550 {
552 {
554 }
555 break;
556 }
557 }
558 #endif
559 }
560
561 override bool OnClick(Widget w, int x, int y, int button)
562 {
563 super.OnClick(w,x,y,button);
564 if (w == m_EnfScriptRun)
565 {
566 RunEnscript();
567 return true;
568 }
569 else if (w == m_EnfScriptClear)
570 {
571 m_ScriptOutputListbox.ClearItems();
572 m_ScriptOutputHistory.Clear();
573 return true;
574 }
575
576 return false;
577 }
578
579 override bool OnChange(Widget w, int x, int y, bool finished)
580 {
581 super.OnChange(w, x, y, finished);
582 return false;
583 }
584
585
586 override void Show(bool show, ScriptConsoleTabBase selectedHandler)
587 {
589 {
590 //do nothing
591 }
592 else
593 {
594 m_Root.Show(show);
595 m_Root.Enable(show);
596 }
597 }
598
599}
600
602{
603 override void OnSelected()
604 {
606 if (m_EnscriptConsoleHistoryServer.IsValidIndex(index))
607 {
609 m_EnfScriptEdit.SetText(text);
610 }
612 }
613
614 override protected void EnscriptHistoryBack()
615 {
616 int history_index;
617 if (m_EnfScriptEdit)
618 {
621 if (history_index > -1)
622 {
624 }
626 }
627 }
628
629 override protected void EnscriptHistoryForward()
630 {
631 if (m_EnfScriptEdit)
632 {
633 int history_index;
634
638 {
640 }
642 }
643 }
644
645 override bool OnClick(Widget w, int x, int y, int button)
646 {
647 if (w == m_EnfScriptRun)
648 {
650 return true;
651 }
652 else if (w == m_EnfScriptClear)
653 {
654 m_ScriptOutputListbox.ClearItems();
655 m_ScriptOutputHistory.Clear();
656 return true;
657 }
658
659 return false;
660 }
661
662}

◆ PrintS() [5/6]

static void PrintS ( string message)
staticprotected
315 {
316 m_ScriptOutputListbox.ClearItems();
317 m_ScriptOutputHistory.Clear();

◆ PrintS() [6/6]

static void PrintS ( vector message)
staticprotected
335{
336 protected static ScriptConsoleEnfScriptTab m_Instance;
337 protected int m_EnscriptHistoryRow;
338 protected int m_EnscriptHistoryRowServer;
347 protected bool m_AllowScriptOutput;
348 protected int m_RunColor;
349
351
353 {
354 m_Instance = this;
359 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget("MultilineEditBoxWidget0"));
360 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget("RunButton"));
361 m_EnfScriptClear = ButtonWidget.Cast(root.FindAnyWidget("ClearButton"));
362 m_ScriptOutputListbox = TextListboxWidget.Cast(root.FindAnyWidget("ScriptOutputListbox"));
363 m_RunColor = m_EnfScriptRun.GetColor();
364 }
365
367 {
369 }
370
371 override void OnSelected()
372 {
374 if (m_EnscriptConsoleHistory.IsValidIndex(index))
375 {
376 string text = m_EnscriptConsoleHistory.Get(index);
377 m_EnfScriptEdit.SetText(text);
378 }
380 }
381
382 static void PrintS(string message)
383 {
384 Print(message);
385 if (m_Instance)
386 m_Instance.Add(message);
387 }
388
389 static void PrintS(bool message)
390 {
391 PrintS(message.ToString());
392 }
393
394 static void PrintS(int message)
395 {
396 PrintS(message.ToString());
397 }
398
399 static void PrintS(float message)
400 {
401 PrintS(message.ToString());
402 }
403
404 static void PrintS(vector message)
405 {
406 PrintS(message.ToString());
407 }
408
409 static void PrintS(Object message)
410 {
411 PrintS(message.ToString());
412 }
413
414
415 void Add(string message, bool isReload = false)
416 {
417 if (message != string.Empty)
418 {
420 {
421 if (!isReload)
424 m_ScriptOutputListbox.EnsureVisible(m_ScriptOutputListbox.GetNumItems());
425 }
426 }
427 }
428
429 protected void Clear(bool clearFile = false)
430 {
431 if(clearFile)
433 m_ScriptOutputListbox.ClearItems();
434 }
435
436
437
438 protected void ReloadScriptOutput()
439 {
440 m_ScriptOutputListbox.ClearItems();
441 m_AllowScriptOutput = true;
442 foreach ( string s: m_ScriptOutputHistory)
443 {
444 Add(s, true);
445 }
446 m_AllowScriptOutput = false;
447 }
448
449 void HistoryBack()
450 {
451
453 }
454
455 void HistoryForward()
456 {
458 }
459
460 protected void RunEnscript()
461 {
462 #ifdef DEVELOPER
463 string code;
464 m_EnfScriptEdit.GetText(code);
465 string codeNoReplace = code;
467 m_AllowScriptOutput = true;
468 code.Replace("Print(","ScriptConsoleEnfScriptTab.PrintS(");
469 code.Replace("Print (","ScriptConsoleEnfScriptTab.PrintS(");
470 bool success = GetGame().ExecuteEnforceScript("void scConsMain() \n{\n" + code + "\n}\n", "scConsMain");
471 m_AllowScriptOutput = false;
473
476 #endif
477 }
478
479 protected void ColorRunButton(bool success)
480 {
481 if (success)
482 {
483 m_EnfScriptRun.SetColor(ARGB(255,0,255,0));
484 }
485 else
486 {
487 m_EnfScriptRun.SetColor(ARGB(255,255,0,0));
488 }
489 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(ResetRunButtonColor,600);
490 }
491
492 protected void ResetRunButtonColor()
493 {
494 m_EnfScriptRun.SetColor(m_RunColor);
495 }
496
497 protected void RunEnscriptServer()
498 {
499 string code;
500 m_EnfScriptEdit.GetText(code);
504 GetGame().RPCSingleParam(GetGame().GetPlayer(), ERPCs.DEV_RPC_SERVER_SCRIPT, CachedObjectsParams.PARAM1_STRING, true, GetGame().GetPlayer().GetIdentity());
505 }
506
507 protected void EnscriptHistoryBack()
508 {
509 int history_index;
510 if (m_EnfScriptEdit)
511 {
514 if (history_index > -1)
515 {
517 }
519 }
520 }
521
522
523 protected void EnscriptHistoryForward()
524 {
525 if (m_EnfScriptEdit)
526 {
527 int history_index;
531 {
533 }
535 }
536 }
537
538 override void OnRPCEx(int rpc_type, ParamsReadContext ctx)
539 {
540 super.OnRPCEx(rpc_type, ctx);
541 #ifdef DIAG_DEVELOPER
542 switch (rpc_type)
543 {
544 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
545 {
547 {
549 }
550 break;
551 }
552 }
553 #endif
554 }
555
556 override bool OnClick(Widget w, int x, int y, int button)
557 {
558 super.OnClick(w,x,y,button);
559 if (w == m_EnfScriptRun)
560 {
561 RunEnscript();
562 return true;
563 }
564 else if (w == m_EnfScriptClear)
565 {
566 m_ScriptOutputListbox.ClearItems();
567 m_ScriptOutputHistory.Clear();
568 return true;
569 }
570
571 return false;
572 }
573
574 override bool OnChange(Widget w, int x, int y, bool finished)
575 {
576 super.OnChange(w, x, y, finished);
577 return false;
578 }
579
580
581 override void Show(bool show, ScriptConsoleTabBase selectedHandler)
582 {
584 {
585 //do nothing
586 }
587 else
588 {
589 m_Root.Show(show);
590 m_Root.Enable(show);
591 }
592 }
593
594}
595
597{
598 override void OnSelected()
599 {
601 if (m_EnscriptConsoleHistoryServer.IsValidIndex(index))
602 {
604 m_EnfScriptEdit.SetText(text);
605 }
607 }
608
609 override protected void EnscriptHistoryBack()
610 {
611 int history_index;
612 if (m_EnfScriptEdit)
613 {
616 if (history_index > -1)
617 {
619 }
621 }
622 }
623
624 override protected void EnscriptHistoryForward()
625 {
626 if (m_EnfScriptEdit)
627 {
628 int history_index;
629
633 {
635 }
637 }
638 }
639
640 override bool OnClick(Widget w, int x, int y, int button)
641 {
642 if (w == m_EnfScriptRun)
643 {
645 return true;
646 }
647 else if (w == m_EnfScriptClear)
648 {
649 m_ScriptOutputListbox.ClearItems();
650 m_ScriptOutputHistory.Clear();
651 return true;
652 }
653
654 return false;
655 }
656
657}

◆ ReloadScriptOutput()

void ReloadScriptOutput ( )
protected
369{
370 protected static ScriptConsoleEnfScriptTab m_Instance;
371 protected int m_EnscriptHistoryRow;
372 protected int m_EnscriptHistoryRowServer;
381 protected bool m_AllowScriptOutput;
382 protected int m_RunColor;
383
385
387 {
388 m_Instance = this;
393 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget("MultilineEditBoxWidget0"));
394 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget("RunButton"));
395 m_EnfScriptClear = ButtonWidget.Cast(root.FindAnyWidget("ClearButton"));
396 m_ScriptOutputListbox = TextListboxWidget.Cast(root.FindAnyWidget("ScriptOutputListbox"));
397 m_RunColor = m_EnfScriptRun.GetColor();
398 }
399
401 {
403 }
404
405 override void OnSelected()
406 {
408 if (m_EnscriptConsoleHistory.IsValidIndex(index))
409 {
410 string text = m_EnscriptConsoleHistory.Get(index);
411 m_EnfScriptEdit.SetText(text);
412 }
414 }
415
416 static void PrintS(string message)
417 {
418 Print(message);
419 if (m_Instance)
420 m_Instance.Add(message);
421 }
422
423 static void PrintS(bool message)
424 {
425 PrintS(message.ToString());
426 }
427
428 static void PrintS(int message)
429 {
430 PrintS(message.ToString());
431 }
432
433 static void PrintS(float message)
434 {
435 PrintS(message.ToString());
436 }
437
438 static void PrintS(vector message)
439 {
440 PrintS(message.ToString());
441 }
442
443 static void PrintS(Object message)
444 {
445 PrintS(message.ToString());
446 }
447
448
449 void Add(string message, bool isReload = false)
450 {
451 if (message != string.Empty)
452 {
454 {
455 if (!isReload)
458 m_ScriptOutputListbox.EnsureVisible(m_ScriptOutputListbox.GetNumItems());
459 }
460 }
461 }
462
463 protected void Clear(bool clearFile = false)
464 {
465 if(clearFile)
467 m_ScriptOutputListbox.ClearItems();
468 }
469
470
471
472 protected void ReloadScriptOutput()
473 {
474 m_ScriptOutputListbox.ClearItems();
475 m_AllowScriptOutput = true;
476 foreach ( string s: m_ScriptOutputHistory)
477 {
478 Add(s, true);
479 }
480 m_AllowScriptOutput = false;
481 }
482
483 void HistoryBack()
484 {
485
487 }
488
489 void HistoryForward()
490 {
492 }
493
494 protected void RunEnscript()
495 {
496 #ifdef DEVELOPER
497 string code;
498 m_EnfScriptEdit.GetText(code);
499 string codeNoReplace = code;
501 m_AllowScriptOutput = true;
502 code.Replace("Print(","ScriptConsoleEnfScriptTab.PrintS(");
503 code.Replace("Print (","ScriptConsoleEnfScriptTab.PrintS(");
504 bool success = GetGame().ExecuteEnforceScript("void scConsMain() \n{\n" + code + "\n}\n", "scConsMain");
505 m_AllowScriptOutput = false;
507
510 #endif
511 }
512
513 protected void ColorRunButton(bool success)
514 {
515 if (success)
516 {
517 m_EnfScriptRun.SetColor(ARGB(255,0,255,0));
518 }
519 else
520 {
521 m_EnfScriptRun.SetColor(ARGB(255,255,0,0));
522 }
523 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(ResetRunButtonColor,600);
524 }
525
526 protected void ResetRunButtonColor()
527 {
528 m_EnfScriptRun.SetColor(m_RunColor);
529 }
530
531 protected void RunEnscriptServer()
532 {
533 string code;
534 m_EnfScriptEdit.GetText(code);
538 GetGame().RPCSingleParam(GetGame().GetPlayer(), ERPCs.DEV_RPC_SERVER_SCRIPT, CachedObjectsParams.PARAM1_STRING, true, GetGame().GetPlayer().GetIdentity());
539 }
540
541 protected void EnscriptHistoryBack()
542 {
543 int history_index;
544 if (m_EnfScriptEdit)
545 {
548 if (history_index > -1)
549 {
551 }
553 }
554 }
555
556
557 protected void EnscriptHistoryForward()
558 {
559 if (m_EnfScriptEdit)
560 {
561 int history_index;
565 {
567 }
569 }
570 }
571
572 override void OnRPCEx(int rpc_type, ParamsReadContext ctx)
573 {
574 super.OnRPCEx(rpc_type, ctx);
575 #ifdef DIAG_DEVELOPER
576 switch (rpc_type)
577 {
578 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
579 {
581 {
583 }
584 break;
585 }
586 }
587 #endif
588 }
589
590 override bool OnClick(Widget w, int x, int y, int button)
591 {
592 super.OnClick(w,x,y,button);
593 if (w == m_EnfScriptRun)
594 {
595 RunEnscript();
596 return true;
597 }
598 else if (w == m_EnfScriptClear)
599 {
600 m_ScriptOutputListbox.ClearItems();
601 m_ScriptOutputHistory.Clear();
602 return true;
603 }
604
605 return false;
606 }
607
608 override bool OnChange(Widget w, int x, int y, bool finished)
609 {
610 super.OnChange(w, x, y, finished);
611 return false;
612 }
613
614
615 override void Show(bool show, ScriptConsoleTabBase selectedHandler)
616 {
618 {
619 //do nothing
620 }
621 else
622 {
623 m_Root.Show(show);
624 m_Root.Enable(show);
625 }
626 }
627
628}
629
631{
632 override void OnSelected()
633 {
635 if (m_EnscriptConsoleHistoryServer.IsValidIndex(index))
636 {
638 m_EnfScriptEdit.SetText(text);
639 }
641 }
642
643 override protected void EnscriptHistoryBack()
644 {
645 int history_index;
646 if (m_EnfScriptEdit)
647 {
650 if (history_index > -1)
651 {
653 }
655 }
656 }
657
658 override protected void EnscriptHistoryForward()
659 {
660 if (m_EnfScriptEdit)
661 {
662 int history_index;
663
667 {
669 }
671 }
672 }
673
674 override bool OnClick(Widget w, int x, int y, int button)
675 {
676 if (w == m_EnfScriptRun)
677 {
679 return true;
680 }
681 else if (w == m_EnfScriptClear)
682 {
683 m_ScriptOutputListbox.ClearItems();
684 m_ScriptOutputHistory.Clear();
685 return true;
686 }
687
688 return false;
689 }
690
691}

◆ ResetRunButtonColor()

void ResetRunButtonColor ( )
protected
423{
424 protected static ScriptConsoleEnfScriptTab m_Instance;
425 protected int m_EnscriptHistoryRow;
426 protected int m_EnscriptHistoryRowServer;
435 protected bool m_AllowScriptOutput;
436 protected int m_RunColor;
437
439
441 {
442 m_Instance = this;
447 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget("MultilineEditBoxWidget0"));
448 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget("RunButton"));
449 m_EnfScriptClear = ButtonWidget.Cast(root.FindAnyWidget("ClearButton"));
450 m_ScriptOutputListbox = TextListboxWidget.Cast(root.FindAnyWidget("ScriptOutputListbox"));
451 m_RunColor = m_EnfScriptRun.GetColor();
452 }
453
455 {
457 }
458
459 override void OnSelected()
460 {
462 if (m_EnscriptConsoleHistory.IsValidIndex(index))
463 {
464 string text = m_EnscriptConsoleHistory.Get(index);
465 m_EnfScriptEdit.SetText(text);
466 }
468 }
469
470 static void PrintS(string message)
471 {
472 Print(message);
473 if (m_Instance)
474 m_Instance.Add(message);
475 }
476
477 static void PrintS(bool message)
478 {
479 PrintS(message.ToString());
480 }
481
482 static void PrintS(int message)
483 {
484 PrintS(message.ToString());
485 }
486
487 static void PrintS(float message)
488 {
489 PrintS(message.ToString());
490 }
491
492 static void PrintS(vector message)
493 {
494 PrintS(message.ToString());
495 }
496
497 static void PrintS(Object message)
498 {
499 PrintS(message.ToString());
500 }
501
502
503 void Add(string message, bool isReload = false)
504 {
505 if (message != string.Empty)
506 {
508 {
509 if (!isReload)
512 m_ScriptOutputListbox.EnsureVisible(m_ScriptOutputListbox.GetNumItems());
513 }
514 }
515 }
516
517 protected void Clear(bool clearFile = false)
518 {
519 if(clearFile)
521 m_ScriptOutputListbox.ClearItems();
522 }
523
524
525
526 protected void ReloadScriptOutput()
527 {
528 m_ScriptOutputListbox.ClearItems();
529 m_AllowScriptOutput = true;
530 foreach ( string s: m_ScriptOutputHistory)
531 {
532 Add(s, true);
533 }
534 m_AllowScriptOutput = false;
535 }
536
537 void HistoryBack()
538 {
539
541 }
542
543 void HistoryForward()
544 {
546 }
547
548 protected void RunEnscript()
549 {
550 #ifdef DEVELOPER
551 string code;
552 m_EnfScriptEdit.GetText(code);
553 string codeNoReplace = code;
555 m_AllowScriptOutput = true;
556 code.Replace("Print(","ScriptConsoleEnfScriptTab.PrintS(");
557 code.Replace("Print (","ScriptConsoleEnfScriptTab.PrintS(");
558 bool success = GetGame().ExecuteEnforceScript("void scConsMain() \n{\n" + code + "\n}\n", "scConsMain");
559 m_AllowScriptOutput = false;
561
564 #endif
565 }
566
567 protected void ColorRunButton(bool success)
568 {
569 if (success)
570 {
571 m_EnfScriptRun.SetColor(ARGB(255,0,255,0));
572 }
573 else
574 {
575 m_EnfScriptRun.SetColor(ARGB(255,255,0,0));
576 }
577 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(ResetRunButtonColor,600);
578 }
579
580 protected void ResetRunButtonColor()
581 {
582 m_EnfScriptRun.SetColor(m_RunColor);
583 }
584
585 protected void RunEnscriptServer()
586 {
587 string code;
588 m_EnfScriptEdit.GetText(code);
592 GetGame().RPCSingleParam(GetGame().GetPlayer(), ERPCs.DEV_RPC_SERVER_SCRIPT, CachedObjectsParams.PARAM1_STRING, true, GetGame().GetPlayer().GetIdentity());
593 }
594
595 protected void EnscriptHistoryBack()
596 {
597 int history_index;
598 if (m_EnfScriptEdit)
599 {
602 if (history_index > -1)
603 {
605 }
607 }
608 }
609
610
611 protected void EnscriptHistoryForward()
612 {
613 if (m_EnfScriptEdit)
614 {
615 int history_index;
619 {
621 }
623 }
624 }
625
626 override void OnRPCEx(int rpc_type, ParamsReadContext ctx)
627 {
628 super.OnRPCEx(rpc_type, ctx);
629 #ifdef DIAG_DEVELOPER
630 switch (rpc_type)
631 {
632 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
633 {
635 {
637 }
638 break;
639 }
640 }
641 #endif
642 }
643
644 override bool OnClick(Widget w, int x, int y, int button)
645 {
646 super.OnClick(w,x,y,button);
647 if (w == m_EnfScriptRun)
648 {
649 RunEnscript();
650 return true;
651 }
652 else if (w == m_EnfScriptClear)
653 {
654 m_ScriptOutputListbox.ClearItems();
655 m_ScriptOutputHistory.Clear();
656 return true;
657 }
658
659 return false;
660 }
661
662 override bool OnChange(Widget w, int x, int y, bool finished)
663 {
664 super.OnChange(w, x, y, finished);
665 return false;
666 }
667
668
669 override void Show(bool show, ScriptConsoleTabBase selectedHandler)
670 {
672 {
673 //do nothing
674 }
675 else
676 {
677 m_Root.Show(show);
678 m_Root.Enable(show);
679 }
680 }
681
682}
683
685{
686 override void OnSelected()
687 {
689 if (m_EnscriptConsoleHistoryServer.IsValidIndex(index))
690 {
692 m_EnfScriptEdit.SetText(text);
693 }
695 }
696
697 override protected void EnscriptHistoryBack()
698 {
699 int history_index;
700 if (m_EnfScriptEdit)
701 {
704 if (history_index > -1)
705 {
707 }
709 }
710 }
711
712 override protected void EnscriptHistoryForward()
713 {
714 if (m_EnfScriptEdit)
715 {
716 int history_index;
717
721 {
723 }
725 }
726 }
727
728 override bool OnClick(Widget w, int x, int y, int button)
729 {
730 if (w == m_EnfScriptRun)
731 {
733 return true;
734 }
735 else if (w == m_EnfScriptClear)
736 {
737 m_ScriptOutputListbox.ClearItems();
738 m_ScriptOutputHistory.Clear();
739 return true;
740 }
741
742 return false;
743 }
744
745}

◆ RunEnscript()

void RunEnscript ( )
protected
391{
392 protected static ScriptConsoleEnfScriptTab m_Instance;
393 protected int m_EnscriptHistoryRow;
394 protected int m_EnscriptHistoryRowServer;
403 protected bool m_AllowScriptOutput;
404 protected int m_RunColor;
405
407
409 {
410 m_Instance = this;
415 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget("MultilineEditBoxWidget0"));
416 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget("RunButton"));
417 m_EnfScriptClear = ButtonWidget.Cast(root.FindAnyWidget("ClearButton"));
418 m_ScriptOutputListbox = TextListboxWidget.Cast(root.FindAnyWidget("ScriptOutputListbox"));
419 m_RunColor = m_EnfScriptRun.GetColor();
420 }
421
423 {
425 }
426
427 override void OnSelected()
428 {
430 if (m_EnscriptConsoleHistory.IsValidIndex(index))
431 {
432 string text = m_EnscriptConsoleHistory.Get(index);
433 m_EnfScriptEdit.SetText(text);
434 }
436 }
437
438 static void PrintS(string message)
439 {
440 Print(message);
441 if (m_Instance)
442 m_Instance.Add(message);
443 }
444
445 static void PrintS(bool message)
446 {
447 PrintS(message.ToString());
448 }
449
450 static void PrintS(int message)
451 {
452 PrintS(message.ToString());
453 }
454
455 static void PrintS(float message)
456 {
457 PrintS(message.ToString());
458 }
459
460 static void PrintS(vector message)
461 {
462 PrintS(message.ToString());
463 }
464
465 static void PrintS(Object message)
466 {
467 PrintS(message.ToString());
468 }
469
470
471 void Add(string message, bool isReload = false)
472 {
473 if (message != string.Empty)
474 {
476 {
477 if (!isReload)
480 m_ScriptOutputListbox.EnsureVisible(m_ScriptOutputListbox.GetNumItems());
481 }
482 }
483 }
484
485 protected void Clear(bool clearFile = false)
486 {
487 if(clearFile)
489 m_ScriptOutputListbox.ClearItems();
490 }
491
492
493
494 protected void ReloadScriptOutput()
495 {
496 m_ScriptOutputListbox.ClearItems();
497 m_AllowScriptOutput = true;
498 foreach ( string s: m_ScriptOutputHistory)
499 {
500 Add(s, true);
501 }
502 m_AllowScriptOutput = false;
503 }
504
505 void HistoryBack()
506 {
507
509 }
510
511 void HistoryForward()
512 {
514 }
515
516 protected void RunEnscript()
517 {
518 #ifdef DEVELOPER
519 string code;
520 m_EnfScriptEdit.GetText(code);
521 string codeNoReplace = code;
523 m_AllowScriptOutput = true;
524 code.Replace("Print(","ScriptConsoleEnfScriptTab.PrintS(");
525 code.Replace("Print (","ScriptConsoleEnfScriptTab.PrintS(");
526 bool success = GetGame().ExecuteEnforceScript("void scConsMain() \n{\n" + code + "\n}\n", "scConsMain");
527 m_AllowScriptOutput = false;
529
532 #endif
533 }
534
535 protected void ColorRunButton(bool success)
536 {
537 if (success)
538 {
539 m_EnfScriptRun.SetColor(ARGB(255,0,255,0));
540 }
541 else
542 {
543 m_EnfScriptRun.SetColor(ARGB(255,255,0,0));
544 }
545 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(ResetRunButtonColor,600);
546 }
547
548 protected void ResetRunButtonColor()
549 {
550 m_EnfScriptRun.SetColor(m_RunColor);
551 }
552
553 protected void RunEnscriptServer()
554 {
555 string code;
556 m_EnfScriptEdit.GetText(code);
560 GetGame().RPCSingleParam(GetGame().GetPlayer(), ERPCs.DEV_RPC_SERVER_SCRIPT, CachedObjectsParams.PARAM1_STRING, true, GetGame().GetPlayer().GetIdentity());
561 }
562
563 protected void EnscriptHistoryBack()
564 {
565 int history_index;
566 if (m_EnfScriptEdit)
567 {
570 if (history_index > -1)
571 {
573 }
575 }
576 }
577
578
579 protected void EnscriptHistoryForward()
580 {
581 if (m_EnfScriptEdit)
582 {
583 int history_index;
587 {
589 }
591 }
592 }
593
594 override void OnRPCEx(int rpc_type, ParamsReadContext ctx)
595 {
596 super.OnRPCEx(rpc_type, ctx);
597 #ifdef DIAG_DEVELOPER
598 switch (rpc_type)
599 {
600 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
601 {
603 {
605 }
606 break;
607 }
608 }
609 #endif
610 }
611
612 override bool OnClick(Widget w, int x, int y, int button)
613 {
614 super.OnClick(w,x,y,button);
615 if (w == m_EnfScriptRun)
616 {
617 RunEnscript();
618 return true;
619 }
620 else if (w == m_EnfScriptClear)
621 {
622 m_ScriptOutputListbox.ClearItems();
623 m_ScriptOutputHistory.Clear();
624 return true;
625 }
626
627 return false;
628 }
629
630 override bool OnChange(Widget w, int x, int y, bool finished)
631 {
632 super.OnChange(w, x, y, finished);
633 return false;
634 }
635
636
637 override void Show(bool show, ScriptConsoleTabBase selectedHandler)
638 {
640 {
641 //do nothing
642 }
643 else
644 {
645 m_Root.Show(show);
646 m_Root.Enable(show);
647 }
648 }
649
650}
651
653{
654 override void OnSelected()
655 {
657 if (m_EnscriptConsoleHistoryServer.IsValidIndex(index))
658 {
660 m_EnfScriptEdit.SetText(text);
661 }
663 }
664
665 override protected void EnscriptHistoryBack()
666 {
667 int history_index;
668 if (m_EnfScriptEdit)
669 {
672 if (history_index > -1)
673 {
675 }
677 }
678 }
679
680 override protected void EnscriptHistoryForward()
681 {
682 if (m_EnfScriptEdit)
683 {
684 int history_index;
685
689 {
691 }
693 }
694 }
695
696 override bool OnClick(Widget w, int x, int y, int button)
697 {
698 if (w == m_EnfScriptRun)
699 {
701 return true;
702 }
703 else if (w == m_EnfScriptClear)
704 {
705 m_ScriptOutputListbox.ClearItems();
706 m_ScriptOutputHistory.Clear();
707 return true;
708 }
709
710 return false;
711 }
712
713}

◆ RunEnscriptServer()

void RunEnscriptServer ( )
protected
428{
429 protected static ScriptConsoleEnfScriptTab m_Instance;
430 protected int m_EnscriptHistoryRow;
431 protected int m_EnscriptHistoryRowServer;
440 protected bool m_AllowScriptOutput;
441 protected int m_RunColor;
442
444
446 {
447 m_Instance = this;
452 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget("MultilineEditBoxWidget0"));
453 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget("RunButton"));
454 m_EnfScriptClear = ButtonWidget.Cast(root.FindAnyWidget("ClearButton"));
455 m_ScriptOutputListbox = TextListboxWidget.Cast(root.FindAnyWidget("ScriptOutputListbox"));
456 m_RunColor = m_EnfScriptRun.GetColor();
457 }
458
460 {
462 }
463
464 override void OnSelected()
465 {
467 if (m_EnscriptConsoleHistory.IsValidIndex(index))
468 {
469 string text = m_EnscriptConsoleHistory.Get(index);
470 m_EnfScriptEdit.SetText(text);
471 }
473 }
474
475 static void PrintS(string message)
476 {
477 Print(message);
478 if (m_Instance)
479 m_Instance.Add(message);
480 }
481
482 static void PrintS(bool message)
483 {
484 PrintS(message.ToString());
485 }
486
487 static void PrintS(int message)
488 {
489 PrintS(message.ToString());
490 }
491
492 static void PrintS(float message)
493 {
494 PrintS(message.ToString());
495 }
496
497 static void PrintS(vector message)
498 {
499 PrintS(message.ToString());
500 }
501
502 static void PrintS(Object message)
503 {
504 PrintS(message.ToString());
505 }
506
507
508 void Add(string message, bool isReload = false)
509 {
510 if (message != string.Empty)
511 {
513 {
514 if (!isReload)
517 m_ScriptOutputListbox.EnsureVisible(m_ScriptOutputListbox.GetNumItems());
518 }
519 }
520 }
521
522 protected void Clear(bool clearFile = false)
523 {
524 if(clearFile)
526 m_ScriptOutputListbox.ClearItems();
527 }
528
529
530
531 protected void ReloadScriptOutput()
532 {
533 m_ScriptOutputListbox.ClearItems();
534 m_AllowScriptOutput = true;
535 foreach ( string s: m_ScriptOutputHistory)
536 {
537 Add(s, true);
538 }
539 m_AllowScriptOutput = false;
540 }
541
542 void HistoryBack()
543 {
544
546 }
547
548 void HistoryForward()
549 {
551 }
552
553 protected void RunEnscript()
554 {
555 #ifdef DEVELOPER
556 string code;
557 m_EnfScriptEdit.GetText(code);
558 string codeNoReplace = code;
560 m_AllowScriptOutput = true;
561 code.Replace("Print(","ScriptConsoleEnfScriptTab.PrintS(");
562 code.Replace("Print (","ScriptConsoleEnfScriptTab.PrintS(");
563 bool success = GetGame().ExecuteEnforceScript("void scConsMain() \n{\n" + code + "\n}\n", "scConsMain");
564 m_AllowScriptOutput = false;
566
569 #endif
570 }
571
572 protected void ColorRunButton(bool success)
573 {
574 if (success)
575 {
576 m_EnfScriptRun.SetColor(ARGB(255,0,255,0));
577 }
578 else
579 {
580 m_EnfScriptRun.SetColor(ARGB(255,255,0,0));
581 }
582 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(ResetRunButtonColor,600);
583 }
584
585 protected void ResetRunButtonColor()
586 {
587 m_EnfScriptRun.SetColor(m_RunColor);
588 }
589
590 protected void RunEnscriptServer()
591 {
592 string code;
593 m_EnfScriptEdit.GetText(code);
597 GetGame().RPCSingleParam(GetGame().GetPlayer(), ERPCs.DEV_RPC_SERVER_SCRIPT, CachedObjectsParams.PARAM1_STRING, true, GetGame().GetPlayer().GetIdentity());
598 }
599
600 protected void EnscriptHistoryBack()
601 {
602 int history_index;
603 if (m_EnfScriptEdit)
604 {
607 if (history_index > -1)
608 {
610 }
612 }
613 }
614
615
616 protected void EnscriptHistoryForward()
617 {
618 if (m_EnfScriptEdit)
619 {
620 int history_index;
624 {
626 }
628 }
629 }
630
631 override void OnRPCEx(int rpc_type, ParamsReadContext ctx)
632 {
633 super.OnRPCEx(rpc_type, ctx);
634 #ifdef DIAG_DEVELOPER
635 switch (rpc_type)
636 {
637 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
638 {
640 {
642 }
643 break;
644 }
645 }
646 #endif
647 }
648
649 override bool OnClick(Widget w, int x, int y, int button)
650 {
651 super.OnClick(w,x,y,button);
652 if (w == m_EnfScriptRun)
653 {
654 RunEnscript();
655 return true;
656 }
657 else if (w == m_EnfScriptClear)
658 {
659 m_ScriptOutputListbox.ClearItems();
660 m_ScriptOutputHistory.Clear();
661 return true;
662 }
663
664 return false;
665 }
666
667 override bool OnChange(Widget w, int x, int y, bool finished)
668 {
669 super.OnChange(w, x, y, finished);
670 return false;
671 }
672
673
674 override void Show(bool show, ScriptConsoleTabBase selectedHandler)
675 {
677 {
678 //do nothing
679 }
680 else
681 {
682 m_Root.Show(show);
683 m_Root.Enable(show);
684 }
685 }
686
687}
688
690{
691 override void OnSelected()
692 {
694 if (m_EnscriptConsoleHistoryServer.IsValidIndex(index))
695 {
697 m_EnfScriptEdit.SetText(text);
698 }
700 }
701
702 override protected void EnscriptHistoryBack()
703 {
704 int history_index;
705 if (m_EnfScriptEdit)
706 {
709 if (history_index > -1)
710 {
712 }
714 }
715 }
716
717 override protected void EnscriptHistoryForward()
718 {
719 if (m_EnfScriptEdit)
720 {
721 int history_index;
722
726 {
728 }
730 }
731 }
732
733 override bool OnClick(Widget w, int x, int y, int button)
734 {
735 if (w == m_EnfScriptRun)
736 {
738 return true;
739 }
740 else if (w == m_EnfScriptClear)
741 {
742 m_ScriptOutputListbox.ClearItems();
743 m_ScriptOutputHistory.Clear();
744 return true;
745 }
746
747 return false;
748 }
749
750}

◆ ScriptConsoleEnfScriptTab()

void ScriptConsoleEnfScriptTab ( Widget root,
ScriptConsole console,
Widget button,
ScriptConsoleTabBase parent = null )
protected
284 {
286 }
288 }
289 }
290
291 override protected void EnscriptHistoryForward()
292 {
293 if (m_EnfScriptEdit)
294 {

Перекрестные ссылки m_EnfScriptEdit и m_EnscriptConsoleHistoryServer.

Используется в UIScriptedMenu::Init().

◆ Show()

override void Show ( bool show,
ScriptConsoleTabBase selectedHandler )
protected
512{
513 protected static ScriptConsoleEnfScriptTab m_Instance;
514 protected int m_EnscriptHistoryRow;
515 protected int m_EnscriptHistoryRowServer;
524 protected bool m_AllowScriptOutput;
525 protected int m_RunColor;
526
528
530 {
531 m_Instance = this;
536 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget("MultilineEditBoxWidget0"));
537 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget("RunButton"));
538 m_EnfScriptClear = ButtonWidget.Cast(root.FindAnyWidget("ClearButton"));
539 m_ScriptOutputListbox = TextListboxWidget.Cast(root.FindAnyWidget("ScriptOutputListbox"));
540 m_RunColor = m_EnfScriptRun.GetColor();
541 }
542
544 {
546 }
547
548 override void OnSelected()
549 {
551 if (m_EnscriptConsoleHistory.IsValidIndex(index))
552 {
553 string text = m_EnscriptConsoleHistory.Get(index);
554 m_EnfScriptEdit.SetText(text);
555 }
557 }
558
559 static void PrintS(string message)
560 {
561 Print(message);
562 if (m_Instance)
563 m_Instance.Add(message);
564 }
565
566 static void PrintS(bool message)
567 {
568 PrintS(message.ToString());
569 }
570
571 static void PrintS(int message)
572 {
573 PrintS(message.ToString());
574 }
575
576 static void PrintS(float message)
577 {
578 PrintS(message.ToString());
579 }
580
581 static void PrintS(vector message)
582 {
583 PrintS(message.ToString());
584 }
585
586 static void PrintS(Object message)
587 {
588 PrintS(message.ToString());
589 }
590
591
592 void Add(string message, bool isReload = false)
593 {
594 if (message != string.Empty)
595 {
597 {
598 if (!isReload)
601 m_ScriptOutputListbox.EnsureVisible(m_ScriptOutputListbox.GetNumItems());
602 }
603 }
604 }
605
606 protected void Clear(bool clearFile = false)
607 {
608 if(clearFile)
610 m_ScriptOutputListbox.ClearItems();
611 }
612
613
614
615 protected void ReloadScriptOutput()
616 {
617 m_ScriptOutputListbox.ClearItems();
618 m_AllowScriptOutput = true;
619 foreach ( string s: m_ScriptOutputHistory)
620 {
621 Add(s, true);
622 }
623 m_AllowScriptOutput = false;
624 }
625
626 void HistoryBack()
627 {
628
630 }
631
632 void HistoryForward()
633 {
635 }
636
637 protected void RunEnscript()
638 {
639 #ifdef DEVELOPER
640 string code;
641 m_EnfScriptEdit.GetText(code);
642 string codeNoReplace = code;
644 m_AllowScriptOutput = true;
645 code.Replace("Print(","ScriptConsoleEnfScriptTab.PrintS(");
646 code.Replace("Print (","ScriptConsoleEnfScriptTab.PrintS(");
647 bool success = GetGame().ExecuteEnforceScript("void scConsMain() \n{\n" + code + "\n}\n", "scConsMain");
648 m_AllowScriptOutput = false;
650
653 #endif
654 }
655
656 protected void ColorRunButton(bool success)
657 {
658 if (success)
659 {
660 m_EnfScriptRun.SetColor(ARGB(255,0,255,0));
661 }
662 else
663 {
664 m_EnfScriptRun.SetColor(ARGB(255,255,0,0));
665 }
666 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(ResetRunButtonColor,600);
667 }
668
669 protected void ResetRunButtonColor()
670 {
671 m_EnfScriptRun.SetColor(m_RunColor);
672 }
673
674 protected void RunEnscriptServer()
675 {
676 string code;
677 m_EnfScriptEdit.GetText(code);
681 GetGame().RPCSingleParam(GetGame().GetPlayer(), ERPCs.DEV_RPC_SERVER_SCRIPT, CachedObjectsParams.PARAM1_STRING, true, GetGame().GetPlayer().GetIdentity());
682 }
683
684 protected void EnscriptHistoryBack()
685 {
686 int history_index;
687 if (m_EnfScriptEdit)
688 {
691 if (history_index > -1)
692 {
694 }
696 }
697 }
698
699
700 protected void EnscriptHistoryForward()
701 {
702 if (m_EnfScriptEdit)
703 {
704 int history_index;
708 {
710 }
712 }
713 }
714
715 override void OnRPCEx(int rpc_type, ParamsReadContext ctx)
716 {
717 super.OnRPCEx(rpc_type, ctx);
718 #ifdef DIAG_DEVELOPER
719 switch (rpc_type)
720 {
721 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
722 {
724 {
726 }
727 break;
728 }
729 }
730 #endif
731 }
732
733 override bool OnClick(Widget w, int x, int y, int button)
734 {
735 super.OnClick(w,x,y,button);
736 if (w == m_EnfScriptRun)
737 {
738 RunEnscript();
739 return true;
740 }
741 else if (w == m_EnfScriptClear)
742 {
743 m_ScriptOutputListbox.ClearItems();
744 m_ScriptOutputHistory.Clear();
745 return true;
746 }
747
748 return false;
749 }
750
751 override bool OnChange(Widget w, int x, int y, bool finished)
752 {
753 super.OnChange(w, x, y, finished);
754 return false;
755 }
756
757
758 override void Show(bool show, ScriptConsoleTabBase selectedHandler)
759 {
761 {
762 //do nothing
763 }
764 else
765 {
766 m_Root.Show(show);
767 m_Root.Enable(show);
768 }
769 }
770
771}
772
774{
775 override void OnSelected()
776 {
778 if (m_EnscriptConsoleHistoryServer.IsValidIndex(index))
779 {
781 m_EnfScriptEdit.SetText(text);
782 }
784 }
785
786 override protected void EnscriptHistoryBack()
787 {
788 int history_index;
789 if (m_EnfScriptEdit)
790 {
793 if (history_index > -1)
794 {
796 }
798 }
799 }
800
801 override protected void EnscriptHistoryForward()
802 {
803 if (m_EnfScriptEdit)
804 {
805 int history_index;
806
810 {
812 }
814 }
815 }
816
817 override bool OnClick(Widget w, int x, int y, int button)
818 {
819 if (w == m_EnfScriptRun)
820 {
822 return true;
823 }
824 else if (w == m_EnfScriptClear)
825 {
826 m_ScriptOutputListbox.ClearItems();
827 m_ScriptOutputHistory.Clear();
828 return true;
829 }
830
831 return false;
832 }
833
834}

◆ ~ScriptConsoleEnfScriptTab()

Перекрестные ссылки m_EnfScriptEdit и m_EnscriptConsoleHistoryServer.

Переменные

◆ m_AllowScriptOutput

bool m_AllowScriptOutput
protected

◆ m_EnfScriptClear

ButtonWidget m_EnfScriptClear
protected

◆ m_EnfScriptEdit

MultilineEditBoxWidget m_EnfScriptEdit
protected

◆ m_EnfScriptRun

ButtonWidget m_EnfScriptRun
protected

◆ m_EnscriptConsoleHistory

ref TStringArray m_EnscriptConsoleHistory
protected

◆ m_EnscriptConsoleHistoryServer

ref TStringArray m_EnscriptConsoleHistoryServer
protected

◆ m_EnscriptHistoryRow

int m_EnscriptHistoryRow
protected

◆ m_EnscriptHistoryRowServer

int m_EnscriptHistoryRowServer
protected

◆ m_Instance

ScriptConsoleEnfScriptTab m_Instance
staticprotected

◆ m_ModuleLocalEnscriptHistory

PluginLocalEnscriptHistory m_ModuleLocalEnscriptHistory
protected

◆ m_ModuleLocalEnscriptHistoryServer

PluginLocalEnscriptHistoryServer m_ModuleLocalEnscriptHistoryServer
protected

◆ m_RunColor

int m_RunColor
protected

◆ m_ScriptOutputHistory

ref TStringArray m_ScriptOutputHistory = new TStringArray()
staticprotected

◆ m_ScriptOutputListbox

TextListboxWidget m_ScriptOutputListbox
protected