335{
349
351
353 {
359 m_EnfScriptEdit = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"MultilineEditBoxWidget0"));
360 m_EnfScriptRun = ButtonWidget.Cast(root.FindAnyWidget(
"RunButton"));
364 }
365
367 {
369 }
370
372 {
375 {
378 }
380 }
381
382 static void PrintS(
string message)
383 {
387 }
388
389 static void PrintS(
bool message)
390 {
392 }
393
394 static void PrintS(
int message)
395 {
396 PrintS(message.ToString());
397 }
398
399 static void PrintS(
float message)
400 {
402 }
403
405 {
407 }
408
410 {
411 PrintS(message.ToString());
412 }
413
414
415 void Add(
string message,
bool isReload =
false)
416 {
417 if (message !=
string.
Empty)
418 {
420 {
421 if (!isReload)
425 }
426 }
427 }
428
429 protected void Clear(
bool clearFile =
false)
430 {
431 if(clearFile)
434 }
435
436
437
439 {
443 {
445 }
447 }
448
450 {
451
453 }
454
456 {
458 }
459
461 {
462 #ifdef DEVELOPER
463 string code;
465 string codeNoReplace = code;
468 code.
Replace(
"Print(",
"ScriptConsoleEnfScriptTab.PrintS(");
469 code.
Replace(
"Print (",
"ScriptConsoleEnfScriptTab.PrintS(");
473
476 #endif
477 }
478
480 {
481 if (success)
482 {
484 }
485 else
486 {
488 }
490 }
491
493 {
495 }
496
498 {
499 string code;
505 }
506
508 {
509 int history_index;
511 {
514 if (history_index > -1)
515 {
517 }
519 }
520 }
521
522
524 {
526 {
527 int history_index;
531 {
533 }
535 }
536 }
537
539 {
540 super.OnRPCEx(rpc_type, ctx);
541 #ifdef DIAG_DEVELOPER
542 switch (rpc_type)
543 {
544 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
545 {
547 {
549 }
550 break;
551 }
552 }
553 #endif
554 }
555
557 {
558 super.OnClick(w,
x,
y,button);
560 {
562 return true;
563 }
565 {
568 return true;
569 }
570
571 return false;
572 }
573
575 {
576 super.OnChange(w,
x,
y, finished);
577 return false;
578 }
579
580
582 {
583 if (!show && (selectedHandler.Type() ==
ScriptConsoleEnfScriptTab || selectedHandler.Type() == ScriptConsoleEnfScriptServerTab))
584 {
585
586 }
587 else
588 {
591 }
592 }
593
594}
595
597{
599 {
602 {
605 }
607 }
608
610 {
611 int history_index;
613 {
616 if (history_index > -1)
617 {
619 }
621 }
622 }
623
625 {
627 {
628 int history_index;
629
633 {
635 }
637 }
638 }
639
641 {
643 {
645 return true;
646 }
648 {
651 return true;
652 }
653
654 return false;
655 }
656
657}
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)