| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- //--- OBJECT WRITE BEGIN ---
- %guiContent = new GuiWindowCtrl(NavEditorConsoleDlg) {
- text = "Nav Console";
- resizeWidth = "1";
- resizeHeight = "1";
- canMove = "1";
- canClose = "1";
- canMinimize = "1";
- canMaximize = "1";
- canCollapse = "0";
- closeCommand = "NavEditorConsoleDlg.setVisible(false);";
- edgeSnap = "1";
- margin = "0 0 0 0";
- padding = "0 0 0 0";
- anchorTop = "1";
- anchorBottom = "0";
- anchorLeft = "1";
- anchorRight = "0";
- position = "238 170";
- extent = "320 240";
- minExtent = "8 2";
- horizSizing = "right";
- vertSizing = "bottom";
- profile = "GuiWindowProfile";
- visible = "1";
- active = "1";
- tooltipProfile = "GuiToolTipProfile";
- hovertime = "1000";
- isContainer = "1";
- canSave = "1";
- canSaveDynamicFields = "1";
- new GuiTextCtrl() {
- maxLength = "1024";
- margin = "0 0 0 0";
- padding = "0 0 0 0";
- anchorTop = "1";
- anchorBottom = "0";
- anchorLeft = "1";
- anchorRight = "0";
- position = "3 222";
- extent = "149 13";
- minExtent = "8 2";
- horizSizing = "right";
- vertSizing = "top";
- profile = "GuiTextProfile";
- visible = "1";
- active = "1";
- tooltipProfile = "GuiToolTipProfile";
- hovertime = "1000";
- isContainer = "1";
- internalName = "StatusLeft";
- canSave = "1";
- canSaveDynamicFields = "0";
- };
- new GuiScrollCtrl() {
- willFirstRespond = "1";
- hScrollBar = "dynamic";
- vScrollBar = "dynamic";
- lockHorizScroll = "1";
- lockVertScroll = "0";
- constantThumbHeight = "0";
- childMargin = "0 0";
- mouseWheelScrollSpeed = "-1";
- margin = "-14 41 3 3";
- padding = "0 0 0 0";
- anchorTop = "0";
- anchorBottom = "0";
- anchorLeft = "0";
- anchorRight = "0";
- position = "3 23";
- extent = "314 194";
- minExtent = "8 2";
- horizSizing = "relative";
- vertSizing = "relative";
- profile = "GuiEditorScrollProfile";
- visible = "1";
- active = "1";
- tooltipProfile = "GuiToolTipProfile";
- hovertime = "1000";
- isContainer = "1";
- internalName = "OutputScroll";
- canSave = "1";
- canSaveDynamicFields = "0";
- new GuiListBoxCtrl() {
- allowMultipleSelections = "0";
- fitParentWidth = "1";
- colorBullet = "1";
- position = "1 1";
- extent = "312 16";
- minExtent = "8 2";
- horizSizing = "relative";
- vertSizing = "relative";
- profile = "GuiListBoxProfile";
- visible = "1";
- active = "1";
- tooltipProfile = "GuiToolTipProfile";
- hovertime = "1000";
- isContainer = "0";
- internalName = "Output";
- canSave = "1";
- canSaveDynamicFields = "0";
- };
- };
- };
- //--- OBJECT WRITE END ---
- new ScriptMsgListener(NavEditorConsoleListener);
- getNavMeshEventManager().subscribe(NavEditorConsoleListener, "NavMeshCreated");
- getNavMeshEventManager().subscribe(NavEditorConsoleListener, "NavMeshRemoved");
- getNavMeshEventManager().subscribe(NavEditorConsoleListener, "NavMeshStartUpdate");
- getNavMeshEventManager().subscribe(NavEditorConsoleListener, "NavMeshUpdate");
- getNavMeshEventManager().subscribe(NavEditorConsoleListener, "NavMeshTileUpdate");
- function NavEditorConsoleListener::onNavMeshCreated(%this, %data)
- {
- }
- function NavEditorConsoleListener::onNavMeshRemoved(%this, %data)
- {
- }
- function NavEditorConsoleListener::onNavMeshStartUpdate(%this, %data)
- {
- NavEditorConsoleDlg-->Output.clearItems();
- NavEditorConsoleDlg-->Output.addItem("Build starting for NavMesh" SPC %data, "0 0.6 0");
- NavEditorConsoleDlg-->OutputScroll.scrollToBottom();
- }
- function NavEditorConsoleListener::onNavMeshUpdate(%this, %data)
- {
- %message = "";
- if(getWordCount(%data) == 2)
- {
- %seconds = getWord(%data, 1);
- %minutes = mFloor(%seconds / 60);
- %seconds -= %minutes * 60;
- %message = "Built NavMesh" SPC getWord(%data, 0) SPC "in" SPC %minutes @ "m" SPC mRound(%seconds) @ "s";
- if(NavEditorGui.playSoundWhenDone)
- {
- sfxPlayOnce(Audio2D, "tools/navEditor/done.wav");
- }
- }
- else
- {
- %message = "Loaded NavMesh" SPC %data;
- }
- NavEditorConsoleDlg-->Output.addItem(%message, "0 0.6 0");
- NavEditorConsoleDlg-->OutputScroll.scrollToBottom();
- NavEditorConsoleDlg->StatusLeft.setText("");
- }
- function NavEditorConsoleListener::onNavMeshTileUpdate(%this, %data)
- {
- %mesh = getWord(%data, 0);
- %index = getWord(%data, 1);
- %total = getWord(%data, 2);
- %tile = getWords(%data, 3, 4);
- %success = getWord(%data, 5) == "1";
- if(!%success)
- {
- %message = "NavMesh" SPC %mesh SPC "tile" SPC %tile SPC "build failed!";
- NavEditorConsoleDlg-->Output.addItem(%message, "1 0 0");
- NavEditorConsoleDlg-->OutputScroll.scrollToBottom();
- }
- %percent = %index / %total * 100;
- NavEditorConsoleDlg->StatusLeft.setText("Build progress:" SPC mRound(%percent) @ "%");
- }
|