369{
383
385
387 {
393 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
394 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
398 }
399
401 {
403 }
404
406 {
409 {
412 }
414 }
415
416 static void PrintS(
string message)
417 {
421 }
422
423 static void PrintS(
bool message)
424 {
426 }
427
428 static void PrintS(
int message)
429 {
430 PrintS(message.ToString());
431 }
432
433 static void PrintS(
float message)
434 {
436 }
437
439 {
441 }
442
444 {
445 PrintS(message.ToString());
446 }
447
448
449 void Add(
string message,
bool isReload =
false)
450 {
451 if (message !=
string.
Empty)
452 {
454 {
455 if (!isReload)
459 }
460 }
461 }
462
463 protected void Clear(
bool clearFile =
false)
464 {
465 if(clearFile)
468 }
469
470
471
473 {
477 {
479 }
481 }
482
484 {
485
487 }
488
490 {
492 }
493
495 {
496 #ifdef DEVELOPER
497 string code;
499 string codeNoReplace = code;
502 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
503 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
507
510 #endif
511 }
512
514 {
515 if (success)
516 {
518 }
519 else
520 {
522 }
524 }
525
527 {
529 }
530
532 {
533 string code;
539 }
540
542 {
543 int history_index;
545 {
548 if (history_index > -1)
549 {
551 }
553 }
554 }
555
556
558 {
560 {
561 int history_index;
565 {
567 }
569 }
570 }
571
573 {
574 super.OnRPCEx(rpc_type, ctx);
575 #ifdef DIAG_DEVELOPER
576 switch (rpc_type)
577 {
578 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
579 {
581 {
583 }
584 break;
585 }
586 }
587 #endif
588 }
589
591 {
592 super.OnClick(w,
x,
y,button);
594 {
596 return true;
597 }
599 {
602 return true;
603 }
604
605 return false;
606 }
607
609 {
610 super.OnChange(w,
x,
y, finished);
611 return false;
612 }
613
614
616 {
617 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
618 {
619
620 }
621 else
622 {
625 }
626 }
627
628}
629
631{
633 {
636 {
639 }
641 }
642
644 {
645 int history_index;
647 {
650 if (history_index > -1)
651 {
653 }
655 }
656 }
657
659 {
661 {
662 int history_index;
663
667 {
669 }
671 }
672 }
673
675 {
677 {
679 return true;
680 }
682 {
685 return true;
686 }
687
688 return false;
689 }
690
691}
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)