427{
441
443
445 {
446 super.InitializeTab(root, console, button, parent);
447
453 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
454 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
458 }
459
461 {
463 }
464
466 {
469 {
472 }
474 }
475
476 static void PrintS(
string message)
477 {
481 }
482
483 static void PrintS(
bool message)
484 {
486 }
487
488 static void PrintS(
int message)
489 {
490 PrintS(message.ToString());
491 }
492
493 static void PrintS(
float message)
494 {
496 }
497
499 {
501 }
502
504 {
505 PrintS(message.ToString());
506 }
507
508
509 void Add(
string message,
bool isReload =
false)
510 {
511 if (message !=
string.
Empty)
512 {
514 {
515 if (!isReload)
519 }
520 }
521 }
522
523 protected void Clear(
bool clearFile =
false)
524 {
525 if(clearFile)
528 }
529
530
531
533 {
537 {
539 }
541 }
542
544 {
545
547 }
548
550 {
552 }
553
555 {
556 #ifdef DEVELOPER
557 string code;
559 string codeNoReplace = code;
562 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
563 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
564 bool success =
g_Game.ExecuteEnforceScript(
"void scConsMain() \n{\n" + code +
"\n}\n",
"scConsMain");
567
570 #endif
571 }
572
574 {
575 if (success)
576 {
578 }
579 else
580 {
582 }
584 }
585
587 {
589 }
590
592 {
593 string code;
599 }
600
602 {
603 int history_index;
605 {
608 if (history_index > -1)
609 {
611 }
613 }
614 }
615
616
618 {
620 {
621 int history_index;
625 {
627 }
629 }
630 }
631
633 {
634 super.OnRPCEx(rpc_type, ctx);
635 #ifdef DIAG_DEVELOPER
636 switch (rpc_type)
637 {
638 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
639 {
641 {
643 }
644 break;
645 }
646 }
647 #endif
648 }
649
651 {
652 super.OnClick(w,
x,
y,button);
654 {
656 return true;
657 }
659 {
662 return true;
663 }
664
665 return false;
666 }
667
669 {
670 super.OnChange(w,
x,
y, finished);
671 return false;
672 }
673
674
676 {
677 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
678 {
679
680 }
681 else
682 {
685 }
686 }
687
688}
689
691{
693 {
695
698 {
701 }
703 }
704
706 {
707 int history_index;
709 {
712 if (history_index > -1)
713 {
715 }
717 }
718 }
719
721 {
723 {
724 int history_index;
725
729 {
731 }
733 }
734 }
735
737 {
739 {
741 return true;
742 }
744 {
747 return true;
748 }
749
750 return false;
751 }
752}
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)