509{
523
525
527 {
528 super.InitializeTab(root, console, button, parent);
529
535 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
536 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
540 }
541
543 {
545 }
546
548 {
551 {
554 }
556 }
557
558 static void PrintS(
string message)
559 {
563 }
564
565 static void PrintS(
bool message)
566 {
568 }
569
570 static void PrintS(
int message)
571 {
572 PrintS(message.ToString());
573 }
574
575 static void PrintS(
float message)
576 {
578 }
579
581 {
583 }
584
586 {
587 PrintS(message.ToString());
588 }
589
590
591 void Add(
string message,
bool isReload =
false)
592 {
593 if (message !=
string.
Empty)
594 {
596 {
597 if (!isReload)
601 }
602 }
603 }
604
605 protected void Clear(
bool clearFile =
false)
606 {
607 if(clearFile)
610 }
611
612
613
615 {
619 {
621 }
623 }
624
626 {
627
629 }
630
632 {
634 }
635
637 {
638 #ifdef DEVELOPER
639 string code;
641 string codeNoReplace = code;
644 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
645 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
646 bool success =
g_Game.ExecuteEnforceScript(
"void scConsMain() \n{\n" + code +
"\n}\n",
"scConsMain");
649
652 #endif
653 }
654
656 {
657 if (success)
658 {
660 }
661 else
662 {
664 }
666 }
667
669 {
671 }
672
674 {
675 string code;
681 }
682
684 {
685 int history_index;
687 {
690 if (history_index > -1)
691 {
693 }
695 }
696 }
697
698
700 {
702 {
703 int history_index;
707 {
709 }
711 }
712 }
713
715 {
716 super.OnRPCEx(rpc_type, ctx);
717 #ifdef DIAG_DEVELOPER
718 switch (rpc_type)
719 {
720 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
721 {
723 {
725 }
726 break;
727 }
728 }
729 #endif
730 }
731
733 {
734 super.OnClick(w,
x,
y,button);
736 {
738 return true;
739 }
741 {
744 return true;
745 }
746
747 return false;
748 }
749
751 {
752 super.OnChange(w,
x,
y, finished);
753 return false;
754 }
755
756
758 {
759 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
760 {
761
762 }
763 else
764 {
767 }
768 }
769
770}
771
773{
775 {
777
780 {
783 }
785 }
786
788 {
789 int history_index;
791 {
794 if (history_index > -1)
795 {
797 }
799 }
800 }
801
803 {
805 {
806 int history_index;
807
811 {
813 }
815 }
816 }
817
819 {
821 {
823 return true;
824 }
826 {
829 return true;
830 }
831
832 return false;
833 }
834}
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)