512{
526
528
530 {
536 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
537 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
541 }
542
544 {
546 }
547
549 {
552 {
555 }
557 }
558
559 static void PrintS(
string message)
560 {
564 }
565
566 static void PrintS(
bool message)
567 {
569 }
570
571 static void PrintS(
int message)
572 {
573 PrintS(message.ToString());
574 }
575
576 static void PrintS(
float message)
577 {
579 }
580
582 {
584 }
585
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)
602 }
603 }
604 }
605
606 protected void Clear(
bool clearFile =
false)
607 {
608 if(clearFile)
611 }
612
613
614
616 {
620 {
622 }
624 }
625
627 {
628
630 }
631
633 {
635 }
636
638 {
639 #ifdef DEVELOPER
640 string code;
642 string codeNoReplace = code;
645 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
646 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
647 bool success =
g_Game.ExecuteEnforceScript(
"void scConsMain() \n{\n" + code +
"\n}\n",
"scConsMain");
650
653 #endif
654 }
655
657 {
658 if (success)
659 {
661 }
662 else
663 {
665 }
667 }
668
670 {
672 }
673
675 {
676 string code;
682 }
683
685 {
686 int history_index;
688 {
691 if (history_index > -1)
692 {
694 }
696 }
697 }
698
699
701 {
703 {
704 int history_index;
708 {
710 }
712 }
713 }
714
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
734 {
735 super.OnClick(w,
x,
y,button);
737 {
739 return true;
740 }
742 {
745 return true;
746 }
747
748 return false;
749 }
750
752 {
753 super.OnChange(w,
x,
y, finished);
754 return false;
755 }
756
757
759 {
760 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
761 {
762
763 }
764 else
765 {
768 }
769 }
770
771}
772
774{
776 {
779 {
782 }
784 }
785
787 {
788 int history_index;
790 {
793 if (history_index > -1)
794 {
796 }
798 }
799 }
800
802 {
804 {
805 int history_index;
806
810 {
812 }
814 }
815 }
816
818 {
820 {
822 return true;
823 }
825 {
828 return true;
829 }
830
831 return false;
832 }
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
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)