329{
343
345
347 {
348 super.InitializeTab(root, console, button, parent);
349
355 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
356 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
360 }
361
363 {
365 }
366
368 {
371 {
374 }
376 }
377
378 static void PrintS(
string message)
379 {
383 }
384
385 static void PrintS(
bool message)
386 {
388 }
389
390 static void PrintS(
int message)
391 {
392 PrintS(message.ToString());
393 }
394
395 static void PrintS(
float message)
396 {
398 }
399
401 {
403 }
404
406 {
407 PrintS(message.ToString());
408 }
409
410
411 void Add(
string message,
bool isReload =
false)
412 {
413 if (message !=
string.
Empty)
414 {
416 {
417 if (!isReload)
421 }
422 }
423 }
424
425 protected void Clear(
bool clearFile =
false)
426 {
427 if(clearFile)
430 }
431
432
433
435 {
439 {
441 }
443 }
444
446 {
447
449 }
450
452 {
454 }
455
457 {
458 #ifdef DEVELOPER
459 string code;
461 string codeNoReplace = code;
464 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
465 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
466 bool success =
g_Game.ExecuteEnforceScript(
"void scConsMain() \n{\n" + code +
"\n}\n",
"scConsMain");
469
472 #endif
473 }
474
476 {
477 if (success)
478 {
480 }
481 else
482 {
484 }
486 }
487
489 {
491 }
492
494 {
495 string code;
501 }
502
504 {
505 int history_index;
507 {
510 if (history_index > -1)
511 {
513 }
515 }
516 }
517
518
520 {
522 {
523 int history_index;
527 {
529 }
531 }
532 }
533
535 {
536 super.OnRPCEx(rpc_type, ctx);
537 #ifdef DIAG_DEVELOPER
538 switch (rpc_type)
539 {
540 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
541 {
543 {
545 }
546 break;
547 }
548 }
549 #endif
550 }
551
553 {
554 super.OnClick(w,
x,
y,button);
556 {
558 return true;
559 }
561 {
564 return true;
565 }
566
567 return false;
568 }
569
571 {
572 super.OnChange(w,
x,
y, finished);
573 return false;
574 }
575
576
578 {
579 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
580 {
581
582 }
583 else
584 {
587 }
588 }
589
590}
591
593{
595 {
597
600 {
603 }
605 }
606
608 {
609 int history_index;
611 {
614 if (history_index > -1)
615 {
617 }
619 }
620 }
621
623 {
625 {
626 int history_index;
627
631 {
633 }
635 }
636 }
637
639 {
641 {
643 return true;
644 }
646 {
649 return true;
650 }
651
652 return false;
653 }
654}
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)