339{
353
355
357 {
358 super.InitializeTab(root, console, button, parent);
359
365 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
366 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
370 }
371
373 {
375 }
376
378 {
381 {
384 }
386 }
387
388 static void PrintS(
string message)
389 {
393 }
394
395 static void PrintS(
bool message)
396 {
398 }
399
400 static void PrintS(
int message)
401 {
402 PrintS(message.ToString());
403 }
404
405 static void PrintS(
float message)
406 {
408 }
409
411 {
413 }
414
416 {
417 PrintS(message.ToString());
418 }
419
420
421 void Add(
string message,
bool isReload =
false)
422 {
423 if (message !=
string.
Empty)
424 {
426 {
427 if (!isReload)
431 }
432 }
433 }
434
435 protected void Clear(
bool clearFile =
false)
436 {
437 if(clearFile)
440 }
441
442
443
445 {
449 {
451 }
453 }
454
456 {
457
459 }
460
462 {
464 }
465
467 {
468 #ifdef DEVELOPER
469 string code;
471 string codeNoReplace = code;
474 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
475 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
476 bool success =
g_Game.ExecuteEnforceScript(
"void scConsMain() \n{\n" + code +
"\n}\n",
"scConsMain");
479
482 #endif
483 }
484
486 {
487 if (success)
488 {
490 }
491 else
492 {
494 }
496 }
497
499 {
501 }
502
504 {
505 string code;
511 }
512
514 {
515 int history_index;
517 {
520 if (history_index > -1)
521 {
523 }
525 }
526 }
527
528
530 {
532 {
533 int history_index;
537 {
539 }
541 }
542 }
543
545 {
546 super.OnRPCEx(rpc_type, ctx);
547 #ifdef DIAG_DEVELOPER
548 switch (rpc_type)
549 {
550 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
551 {
553 {
555 }
556 break;
557 }
558 }
559 #endif
560 }
561
563 {
564 super.OnClick(w,
x,
y,button);
566 {
568 return true;
569 }
571 {
574 return true;
575 }
576
577 return false;
578 }
579
581 {
582 super.OnChange(w,
x,
y, finished);
583 return false;
584 }
585
586
588 {
589 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
590 {
591
592 }
593 else
594 {
597 }
598 }
599
600}
601
603{
605 {
607
610 {
613 }
615 }
616
618 {
619 int history_index;
621 {
624 if (history_index > -1)
625 {
627 }
629 }
630 }
631
633 {
635 {
636 int history_index;
637
641 {
643 }
645 }
646 }
647
649 {
651 {
653 return true;
654 }
656 {
659 return true;
660 }
661
662 return false;
663 }
664}
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)