410{
424
426
428 {
434 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
435 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
439 }
440
442 {
444 }
445
447 {
450 {
453 }
455 }
456
457 static void PrintS(
string message)
458 {
462 }
463
464 static void PrintS(
bool message)
465 {
467 }
468
469 static void PrintS(
int message)
470 {
471 PrintS(message.ToString());
472 }
473
474 static void PrintS(
float message)
475 {
477 }
478
480 {
482 }
483
485 {
486 PrintS(message.ToString());
487 }
488
489
490 void Add(
string message,
bool isReload =
false)
491 {
492 if (message !=
string.
Empty)
493 {
495 {
496 if (!isReload)
500 }
501 }
502 }
503
504 protected void Clear(
bool clearFile =
false)
505 {
506 if(clearFile)
509 }
510
511
512
514 {
518 {
520 }
522 }
523
525 {
526
528 }
529
531 {
533 }
534
536 {
537 #ifdef DEVELOPER
538 string code;
540 string codeNoReplace = code;
543 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
544 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
548
551 #endif
552 }
553
555 {
556 if (success)
557 {
559 }
560 else
561 {
563 }
565 }
566
568 {
570 }
571
573 {
574 string code;
580 }
581
583 {
584 int history_index;
586 {
589 if (history_index > -1)
590 {
592 }
594 }
595 }
596
597
599 {
601 {
602 int history_index;
606 {
608 }
610 }
611 }
612
614 {
615 super.OnRPCEx(rpc_type, ctx);
616 #ifdef DIAG_DEVELOPER
617 switch (rpc_type)
618 {
619 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
620 {
622 {
624 }
625 break;
626 }
627 }
628 #endif
629 }
630
632 {
633 super.OnClick(w,
x,
y,button);
635 {
637 return true;
638 }
640 {
643 return true;
644 }
645
646 return false;
647 }
648
650 {
651 super.OnChange(w,
x,
y, finished);
652 return false;
653 }
654
655
657 {
658 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
659 {
660
661 }
662 else
663 {
666 }
667 }
668
669}
670
672{
674 {
677 {
680 }
682 }
683
685 {
686 int history_index;
688 {
691 if (history_index > -1)
692 {
694 }
696 }
697 }
698
700 {
702 {
703 int history_index;
704
708 {
710 }
712 }
713 }
714
716 {
718 {
720 return true;
721 }
723 {
726 return true;
727 }
728
729 return false;
730 }
731
732}
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)