432{
446
448
450 {
451 super.InitializeTab(root, console, button, parent);
452
458 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
459 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
463 }
464
466 {
468 }
469
471 {
474 {
477 }
479 }
480
481 static void PrintS(
string message)
482 {
486 }
487
488 static void PrintS(
bool message)
489 {
491 }
492
493 static void PrintS(
int message)
494 {
495 PrintS(message.ToString());
496 }
497
498 static void PrintS(
float message)
499 {
501 }
502
504 {
506 }
507
509 {
510 PrintS(message.ToString());
511 }
512
513
514 void Add(
string message,
bool isReload =
false)
515 {
516 if (message !=
string.
Empty)
517 {
519 {
520 if (!isReload)
524 }
525 }
526 }
527
528 protected void Clear(
bool clearFile =
false)
529 {
530 if(clearFile)
533 }
534
535
536
538 {
542 {
544 }
546 }
547
549 {
550
552 }
553
555 {
557 }
558
560 {
561 #ifdef DEVELOPER
562 string code;
564 string codeNoReplace = code;
567 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
568 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
569 bool success =
g_Game.ExecuteEnforceScript(
"void scConsMain() \n{\n" + code +
"\n}\n",
"scConsMain");
572
575 #endif
576 }
577
579 {
580 if (success)
581 {
583 }
584 else
585 {
587 }
589 }
590
592 {
594 }
595
597 {
598 string code;
604 }
605
607 {
608 int history_index;
610 {
613 if (history_index > -1)
614 {
616 }
618 }
619 }
620
621
623 {
625 {
626 int history_index;
630 {
632 }
634 }
635 }
636
638 {
639 super.OnRPCEx(rpc_type, ctx);
640 #ifdef DIAG_DEVELOPER
641 switch (rpc_type)
642 {
643 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
644 {
646 {
648 }
649 break;
650 }
651 }
652 #endif
653 }
654
656 {
657 super.OnClick(w,
x,
y,button);
659 {
661 return true;
662 }
664 {
667 return true;
668 }
669
670 return false;
671 }
672
674 {
675 super.OnChange(w,
x,
y, finished);
676 return false;
677 }
678
679
681 {
682 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
683 {
684
685 }
686 else
687 {
690 }
691 }
692
693}
694
696{
698 {
700
703 {
706 }
708 }
709
711 {
712 int history_index;
714 {
717 if (history_index > -1)
718 {
720 }
722 }
723 }
724
726 {
728 {
729 int history_index;
730
734 {
736 }
738 }
739 }
740
742 {
744 {
746 return true;
747 }
749 {
752 return true;
753 }
754
755 return false;
756 }
757}
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)