360{
374
376
378 {
384 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
385 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
389 }
390
392 {
394 }
395
397 {
400 {
403 }
405 }
406
407 static void PrintS(
string message)
408 {
412 }
413
414 static void PrintS(
bool message)
415 {
417 }
418
419 static void PrintS(
int message)
420 {
421 PrintS(message.ToString());
422 }
423
424 static void PrintS(
float message)
425 {
427 }
428
430 {
432 }
433
435 {
436 PrintS(message.ToString());
437 }
438
439
440 void Add(
string message,
bool isReload =
false)
441 {
442 if (message !=
string.
Empty)
443 {
445 {
446 if (!isReload)
450 }
451 }
452 }
453
454 protected void Clear(
bool clearFile =
false)
455 {
456 if(clearFile)
459 }
460
461
462
464 {
468 {
470 }
472 }
473
475 {
476
478 }
479
481 {
483 }
484
486 {
487 #ifdef DEVELOPER
488 string code;
490 string codeNoReplace = code;
493 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
494 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
495 bool success =
g_Game.ExecuteEnforceScript(
"void scConsMain() \n{\n" + code +
"\n}\n",
"scConsMain");
498
501 #endif
502 }
503
505 {
506 if (success)
507 {
509 }
510 else
511 {
513 }
515 }
516
518 {
520 }
521
523 {
524 string code;
530 }
531
533 {
534 int history_index;
536 {
539 if (history_index > -1)
540 {
542 }
544 }
545 }
546
547
549 {
551 {
552 int history_index;
556 {
558 }
560 }
561 }
562
564 {
565 super.OnRPCEx(rpc_type, ctx);
566 #ifdef DIAG_DEVELOPER
567 switch (rpc_type)
568 {
569 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
570 {
572 {
574 }
575 break;
576 }
577 }
578 #endif
579 }
580
582 {
583 super.OnClick(w,
x,
y,button);
585 {
587 return true;
588 }
590 {
593 return true;
594 }
595
596 return false;
597 }
598
600 {
601 super.OnChange(w,
x,
y, finished);
602 return false;
603 }
604
605
607 {
608 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
609 {
610
611 }
612 else
613 {
616 }
617 }
618
619}
620
622{
624 {
627 {
630 }
632 }
633
635 {
636 int history_index;
638 {
641 if (history_index > -1)
642 {
644 }
646 }
647 }
648
650 {
652 {
653 int history_index;
654
658 {
660 }
662 }
663 }
664
666 {
668 {
670 return true;
671 }
673 {
676 return true;
677 }
678
679 return false;
680 }
681
682}
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)