350{
364
366
368 {
369 super.InitializeTab(root, console, button, parent);
370
376 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
377 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
381 }
382
384 {
386 }
387
389 {
392 {
395 }
397 }
398
399 static void PrintS(
string message)
400 {
404 }
405
406 static void PrintS(
bool message)
407 {
409 }
410
411 static void PrintS(
int message)
412 {
413 PrintS(message.ToString());
414 }
415
416 static void PrintS(
float message)
417 {
419 }
420
422 {
424 }
425
427 {
428 PrintS(message.ToString());
429 }
430
431
432 void Add(
string message,
bool isReload =
false)
433 {
434 if (message !=
string.
Empty)
435 {
437 {
438 if (!isReload)
442 }
443 }
444 }
445
446 protected void Clear(
bool clearFile =
false)
447 {
448 if(clearFile)
451 }
452
453
454
456 {
460 {
462 }
464 }
465
467 {
468
470 }
471
473 {
475 }
476
478 {
479 #ifdef DEVELOPER
480 string code;
482 string codeNoReplace = code;
485 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
486 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
487 bool success =
g_Game.ExecuteEnforceScript(
"void scConsMain() \n{\n" + code +
"\n}\n",
"scConsMain");
490
493 #endif
494 }
495
497 {
498 if (success)
499 {
501 }
502 else
503 {
505 }
507 }
508
510 {
512 }
513
515 {
516 string code;
522 }
523
525 {
526 int history_index;
528 {
531 if (history_index > -1)
532 {
534 }
536 }
537 }
538
539
541 {
543 {
544 int history_index;
548 {
550 }
552 }
553 }
554
556 {
557 super.OnRPCEx(rpc_type, ctx);
558 #ifdef DIAG_DEVELOPER
559 switch (rpc_type)
560 {
561 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
562 {
564 {
566 }
567 break;
568 }
569 }
570 #endif
571 }
572
574 {
575 super.OnClick(w,
x,
y,button);
577 {
579 return true;
580 }
582 {
585 return true;
586 }
587
588 return false;
589 }
590
592 {
593 super.OnChange(w,
x,
y, finished);
594 return false;
595 }
596
597
599 {
600 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
601 {
602
603 }
604 else
605 {
608 }
609 }
610
611}
612
614{
616 {
618
621 {
624 }
626 }
627
629 {
630 int history_index;
632 {
635 if (history_index > -1)
636 {
638 }
640 }
641 }
642
644 {
646 {
647 int history_index;
648
652 {
654 }
656 }
657 }
658
660 {
662 {
664 return true;
665 }
667 {
670 return true;
671 }
672
673 return false;
674 }
675}
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)