454{
468
470
472 {
478 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
479 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
483 }
484
486 {
488 }
489
491 {
494 {
497 }
499 }
500
501 static void PrintS(
string message)
502 {
506 }
507
508 static void PrintS(
bool message)
509 {
511 }
512
513 static void PrintS(
int message)
514 {
515 PrintS(message.ToString());
516 }
517
518 static void PrintS(
float message)
519 {
521 }
522
524 {
526 }
527
529 {
530 PrintS(message.ToString());
531 }
532
533
534 void Add(
string message,
bool isReload =
false)
535 {
536 if (message !=
string.
Empty)
537 {
539 {
540 if (!isReload)
544 }
545 }
546 }
547
548 protected void Clear(
bool clearFile =
false)
549 {
550 if(clearFile)
553 }
554
555
556
558 {
562 {
564 }
566 }
567
569 {
570
572 }
573
575 {
577 }
578
580 {
581 #ifdef DEVELOPER
582 string code;
584 string codeNoReplace = code;
587 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
588 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
589 bool success =
g_Game.ExecuteEnforceScript(
"void scConsMain() \n{\n" + code +
"\n}\n",
"scConsMain");
592
595 #endif
596 }
597
599 {
600 if (success)
601 {
603 }
604 else
605 {
607 }
609 }
610
612 {
614 }
615
617 {
618 string code;
624 }
625
627 {
628 int history_index;
630 {
633 if (history_index > -1)
634 {
636 }
638 }
639 }
640
641
643 {
645 {
646 int history_index;
650 {
652 }
654 }
655 }
656
658 {
659 super.OnRPCEx(rpc_type, ctx);
660 #ifdef DIAG_DEVELOPER
661 switch (rpc_type)
662 {
663 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
664 {
666 {
668 }
669 break;
670 }
671 }
672 #endif
673 }
674
676 {
677 super.OnClick(w,
x,
y,button);
679 {
681 return true;
682 }
684 {
687 return true;
688 }
689
690 return false;
691 }
692
694 {
695 super.OnChange(w,
x,
y, finished);
696 return false;
697 }
698
699
701 {
702 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
703 {
704
705 }
706 else
707 {
710 }
711 }
712
713}
714
716{
718 {
721 {
724 }
726 }
727
729 {
730 int history_index;
732 {
735 if (history_index > -1)
736 {
738 }
740 }
741 }
742
744 {
746 {
747 int history_index;
748
752 {
754 }
756 }
757 }
758
760 {
762 {
764 return true;
765 }
767 {
770 return true;
771 }
772
773 return false;
774 }
775
776}
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)