334{
348
350
352 {
353 super.InitializeTab(root, console, button, parent);
354
360 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
361 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
365 }
366
368 {
370 }
371
373 {
376 {
379 }
381 }
382
383 static void PrintS(
string message)
384 {
388 }
389
390 static void PrintS(
bool message)
391 {
393 }
394
395 static void PrintS(
int message)
396 {
397 PrintS(message.ToString());
398 }
399
400 static void PrintS(
float message)
401 {
403 }
404
406 {
408 }
409
411 {
412 PrintS(message.ToString());
413 }
414
415
416 void Add(
string message,
bool isReload =
false)
417 {
418 if (message !=
string.
Empty)
419 {
421 {
422 if (!isReload)
426 }
427 }
428 }
429
430 protected void Clear(
bool clearFile =
false)
431 {
432 if(clearFile)
435 }
436
437
438
440 {
444 {
446 }
448 }
449
451 {
452
454 }
455
457 {
459 }
460
462 {
463 #ifdef DEVELOPER
464 string code;
466 string codeNoReplace = code;
469 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
470 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
471 bool success =
g_Game.ExecuteEnforceScript(
"void scConsMain() \n{\n" + code +
"\n}\n",
"scConsMain");
474
477 #endif
478 }
479
481 {
482 if (success)
483 {
485 }
486 else
487 {
489 }
491 }
492
494 {
496 }
497
499 {
500 string code;
506 }
507
509 {
510 int history_index;
512 {
515 if (history_index > -1)
516 {
518 }
520 }
521 }
522
523
525 {
527 {
528 int history_index;
532 {
534 }
536 }
537 }
538
540 {
541 super.OnRPCEx(rpc_type, ctx);
542 #ifdef DIAG_DEVELOPER
543 switch (rpc_type)
544 {
545 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
546 {
548 {
550 }
551 break;
552 }
553 }
554 #endif
555 }
556
558 {
559 super.OnClick(w,
x,
y,button);
561 {
563 return true;
564 }
566 {
569 return true;
570 }
571
572 return false;
573 }
574
576 {
577 super.OnChange(w,
x,
y, finished);
578 return false;
579 }
580
581
583 {
584 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
585 {
586
587 }
588 else
589 {
592 }
593 }
594
595}
596
598{
600 {
602
605 {
608 }
610 }
611
613 {
614 int history_index;
616 {
619 if (history_index > -1)
620 {
622 }
624 }
625 }
626
628 {
630 {
631 int history_index;
632
636 {
638 }
640 }
641 }
642
644 {
646 {
648 return true;
649 }
651 {
654 return true;
655 }
656
657 return false;
658 }
659}
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)