428{
442
444
446 {
452 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
453 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
457 }
458
460 {
462 }
463
465 {
468 {
471 }
473 }
474
475 static void PrintS(
string message)
476 {
480 }
481
482 static void PrintS(
bool message)
483 {
485 }
486
487 static void PrintS(
int message)
488 {
489 PrintS(message.ToString());
490 }
491
492 static void PrintS(
float message)
493 {
495 }
496
498 {
500 }
501
503 {
504 PrintS(message.ToString());
505 }
506
507
508 void Add(
string message,
bool isReload =
false)
509 {
510 if (message !=
string.
Empty)
511 {
513 {
514 if (!isReload)
518 }
519 }
520 }
521
522 protected void Clear(
bool clearFile =
false)
523 {
524 if(clearFile)
527 }
528
529
530
532 {
536 {
538 }
540 }
541
543 {
544
546 }
547
549 {
551 }
552
554 {
555 #ifdef DEVELOPER
556 string code;
558 string codeNoReplace = code;
561 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
562 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
563 bool success =
g_Game.ExecuteEnforceScript(
"void scConsMain() \n{\n" + code +
"\n}\n",
"scConsMain");
566
569 #endif
570 }
571
573 {
574 if (success)
575 {
577 }
578 else
579 {
581 }
583 }
584
586 {
588 }
589
591 {
592 string code;
598 }
599
601 {
602 int history_index;
604 {
607 if (history_index > -1)
608 {
610 }
612 }
613 }
614
615
617 {
619 {
620 int history_index;
624 {
626 }
628 }
629 }
630
632 {
633 super.OnRPCEx(rpc_type, ctx);
634 #ifdef DIAG_DEVELOPER
635 switch (rpc_type)
636 {
637 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
638 {
640 {
642 }
643 break;
644 }
645 }
646 #endif
647 }
648
650 {
651 super.OnClick(w,
x,
y,button);
653 {
655 return true;
656 }
658 {
661 return true;
662 }
663
664 return false;
665 }
666
668 {
669 super.OnChange(w,
x,
y, finished);
670 return false;
671 }
672
673
675 {
676 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
677 {
678
679 }
680 else
681 {
684 }
685 }
686
687}
688
690{
692 {
695 {
698 }
700 }
701
703 {
704 int history_index;
706 {
709 if (history_index > -1)
710 {
712 }
714 }
715 }
716
718 {
720 {
721 int history_index;
722
726 {
728 }
730 }
731 }
732
734 {
736 {
738 return true;
739 }
741 {
744 return true;
745 }
746
747 return false;
748 }
749
750}
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)