438{
452
454
456 {
462 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
463 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
467 }
468
470 {
472 }
473
475 {
478 {
481 }
483 }
484
485 static void PrintS(
string message)
486 {
490 }
491
492 static void PrintS(
bool message)
493 {
495 }
496
497 static void PrintS(
int message)
498 {
499 PrintS(message.ToString());
500 }
501
502 static void PrintS(
float message)
503 {
505 }
506
508 {
510 }
511
513 {
514 PrintS(message.ToString());
515 }
516
517
518 void Add(
string message,
bool isReload =
false)
519 {
520 if (message !=
string.
Empty)
521 {
523 {
524 if (!isReload)
528 }
529 }
530 }
531
532 protected void Clear(
bool clearFile =
false)
533 {
534 if(clearFile)
537 }
538
539
540
542 {
546 {
548 }
550 }
551
553 {
554
556 }
557
559 {
561 }
562
564 {
565 #ifdef DEVELOPER
566 string code;
568 string codeNoReplace = code;
571 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
572 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
576
579 #endif
580 }
581
583 {
584 if (success)
585 {
587 }
588 else
589 {
591 }
593 }
594
596 {
598 }
599
601 {
602 string code;
608 }
609
611 {
612 int history_index;
614 {
617 if (history_index > -1)
618 {
620 }
622 }
623 }
624
625
627 {
629 {
630 int history_index;
634 {
636 }
638 }
639 }
640
642 {
643 super.OnRPCEx(rpc_type, ctx);
644 #ifdef DIAG_DEVELOPER
645 switch (rpc_type)
646 {
647 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
648 {
650 {
652 }
653 break;
654 }
655 }
656 #endif
657 }
658
660 {
661 super.OnClick(w,
x,
y,button);
663 {
665 return true;
666 }
668 {
671 return true;
672 }
673
674 return false;
675 }
676
678 {
679 super.OnChange(w,
x,
y, finished);
680 return false;
681 }
682
683
685 {
686 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
687 {
688
689 }
690 else
691 {
694 }
695 }
696
697}
698
700{
702 {
705 {
708 }
710 }
711
713 {
714 int history_index;
716 {
719 if (history_index > -1)
720 {
722 }
724 }
725 }
726
728 {
730 {
731 int history_index;
732
736 {
738 }
740 }
741 }
742
744 {
746 {
748 return true;
749 }
751 {
754 return true;
755 }
756
757 return false;
758 }
759
760}
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()
proto native void RPCSingleParam(Object target, int rpc_type, Param param, bool guaranteed, PlayerIdentity recipient=null)
see CGame.RPC
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ExecuteEnforceScript(string expression, string mainFnName)
Delevoper only: Executes Enforce Script expression, if there is an error, is printed into the script ...
static ref Param1< bool > PARAM1_BOOL
static ref Param1< string > PARAM1_STRING
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
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 native CGame GetGame()
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)