391{
405
407
409 {
415 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
416 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
420 }
421
423 {
425 }
426
428 {
431 {
434 }
436 }
437
438 static void PrintS(
string message)
439 {
443 }
444
445 static void PrintS(
bool message)
446 {
448 }
449
450 static void PrintS(
int message)
451 {
452 PrintS(message.ToString());
453 }
454
455 static void PrintS(
float message)
456 {
458 }
459
461 {
463 }
464
466 {
467 PrintS(message.ToString());
468 }
469
470
471 void Add(
string message,
bool isReload =
false)
472 {
473 if (message !=
string.
Empty)
474 {
476 {
477 if (!isReload)
481 }
482 }
483 }
484
485 protected void Clear(
bool clearFile =
false)
486 {
487 if(clearFile)
490 }
491
492
493
495 {
499 {
501 }
503 }
504
506 {
507
509 }
510
512 {
514 }
515
517 {
518 #ifdef DEVELOPER
519 string code;
521 string codeNoReplace = code;
524 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
525 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
526 bool success =
g_Game.ExecuteEnforceScript(
"void scConsMain() \n{\n" + code +
"\n}\n",
"scConsMain");
529
532 #endif
533 }
534
536 {
537 if (success)
538 {
540 }
541 else
542 {
544 }
546 }
547
549 {
551 }
552
554 {
555 string code;
561 }
562
564 {
565 int history_index;
567 {
570 if (history_index > -1)
571 {
573 }
575 }
576 }
577
578
580 {
582 {
583 int history_index;
587 {
589 }
591 }
592 }
593
595 {
596 super.OnRPCEx(rpc_type, ctx);
597 #ifdef DIAG_DEVELOPER
598 switch (rpc_type)
599 {
600 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
601 {
603 {
605 }
606 break;
607 }
608 }
609 #endif
610 }
611
613 {
614 super.OnClick(w,
x,
y,button);
616 {
618 return true;
619 }
621 {
624 return true;
625 }
626
627 return false;
628 }
629
631 {
632 super.OnChange(w,
x,
y, finished);
633 return false;
634 }
635
636
638 {
639 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
640 {
641
642 }
643 else
644 {
647 }
648 }
649
650}
651
653{
655 {
658 {
661 }
663 }
664
666 {
667 int history_index;
669 {
672 if (history_index > -1)
673 {
675 }
677 }
678 }
679
681 {
683 {
684 int history_index;
685
689 {
691 }
693 }
694 }
695
697 {
699 {
701 return true;
702 }
704 {
707 return true;
708 }
709
710 return false;
711 }
712
713}
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()
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.
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)