458{
472
474
476 {
477 super.InitializeTab(root, console, button, parent);
478
484 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
485 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
489 }
490
492 {
494 }
495
497 {
500 {
503 }
505 }
506
507 static void PrintS(
string message)
508 {
512 }
513
514 static void PrintS(
bool message)
515 {
517 }
518
519 static void PrintS(
int message)
520 {
521 PrintS(message.ToString());
522 }
523
524 static void PrintS(
float message)
525 {
527 }
528
530 {
532 }
533
535 {
536 PrintS(message.ToString());
537 }
538
539
540 void Add(
string message,
bool isReload =
false)
541 {
542 if (message !=
string.
Empty)
543 {
545 {
546 if (!isReload)
550 }
551 }
552 }
553
554 protected void Clear(
bool clearFile =
false)
555 {
556 if(clearFile)
559 }
560
561
562
564 {
568 {
570 }
572 }
573
575 {
576
578 }
579
581 {
583 }
584
586 {
587 #ifdef DEVELOPER
588 string code;
590 string codeNoReplace = code;
593 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
594 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
595 bool success =
g_Game.ExecuteEnforceScript(
"void scConsMain() \n{\n" + code +
"\n}\n",
"scConsMain");
598
601 #endif
602 }
603
605 {
606 if (success)
607 {
609 }
610 else
611 {
613 }
615 }
616
618 {
620 }
621
623 {
624 string code;
630 }
631
633 {
634 int history_index;
636 {
639 if (history_index > -1)
640 {
642 }
644 }
645 }
646
647
649 {
651 {
652 int history_index;
656 {
658 }
660 }
661 }
662
664 {
665 super.OnRPCEx(rpc_type, ctx);
666 #ifdef DIAG_DEVELOPER
667 switch (rpc_type)
668 {
669 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
670 {
672 {
674 }
675 break;
676 }
677 }
678 #endif
679 }
680
682 {
683 super.OnClick(w,
x,
y,button);
685 {
687 return true;
688 }
690 {
693 return true;
694 }
695
696 return false;
697 }
698
700 {
701 super.OnChange(w,
x,
y, finished);
702 return false;
703 }
704
705
707 {
708 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
709 {
710
711 }
712 else
713 {
716 }
717 }
718
719}
720
722{
724 {
726
729 {
732 }
734 }
735
737 {
738 int history_index;
740 {
743 if (history_index > -1)
744 {
746 }
748 }
749 }
750
752 {
754 {
755 int history_index;
756
760 {
762 }
764 }
765 }
766
768 {
770 {
772 return true;
773 }
775 {
778 return true;
779 }
780
781 return false;
782 }
783}
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)