340{
354
356
358 {
364 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
365 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
369 }
370
372 {
374 }
375
377 {
380 {
383 }
385 }
386
387 static void PrintS(
string message)
388 {
392 }
393
394 static void PrintS(
bool message)
395 {
397 }
398
399 static void PrintS(
int message)
400 {
401 PrintS(message.ToString());
402 }
403
404 static void PrintS(
float message)
405 {
407 }
408
410 {
412 }
413
415 {
416 PrintS(message.ToString());
417 }
418
419
420 void Add(
string message,
bool isReload =
false)
421 {
422 if (message !=
string.
Empty)
423 {
425 {
426 if (!isReload)
430 }
431 }
432 }
433
434 protected void Clear(
bool clearFile =
false)
435 {
436 if(clearFile)
439 }
440
441
442
444 {
448 {
450 }
452 }
453
455 {
456
458 }
459
461 {
463 }
464
466 {
467 #ifdef DEVELOPER
468 string code;
470 string codeNoReplace = code;
473 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
474 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
478
481 #endif
482 }
483
485 {
486 if (success)
487 {
489 }
490 else
491 {
493 }
495 }
496
498 {
500 }
501
503 {
504 string code;
510 }
511
513 {
514 int history_index;
516 {
519 if (history_index > -1)
520 {
522 }
524 }
525 }
526
527
529 {
531 {
532 int history_index;
536 {
538 }
540 }
541 }
542
544 {
545 super.OnRPCEx(rpc_type, ctx);
546 #ifdef DIAG_DEVELOPER
547 switch (rpc_type)
548 {
549 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
550 {
552 {
554 }
555 break;
556 }
557 }
558 #endif
559 }
560
562 {
563 super.OnClick(w,
x,
y,button);
565 {
567 return true;
568 }
570 {
573 return true;
574 }
575
576 return false;
577 }
578
580 {
581 super.OnChange(w,
x,
y, finished);
582 return false;
583 }
584
585
587 {
588 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
589 {
590
591 }
592 else
593 {
596 }
597 }
598
599}
600
602{
604 {
607 {
610 }
612 }
613
615 {
616 int history_index;
618 {
621 if (history_index > -1)
622 {
624 }
626 }
627 }
628
630 {
632 {
633 int history_index;
634
638 {
640 }
642 }
643 }
644
646 {
648 {
650 return true;
651 }
653 {
656 return true;
657 }
658
659 return false;
660 }
661
662}
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)