346{
360
362
364 {
370 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
371 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
375 }
376
378 {
380 }
381
383 {
386 {
389 }
391 }
392
393 static void PrintS(
string message)
394 {
398 }
399
400 static void PrintS(
bool message)
401 {
403 }
404
405 static void PrintS(
int message)
406 {
407 PrintS(message.ToString());
408 }
409
410 static void PrintS(
float message)
411 {
413 }
414
416 {
418 }
419
421 {
422 PrintS(message.ToString());
423 }
424
425
426 void Add(
string message,
bool isReload =
false)
427 {
428 if (message !=
string.
Empty)
429 {
431 {
432 if (!isReload)
436 }
437 }
438 }
439
440 protected void Clear(
bool clearFile =
false)
441 {
442 if(clearFile)
445 }
446
447
448
450 {
454 {
456 }
458 }
459
461 {
462
464 }
465
467 {
469 }
470
472 {
473 #ifdef DEVELOPER
474 string code;
476 string codeNoReplace = code;
479 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
480 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
484
487 #endif
488 }
489
491 {
492 if (success)
493 {
495 }
496 else
497 {
499 }
501 }
502
504 {
506 }
507
509 {
510 string code;
516 }
517
519 {
520 int history_index;
522 {
525 if (history_index > -1)
526 {
528 }
530 }
531 }
532
533
535 {
537 {
538 int history_index;
542 {
544 }
546 }
547 }
548
550 {
551 super.OnRPCEx(rpc_type, ctx);
552 #ifdef DIAG_DEVELOPER
553 switch (rpc_type)
554 {
555 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
556 {
558 {
560 }
561 break;
562 }
563 }
564 #endif
565 }
566
568 {
569 super.OnClick(w,
x,
y,button);
571 {
573 return true;
574 }
576 {
579 return true;
580 }
581
582 return false;
583 }
584
586 {
587 super.OnChange(w,
x,
y, finished);
588 return false;
589 }
590
591
593 {
594 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
595 {
596
597 }
598 else
599 {
602 }
603 }
604
605}
606
608{
610 {
613 {
616 }
618 }
619
621 {
622 int history_index;
624 {
627 if (history_index > -1)
628 {
630 }
632 }
633 }
634
636 {
638 {
639 int history_index;
640
644 {
646 }
648 }
649 }
650
652 {
654 {
656 return true;
657 }
659 {
662 return true;
663 }
664
665 return false;
666 }
667
668}
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()
proto native void RPCSingleParam(Object target, int rpc_type, Param param, bool guaranteed, PlayerIdentity recipient=null)
see CGame.RPC
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ExecuteEnforceScript(string expression, string mainFnName)
Delevoper only: Executes Enforce Script expression, if there is an error, is printed into the script ...
static ref Param1< bool > PARAM1_BOOL
static ref Param1< string > PARAM1_STRING
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
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 native CGame GetGame()
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)