395{
409
411
413 {
414 super.InitializeTab(root, console, button, parent);
415
421 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
422 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
426 }
427
429 {
431 }
432
434 {
437 {
440 }
442 }
443
444 static void PrintS(
string message)
445 {
449 }
450
451 static void PrintS(
bool message)
452 {
454 }
455
456 static void PrintS(
int message)
457 {
458 PrintS(message.ToString());
459 }
460
461 static void PrintS(
float message)
462 {
464 }
465
467 {
469 }
470
472 {
473 PrintS(message.ToString());
474 }
475
476
477 void Add(
string message,
bool isReload =
false)
478 {
479 if (message !=
string.
Empty)
480 {
482 {
483 if (!isReload)
487 }
488 }
489 }
490
491 protected void Clear(
bool clearFile =
false)
492 {
493 if(clearFile)
496 }
497
498
499
501 {
505 {
507 }
509 }
510
512 {
513
515 }
516
518 {
520 }
521
523 {
524 #ifdef DEVELOPER
525 string code;
527 string codeNoReplace = code;
530 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
531 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
532 bool success =
g_Game.ExecuteEnforceScript(
"void scConsMain() \n{\n" + code +
"\n}\n",
"scConsMain");
535
538 #endif
539 }
540
542 {
543 if (success)
544 {
546 }
547 else
548 {
550 }
552 }
553
555 {
557 }
558
560 {
561 string code;
567 }
568
570 {
571 int history_index;
573 {
576 if (history_index > -1)
577 {
579 }
581 }
582 }
583
584
586 {
588 {
589 int history_index;
593 {
595 }
597 }
598 }
599
601 {
602 super.OnRPCEx(rpc_type, ctx);
603 #ifdef DIAG_DEVELOPER
604 switch (rpc_type)
605 {
606 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
607 {
609 {
611 }
612 break;
613 }
614 }
615 #endif
616 }
617
619 {
620 super.OnClick(w,
x,
y,button);
622 {
624 return true;
625 }
627 {
630 return true;
631 }
632
633 return false;
634 }
635
637 {
638 super.OnChange(w,
x,
y, finished);
639 return false;
640 }
641
642
644 {
645 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
646 {
647
648 }
649 else
650 {
653 }
654 }
655
656}
657
659{
661 {
663
666 {
669 }
671 }
672
674 {
675 int history_index;
677 {
680 if (history_index > -1)
681 {
683 }
685 }
686 }
687
689 {
691 {
692 int history_index;
693
697 {
699 }
701 }
702 }
703
705 {
707 {
709 return true;
710 }
712 {
715 return true;
716 }
717
718 return false;
719 }
720}
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
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 ReloadScriptOutput()
ButtonWidget m_EnfScriptRun
void EnscriptHistoryBack()
override bool OnChange(Widget w, int x, int y, bool finished)
override void InitializeTab(Widget root, ScriptConsole console, Widget button, ScriptConsoleTabBase parent=null)
PluginLocalEnscriptHistory m_ModuleLocalEnscriptHistory
ref TStringArray m_EnscriptConsoleHistory
void ColorRunButton(bool success)
MultilineEditBoxWidget m_EnfScriptEdit
void EnscriptHistoryForward()
static ref Param1< bool > PARAM1_BOOL
static ref Param1< string > PARAM1_STRING
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 void Print(void var)
Prints content of variable to console/log.
string String(string s)
Helper for passing string expression to functions with void parameter. Example: Print(String("Hello "...
class array< Class T > TStringArray
proto int Replace(string sample, string replace)
Replace all occurrances of 'sample' in 'str' by 'replace'.
proto string Get(int index)
Gets n-th character from string.
int ARGB(int a, int r, int g, int b)