386{
400
402
404 {
410 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
411 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
415 }
416
418 {
420 }
421
423 {
426 {
429 }
431 }
432
433 static void PrintS(
string message)
434 {
438 }
439
440 static void PrintS(
bool message)
441 {
443 }
444
445 static void PrintS(
int message)
446 {
447 PrintS(message.ToString());
448 }
449
450 static void PrintS(
float message)
451 {
453 }
454
456 {
458 }
459
461 {
462 PrintS(message.ToString());
463 }
464
465
466 void Add(
string message,
bool isReload =
false)
467 {
468 if (message !=
string.
Empty)
469 {
471 {
472 if (!isReload)
476 }
477 }
478 }
479
480 protected void Clear(
bool clearFile =
false)
481 {
482 if(clearFile)
485 }
486
487
488
490 {
494 {
496 }
498 }
499
501 {
502
504 }
505
507 {
509 }
510
512 {
513 #ifdef DEVELOPER
514 string code;
516 string codeNoReplace = code;
519 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
520 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
524
527 #endif
528 }
529
531 {
532 if (success)
533 {
535 }
536 else
537 {
539 }
541 }
542
544 {
546 }
547
549 {
550 string code;
556 }
557
559 {
560 int history_index;
562 {
565 if (history_index > -1)
566 {
568 }
570 }
571 }
572
573
575 {
577 {
578 int history_index;
582 {
584 }
586 }
587 }
588
590 {
591 super.OnRPCEx(rpc_type, ctx);
592 #ifdef DIAG_DEVELOPER
593 switch (rpc_type)
594 {
595 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
596 {
598 {
600 }
601 break;
602 }
603 }
604 #endif
605 }
606
608 {
609 super.OnClick(w,
x,
y,button);
611 {
613 return true;
614 }
616 {
619 return true;
620 }
621
622 return false;
623 }
624
626 {
627 super.OnChange(w,
x,
y, finished);
628 return false;
629 }
630
631
633 {
634 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
635 {
636
637 }
638 else
639 {
642 }
643 }
644
645}
646
648{
650 {
653 {
656 }
658 }
659
661 {
662 int history_index;
664 {
667 if (history_index > -1)
668 {
670 }
672 }
673 }
674
676 {
678 {
679 int history_index;
680
684 {
686 }
688 }
689 }
690
692 {
694 {
696 return true;
697 }
699 {
702 return true;
703 }
704
705 return false;
706 }
707
708}
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)