442{
456
458
460 {
461 super.InitializeTab(root, console, button, parent);
462
468 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
469 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
473 }
474
476 {
478 }
479
481 {
484 {
487 }
489 }
490
491 static void PrintS(
string message)
492 {
496 }
497
498 static void PrintS(
bool message)
499 {
501 }
502
503 static void PrintS(
int message)
504 {
505 PrintS(message.ToString());
506 }
507
508 static void PrintS(
float message)
509 {
511 }
512
514 {
516 }
517
519 {
520 PrintS(message.ToString());
521 }
522
523
524 void Add(
string message,
bool isReload =
false)
525 {
526 if (message !=
string.
Empty)
527 {
529 {
530 if (!isReload)
534 }
535 }
536 }
537
538 protected void Clear(
bool clearFile =
false)
539 {
540 if(clearFile)
543 }
544
545
546
548 {
552 {
554 }
556 }
557
559 {
560
562 }
563
565 {
567 }
568
570 {
571 #ifdef DEVELOPER
572 string code;
574 string codeNoReplace = code;
577 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
578 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
579 bool success =
g_Game.ExecuteEnforceScript(
"void scConsMain() \n{\n" + code +
"\n}\n",
"scConsMain");
582
585 #endif
586 }
587
589 {
590 if (success)
591 {
593 }
594 else
595 {
597 }
599 }
600
602 {
604 }
605
607 {
608 string code;
614 }
615
617 {
618 int history_index;
620 {
623 if (history_index > -1)
624 {
626 }
628 }
629 }
630
631
633 {
635 {
636 int history_index;
640 {
642 }
644 }
645 }
646
648 {
649 super.OnRPCEx(rpc_type, ctx);
650 #ifdef DIAG_DEVELOPER
651 switch (rpc_type)
652 {
653 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
654 {
656 {
658 }
659 break;
660 }
661 }
662 #endif
663 }
664
666 {
667 super.OnClick(w,
x,
y,button);
669 {
671 return true;
672 }
674 {
677 return true;
678 }
679
680 return false;
681 }
682
684 {
685 super.OnChange(w,
x,
y, finished);
686 return false;
687 }
688
689
691 {
692 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
693 {
694
695 }
696 else
697 {
700 }
701 }
702
703}
704
706{
708 {
710
713 {
716 }
718 }
719
721 {
722 int history_index;
724 {
727 if (history_index > -1)
728 {
730 }
732 }
733 }
734
736 {
738 {
739 int history_index;
740
744 {
746 }
748 }
749 }
750
752 {
754 {
756 return true;
757 }
759 {
762 return true;
763 }
764
765 return false;
766 }
767}
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)