414{
428
430
432 {
433 super.InitializeTab(root, console, button, parent);
434
440 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
441 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
445 }
446
448 {
450 }
451
453 {
456 {
459 }
461 }
462
463 static void PrintS(
string message)
464 {
468 }
469
470 static void PrintS(
bool message)
471 {
473 }
474
475 static void PrintS(
int message)
476 {
477 PrintS(message.ToString());
478 }
479
480 static void PrintS(
float message)
481 {
483 }
484
486 {
488 }
489
491 {
492 PrintS(message.ToString());
493 }
494
495
496 void Add(
string message,
bool isReload =
false)
497 {
498 if (message !=
string.
Empty)
499 {
501 {
502 if (!isReload)
506 }
507 }
508 }
509
510 protected void Clear(
bool clearFile =
false)
511 {
512 if(clearFile)
515 }
516
517
518
520 {
524 {
526 }
528 }
529
531 {
532
534 }
535
537 {
539 }
540
542 {
543 #ifdef DEVELOPER
544 string code;
546 string codeNoReplace = code;
549 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
550 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
551 bool success =
g_Game.ExecuteEnforceScript(
"void scConsMain() \n{\n" + code +
"\n}\n",
"scConsMain");
554
557 #endif
558 }
559
561 {
562 if (success)
563 {
565 }
566 else
567 {
569 }
571 }
572
574 {
576 }
577
579 {
580 string code;
586 }
587
589 {
590 int history_index;
592 {
595 if (history_index > -1)
596 {
598 }
600 }
601 }
602
603
605 {
607 {
608 int history_index;
612 {
614 }
616 }
617 }
618
620 {
621 super.OnRPCEx(rpc_type, ctx);
622 #ifdef DIAG_DEVELOPER
623 switch (rpc_type)
624 {
625 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
626 {
628 {
630 }
631 break;
632 }
633 }
634 #endif
635 }
636
638 {
639 super.OnClick(w,
x,
y,button);
641 {
643 return true;
644 }
646 {
649 return true;
650 }
651
652 return false;
653 }
654
656 {
657 super.OnChange(w,
x,
y, finished);
658 return false;
659 }
660
661
663 {
664 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
665 {
666
667 }
668 else
669 {
672 }
673 }
674
675}
676
678{
680 {
682
685 {
688 }
690 }
691
693 {
694 int history_index;
696 {
699 if (history_index > -1)
700 {
702 }
704 }
705 }
706
708 {
710 {
711 int history_index;
712
716 {
718 }
720 }
721 }
722
724 {
726 {
728 return true;
729 }
731 {
734 return true;
735 }
736
737 return false;
738 }
739}
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)