505{
519
521
523 {
529 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
530 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
534 }
535
537 {
539 }
540
542 {
545 {
548 }
550 }
551
552 static void PrintS(
string message)
553 {
557 }
558
559 static void PrintS(
bool message)
560 {
562 }
563
564 static void PrintS(
int message)
565 {
566 PrintS(message.ToString());
567 }
568
569 static void PrintS(
float message)
570 {
572 }
573
575 {
577 }
578
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)
595 }
596 }
597 }
598
599 protected void Clear(
bool clearFile =
false)
600 {
601 if(clearFile)
604 }
605
606
607
609 {
613 {
615 }
617 }
618
620 {
621
623 }
624
626 {
628 }
629
631 {
632 #ifdef DEVELOPER
633 string code;
635 string codeNoReplace = code;
638 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
639 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
643
646 #endif
647 }
648
650 {
651 if (success)
652 {
654 }
655 else
656 {
658 }
660 }
661
663 {
665 }
666
668 {
669 string code;
675 }
676
678 {
679 int history_index;
681 {
684 if (history_index > -1)
685 {
687 }
689 }
690 }
691
692
694 {
696 {
697 int history_index;
701 {
703 }
705 }
706 }
707
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
727 {
728 super.OnClick(w,
x,
y,button);
730 {
732 return true;
733 }
735 {
738 return true;
739 }
740
741 return false;
742 }
743
745 {
746 super.OnChange(w,
x,
y, finished);
747 return false;
748 }
749
750
752 {
753 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
754 {
755
756 }
757 else
758 {
761 }
762 }
763
764}
765
767{
769 {
772 {
775 }
777 }
778
780 {
781 int history_index;
783 {
786 if (history_index > -1)
787 {
789 }
791 }
792 }
793
795 {
797 {
798 int history_index;
799
803 {
805 }
807 }
808 }
809
811 {
813 {
815 return true;
816 }
818 {
821 return true;
822 }
823
824 return false;
825 }
826
827}
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
void ScriptConsoleEnfScriptTab(Widget root, ScriptConsole console, Widget button, ScriptConsoleTabBase parent=null)
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 Clear(bool clearFile=false)
void ReloadScriptOutput()
ButtonWidget m_EnfScriptRun
void EnscriptHistoryBack()
override bool OnChange(Widget w, int x, int y, bool finished)
PluginLocalEnscriptHistory m_ModuleLocalEnscriptHistory
ref TStringArray m_EnscriptConsoleHistory
void ColorRunButton(bool success)
MultilineEditBoxWidget m_EnfScriptEdit
void EnscriptHistoryForward()
proto native void RPCSingleParam(Object target, int rpc_type, Param param, bool guaranteed, PlayerIdentity recipient=null)
see CGame.RPC
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ExecuteEnforceScript(string expression, string mainFnName)
Delevoper only: Executes Enforce Script expression, if there is an error, is printed into the script ...
static ref Param1< bool > PARAM1_BOOL
static ref Param1< string > PARAM1_STRING
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
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 native CGame GetGame()
proto void Print(void var)
Prints content of variable to console/log.
array< string > TStringArray
string String(string s)
Helper for passing string expression to functions with void parameter. Example: Print(String("Hello "...
proto int Replace(string sample, string replace)
Replace all occurrances of 'sample' in 'str' by 'replace'.
int ARGB(int a, int r, int g, int b)