423{
437
439
441 {
447 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
448 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
452 }
453
455 {
457 }
458
460 {
463 {
466 }
468 }
469
470 static void PrintS(
string message)
471 {
475 }
476
477 static void PrintS(
bool message)
478 {
480 }
481
482 static void PrintS(
int message)
483 {
484 PrintS(message.ToString());
485 }
486
487 static void PrintS(
float message)
488 {
490 }
491
493 {
495 }
496
498 {
499 PrintS(message.ToString());
500 }
501
502
503 void Add(
string message,
bool isReload =
false)
504 {
505 if (message !=
string.
Empty)
506 {
508 {
509 if (!isReload)
513 }
514 }
515 }
516
517 protected void Clear(
bool clearFile =
false)
518 {
519 if(clearFile)
522 }
523
524
525
527 {
531 {
533 }
535 }
536
538 {
539
541 }
542
544 {
546 }
547
549 {
550 #ifdef DEVELOPER
551 string code;
553 string codeNoReplace = code;
556 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
557 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
561
564 #endif
565 }
566
568 {
569 if (success)
570 {
572 }
573 else
574 {
576 }
578 }
579
581 {
583 }
584
586 {
587 string code;
593 }
594
596 {
597 int history_index;
599 {
602 if (history_index > -1)
603 {
605 }
607 }
608 }
609
610
612 {
614 {
615 int history_index;
619 {
621 }
623 }
624 }
625
627 {
628 super.OnRPCEx(rpc_type, ctx);
629 #ifdef DIAG_DEVELOPER
630 switch (rpc_type)
631 {
632 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
633 {
635 {
637 }
638 break;
639 }
640 }
641 #endif
642 }
643
645 {
646 super.OnClick(w,
x,
y,button);
648 {
650 return true;
651 }
653 {
656 return true;
657 }
658
659 return false;
660 }
661
663 {
664 super.OnChange(w,
x,
y, finished);
665 return false;
666 }
667
668
670 {
671 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
672 {
673
674 }
675 else
676 {
679 }
680 }
681
682}
683
685{
687 {
690 {
693 }
695 }
696
698 {
699 int history_index;
701 {
704 if (history_index > -1)
705 {
707 }
709 }
710 }
711
713 {
715 {
716 int history_index;
717
721 {
723 }
725 }
726 }
727
729 {
731 {
733 return true;
734 }
736 {
739 return true;
740 }
741
742 return false;
743 }
744
745}
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)