473{
487
489
491 {
492 super.InitializeTab(root, console, button, parent);
493
499 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
500 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
504 }
505
507 {
509 }
510
512 {
515 {
518 }
520 }
521
522 static void PrintS(
string message)
523 {
527 }
528
529 static void PrintS(
bool message)
530 {
532 }
533
534 static void PrintS(
int message)
535 {
536 PrintS(message.ToString());
537 }
538
539 static void PrintS(
float message)
540 {
542 }
543
545 {
547 }
548
550 {
551 PrintS(message.ToString());
552 }
553
554
555 void Add(
string message,
bool isReload =
false)
556 {
557 if (message !=
string.
Empty)
558 {
560 {
561 if (!isReload)
565 }
566 }
567 }
568
569 protected void Clear(
bool clearFile =
false)
570 {
571 if(clearFile)
574 }
575
576
577
579 {
583 {
585 }
587 }
588
590 {
591
593 }
594
596 {
598 }
599
601 {
602 #ifdef DEVELOPER
603 string code;
605 string codeNoReplace = code;
608 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
609 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
610 bool success =
g_Game.ExecuteEnforceScript(
"void scConsMain() \n{\n" + code +
"\n}\n",
"scConsMain");
613
616 #endif
617 }
618
620 {
621 if (success)
622 {
624 }
625 else
626 {
628 }
630 }
631
633 {
635 }
636
638 {
639 string code;
645 }
646
648 {
649 int history_index;
651 {
654 if (history_index > -1)
655 {
657 }
659 }
660 }
661
662
664 {
666 {
667 int history_index;
671 {
673 }
675 }
676 }
677
679 {
680 super.OnRPCEx(rpc_type, ctx);
681 #ifdef DIAG_DEVELOPER
682 switch (rpc_type)
683 {
684 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
685 {
687 {
689 }
690 break;
691 }
692 }
693 #endif
694 }
695
697 {
698 super.OnClick(w,
x,
y,button);
700 {
702 return true;
703 }
705 {
708 return true;
709 }
710
711 return false;
712 }
713
715 {
716 super.OnChange(w,
x,
y, finished);
717 return false;
718 }
719
720
722 {
723 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
724 {
725
726 }
727 else
728 {
731 }
732 }
733
734}
735
737{
739 {
741
744 {
747 }
749 }
750
752 {
753 int history_index;
755 {
758 if (history_index > -1)
759 {
761 }
763 }
764 }
765
767 {
769 {
770 int history_index;
771
775 {
777 }
779 }
780 }
781
783 {
785 {
787 return true;
788 }
790 {
793 return true;
794 }
795
796 return false;
797 }
798}
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)