491{
505
507
509 {
510 super.InitializeTab(root, console, button, parent);
511
517 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
518 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
522 }
523
525 {
527 }
528
530 {
533 {
536 }
538 }
539
540 static void PrintS(
string message)
541 {
545 }
546
547 static void PrintS(
bool message)
548 {
550 }
551
552 static void PrintS(
int message)
553 {
554 PrintS(message.ToString());
555 }
556
557 static void PrintS(
float message)
558 {
560 }
561
563 {
565 }
566
568 {
569 PrintS(message.ToString());
570 }
571
572
573 void Add(
string message,
bool isReload =
false)
574 {
575 if (message !=
string.
Empty)
576 {
578 {
579 if (!isReload)
583 }
584 }
585 }
586
587 protected void Clear(
bool clearFile =
false)
588 {
589 if(clearFile)
592 }
593
594
595
597 {
601 {
603 }
605 }
606
608 {
609
611 }
612
614 {
616 }
617
619 {
620 #ifdef DEVELOPER
621 string code;
623 string codeNoReplace = code;
626 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
627 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
628 bool success =
g_Game.ExecuteEnforceScript(
"void scConsMain() \n{\n" + code +
"\n}\n",
"scConsMain");
631
634 #endif
635 }
636
638 {
639 if (success)
640 {
642 }
643 else
644 {
646 }
648 }
649
651 {
653 }
654
656 {
657 string code;
663 }
664
666 {
667 int history_index;
669 {
672 if (history_index > -1)
673 {
675 }
677 }
678 }
679
680
682 {
684 {
685 int history_index;
689 {
691 }
693 }
694 }
695
697 {
698 super.OnRPCEx(rpc_type, ctx);
699 #ifdef DIAG_DEVELOPER
700 switch (rpc_type)
701 {
702 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
703 {
705 {
707 }
708 break;
709 }
710 }
711 #endif
712 }
713
715 {
716 super.OnClick(w,
x,
y,button);
718 {
720 return true;
721 }
723 {
726 return true;
727 }
728
729 return false;
730 }
731
733 {
734 super.OnChange(w,
x,
y, finished);
735 return false;
736 }
737
738
740 {
741 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
742 {
743
744 }
745 else
746 {
749 }
750 }
751
752}
753
755{
757 {
759
762 {
765 }
767 }
768
770 {
771 int history_index;
773 {
776 if (history_index > -1)
777 {
779 }
781 }
782 }
783
785 {
787 {
788 int history_index;
789
793 {
795 }
797 }
798 }
799
801 {
803 {
805 return true;
806 }
808 {
811 return true;
812 }
813
814 return false;
815 }
816}
PluginBase GetPlugin(typename plugin_type)
ref TStringArray m_EnscriptConsoleHistoryServer
int m_EnscriptHistoryRowServer
override void OnRPCEx(int rpc_type, ParamsReadContext ctx)
ButtonWidget m_EnfScriptClear
ScriptConsoleEnfScriptTab ScriptConsoleTabBase OnSelected()
void ResetRunButtonColor()
void Add(string message, bool isReload=false)
TextListboxWidget m_ScriptOutputListbox
static ref TStringArray m_ScriptOutputHistory
static void PrintS(string message)
void ~ScriptConsoleEnfScriptTab()
override bool OnClick(Widget w, int x, int y, int button)
PluginLocalEnscriptHistoryServer m_ModuleLocalEnscriptHistoryServer
void ReloadScriptOutput()
ButtonWidget m_EnfScriptRun
void EnscriptHistoryBack()
override bool OnChange(Widget w, int x, int y, bool finished)
override void InitializeTab(Widget root, ScriptConsole console, Widget button, ScriptConsoleTabBase parent=null)
PluginLocalEnscriptHistory m_ModuleLocalEnscriptHistory
ref TStringArray m_EnscriptConsoleHistory
void ColorRunButton(bool success)
MultilineEditBoxWidget m_EnfScriptEdit
void EnscriptHistoryForward()
static ref Param1< bool > PARAM1_BOOL
static ref Param1< string > PARAM1_STRING
void ReloadScriptOutput()
override void OnSelected()
void EnscriptHistoryBack()
void EnscriptHistoryForward()
override bool OnClick(Widget w, int x, int y, int button)
proto bool Read(void value_in)
proto string ToString(bool simple=true)
proto string ToString(bool beautify=true)
Vector to string.
Serializer ParamsReadContext
proto void Print(void var)
Prints content of variable to console/log.
string String(string s)
Helper for passing string expression to functions with void parameter. Example: Print(String("Hello "...
class array< Class T > TStringArray
proto int Replace(string sample, string replace)
Replace all occurrances of 'sample' in 'str' by 'replace'.
proto string Get(int index)
Gets n-th character from string.
int ARGB(int a, int r, int g, int b)