380{
394
396
398 {
404 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
405 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
409 }
410
412 {
414 }
415
417 {
420 {
423 }
425 }
426
427 static void PrintS(
string message)
428 {
432 }
433
434 static void PrintS(
bool message)
435 {
437 }
438
439 static void PrintS(
int message)
440 {
441 PrintS(message.ToString());
442 }
443
444 static void PrintS(
float message)
445 {
447 }
448
450 {
452 }
453
455 {
456 PrintS(message.ToString());
457 }
458
459
460 void Add(
string message,
bool isReload =
false)
461 {
462 if (message !=
string.
Empty)
463 {
465 {
466 if (!isReload)
470 }
471 }
472 }
473
474 protected void Clear(
bool clearFile =
false)
475 {
476 if(clearFile)
479 }
480
481
482
484 {
488 {
490 }
492 }
493
495 {
496
498 }
499
501 {
503 }
504
506 {
507 #ifdef DEVELOPER
508 string code;
510 string codeNoReplace = code;
513 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
514 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
518
521 #endif
522 }
523
525 {
526 if (success)
527 {
529 }
530 else
531 {
533 }
535 }
536
538 {
540 }
541
543 {
544 string code;
550 }
551
553 {
554 int history_index;
556 {
559 if (history_index > -1)
560 {
562 }
564 }
565 }
566
567
569 {
571 {
572 int history_index;
576 {
578 }
580 }
581 }
582
584 {
585 super.OnRPCEx(rpc_type, ctx);
586 #ifdef DIAG_DEVELOPER
587 switch (rpc_type)
588 {
589 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
590 {
592 {
594 }
595 break;
596 }
597 }
598 #endif
599 }
600
602 {
603 super.OnClick(w,
x,
y,button);
605 {
607 return true;
608 }
610 {
613 return true;
614 }
615
616 return false;
617 }
618
620 {
621 super.OnChange(w,
x,
y, finished);
622 return false;
623 }
624
625
627 {
628 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
629 {
630
631 }
632 else
633 {
636 }
637 }
638
639}
640
642{
644 {
647 {
650 }
652 }
653
655 {
656 int history_index;
658 {
661 if (history_index > -1)
662 {
664 }
666 }
667 }
668
670 {
672 {
673 int history_index;
674
678 {
680 }
682 }
683 }
684
686 {
688 {
690 return true;
691 }
693 {
696 return true;
697 }
698
699 return false;
700 }
701
702}
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)