487{
501
503
505 {
511 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
512 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
516 }
517
519 {
521 }
522
524 {
527 {
530 }
532 }
533
534 static void PrintS(
string message)
535 {
539 }
540
541 static void PrintS(
bool message)
542 {
544 }
545
546 static void PrintS(
int message)
547 {
548 PrintS(message.ToString());
549 }
550
551 static void PrintS(
float message)
552 {
554 }
555
557 {
559 }
560
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)
577 }
578 }
579 }
580
581 protected void Clear(
bool clearFile =
false)
582 {
583 if(clearFile)
586 }
587
588
589
591 {
595 {
597 }
599 }
600
602 {
603
605 }
606
608 {
610 }
611
613 {
614 #ifdef DEVELOPER
615 string code;
617 string codeNoReplace = code;
620 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
621 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
622 bool success =
g_Game.ExecuteEnforceScript(
"void scConsMain() \n{\n" + code +
"\n}\n",
"scConsMain");
625
628 #endif
629 }
630
632 {
633 if (success)
634 {
636 }
637 else
638 {
640 }
642 }
643
645 {
647 }
648
650 {
651 string code;
657 }
658
660 {
661 int history_index;
663 {
666 if (history_index > -1)
667 {
669 }
671 }
672 }
673
674
676 {
678 {
679 int history_index;
683 {
685 }
687 }
688 }
689
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
709 {
710 super.OnClick(w,
x,
y,button);
712 {
714 return true;
715 }
717 {
720 return true;
721 }
722
723 return false;
724 }
725
727 {
728 super.OnChange(w,
x,
y, finished);
729 return false;
730 }
731
732
734 {
735 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
736 {
737
738 }
739 else
740 {
743 }
744 }
745
746}
747
749{
751 {
754 {
757 }
759 }
760
762 {
763 int history_index;
765 {
768 if (history_index > -1)
769 {
771 }
773 }
774 }
775
777 {
779 {
780 int history_index;
781
785 {
787 }
789 }
790 }
791
793 {
795 {
797 return true;
798 }
800 {
803 return true;
804 }
805
806 return false;
807 }
808
809}
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()
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.
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)