469{
483
485
487 {
493 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
494 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
498 }
499
501 {
503 }
504
506 {
509 {
512 }
514 }
515
516 static void PrintS(
string message)
517 {
521 }
522
523 static void PrintS(
bool message)
524 {
526 }
527
528 static void PrintS(
int message)
529 {
530 PrintS(message.ToString());
531 }
532
533 static void PrintS(
float message)
534 {
536 }
537
539 {
541 }
542
544 {
545 PrintS(message.ToString());
546 }
547
548
549 void Add(
string message,
bool isReload =
false)
550 {
551 if (message !=
string.
Empty)
552 {
554 {
555 if (!isReload)
559 }
560 }
561 }
562
563 protected void Clear(
bool clearFile =
false)
564 {
565 if(clearFile)
568 }
569
570
571
573 {
577 {
579 }
581 }
582
584 {
585
587 }
588
590 {
592 }
593
595 {
596 #ifdef DEVELOPER
597 string code;
599 string codeNoReplace = code;
602 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
603 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
604 bool success =
g_Game.ExecuteEnforceScript(
"void scConsMain() \n{\n" + code +
"\n}\n",
"scConsMain");
607
610 #endif
611 }
612
614 {
615 if (success)
616 {
618 }
619 else
620 {
622 }
624 }
625
627 {
629 }
630
632 {
633 string code;
639 }
640
642 {
643 int history_index;
645 {
648 if (history_index > -1)
649 {
651 }
653 }
654 }
655
656
658 {
660 {
661 int history_index;
665 {
667 }
669 }
670 }
671
673 {
674 super.OnRPCEx(rpc_type, ctx);
675 #ifdef DIAG_DEVELOPER
676 switch (rpc_type)
677 {
678 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
679 {
681 {
683 }
684 break;
685 }
686 }
687 #endif
688 }
689
691 {
692 super.OnClick(w,
x,
y,button);
694 {
696 return true;
697 }
699 {
702 return true;
703 }
704
705 return false;
706 }
707
709 {
710 super.OnChange(w,
x,
y, finished);
711 return false;
712 }
713
714
716 {
717 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
718 {
719
720 }
721 else
722 {
725 }
726 }
727
728}
729
731{
733 {
736 {
739 }
741 }
742
744 {
745 int history_index;
747 {
750 if (history_index > -1)
751 {
753 }
755 }
756 }
757
759 {
761 {
762 int history_index;
763
767 {
769 }
771 }
772 }
773
775 {
777 {
779 return true;
780 }
782 {
785 return true;
786 }
787
788 return false;
789 }
790
791}
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)