373{
387
389
391 {
392 super.InitializeTab(root, console, button, parent);
393
399 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
400 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
404 }
405
407 {
409 }
410
412 {
415 {
418 }
420 }
421
422 static void PrintS(
string message)
423 {
427 }
428
429 static void PrintS(
bool message)
430 {
432 }
433
434 static void PrintS(
int message)
435 {
436 PrintS(message.ToString());
437 }
438
439 static void PrintS(
float message)
440 {
442 }
443
445 {
447 }
448
450 {
451 PrintS(message.ToString());
452 }
453
454
455 void Add(
string message,
bool isReload =
false)
456 {
457 if (message !=
string.
Empty)
458 {
460 {
461 if (!isReload)
465 }
466 }
467 }
468
469 protected void Clear(
bool clearFile =
false)
470 {
471 if(clearFile)
474 }
475
476
477
479 {
483 {
485 }
487 }
488
490 {
491
493 }
494
496 {
498 }
499
501 {
502 #ifdef DEVELOPER
503 string code;
505 string codeNoReplace = code;
508 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
509 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
510 bool success =
g_Game.ExecuteEnforceScript(
"void scConsMain() \n{\n" + code +
"\n}\n",
"scConsMain");
513
516 #endif
517 }
518
520 {
521 if (success)
522 {
524 }
525 else
526 {
528 }
530 }
531
533 {
535 }
536
538 {
539 string code;
545 }
546
548 {
549 int history_index;
551 {
554 if (history_index > -1)
555 {
557 }
559 }
560 }
561
562
564 {
566 {
567 int history_index;
571 {
573 }
575 }
576 }
577
579 {
580 super.OnRPCEx(rpc_type, ctx);
581 #ifdef DIAG_DEVELOPER
582 switch (rpc_type)
583 {
584 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
585 {
587 {
589 }
590 break;
591 }
592 }
593 #endif
594 }
595
597 {
598 super.OnClick(w,
x,
y,button);
600 {
602 return true;
603 }
605 {
608 return true;
609 }
610
611 return false;
612 }
613
615 {
616 super.OnChange(w,
x,
y, finished);
617 return false;
618 }
619
620
622 {
623 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
624 {
625
626 }
627 else
628 {
631 }
632 }
633
634}
635
637{
639 {
641
644 {
647 }
649 }
650
652 {
653 int history_index;
655 {
658 if (history_index > -1)
659 {
661 }
663 }
664 }
665
667 {
669 {
670 int history_index;
671
675 {
677 }
679 }
680 }
681
683 {
685 {
687 return true;
688 }
690 {
693 return true;
694 }
695
696 return false;
697 }
698}
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)