330{
344
346
348 {
354 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
355 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
359 }
360
362 {
364 }
365
367 {
370 {
373 }
375 }
376
377 static void PrintS(
string message)
378 {
382 }
383
384 static void PrintS(
bool message)
385 {
387 }
388
389 static void PrintS(
int message)
390 {
391 PrintS(message.ToString());
392 }
393
394 static void PrintS(
float message)
395 {
397 }
398
400 {
402 }
403
405 {
406 PrintS(message.ToString());
407 }
408
409
410 void Add(
string message,
bool isReload =
false)
411 {
412 if (message !=
string.
Empty)
413 {
415 {
416 if (!isReload)
420 }
421 }
422 }
423
424 protected void Clear(
bool clearFile =
false)
425 {
426 if(clearFile)
429 }
430
431
432
434 {
438 {
440 }
442 }
443
445 {
446
448 }
449
451 {
453 }
454
456 {
457 #ifdef DEVELOPER
458 string code;
460 string codeNoReplace = code;
463 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
464 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
465 bool success =
g_Game.ExecuteEnforceScript(
"void scConsMain() \n{\n" + code +
"\n}\n",
"scConsMain");
468
471 #endif
472 }
473
475 {
476 if (success)
477 {
479 }
480 else
481 {
483 }
485 }
486
488 {
490 }
491
493 {
494 string code;
500 }
501
503 {
504 int history_index;
506 {
509 if (history_index > -1)
510 {
512 }
514 }
515 }
516
517
519 {
521 {
522 int history_index;
526 {
528 }
530 }
531 }
532
534 {
535 super.OnRPCEx(rpc_type, ctx);
536 #ifdef DIAG_DEVELOPER
537 switch (rpc_type)
538 {
539 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
540 {
542 {
544 }
545 break;
546 }
547 }
548 #endif
549 }
550
552 {
553 super.OnClick(w,
x,
y,button);
555 {
557 return true;
558 }
560 {
563 return true;
564 }
565
566 return false;
567 }
568
570 {
571 super.OnChange(w,
x,
y, finished);
572 return false;
573 }
574
575
577 {
578 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
579 {
580
581 }
582 else
583 {
586 }
587 }
588
589}
590
592{
594 {
597 {
600 }
602 }
603
605 {
606 int history_index;
608 {
611 if (history_index > -1)
612 {
614 }
616 }
617 }
618
620 {
622 {
623 int history_index;
624
628 {
630 }
632 }
633 }
634
636 {
638 {
640 return true;
641 }
643 {
646 return true;
647 }
648
649 return false;
650 }
651
652}
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)