Ticket #1187: Ticket#1187_V5.patch
File Ticket#1187_V5.patch, 3.8 KB (added by , 12 years ago) |
---|
-
binaries/data/config/default.cfg
190 190 hotkey.timewarp.fastforward = Space ; If timewarp mode enabled, speed up the game 191 191 hotkey.timewarp.rewind = Backspace ; If timewarp mode enabled, go back to earlier point in the game 192 192 193 193 194 ; > OVERLAY KEYS 194 195 hotkey.fps.toggle = "Alt+F" ; Toggle frame counter 195 196 hotkey.session.devcommands.toggle = "Alt+D" ; Toggle developer commands panel 196 197 hotkey.session.gui.toggle = "Alt+G" ; Toggle visibility of session GUI 197 198 hotkey.menu.toggle = "F10" ; Toggle in-game menu 198 199 hotkey.timeelapsedcounter.toggle = "F12" ; Toggle time elapsed counter 200 hotkey.healthbars.toggle = Tab ; Toggle display of health bars 199 201 202 200 203 ; > HOTKEYS ONLY 201 204 hotkey.chat = Return ; Toggle chat window 202 205 -
binaries/data/mods/public/gui/session/input.js
52 52 var doublePressTimer = 0; 53 53 var prevHotkey = 0; 54 54 55 // Some variables for status bar hotkey 56 var entsOnScreen = {}; 57 var showStatusBars = false; 58 55 59 function updateCursor() 56 60 { 57 61 if (!mouseIsOverObject) … … 71 75 } 72 76 73 77 Engine.SetCursor("arrow-default"); 78 if(showStatusBars) 79 allStatusBars(Engine.PickFriendlyEntitiesOnScreen(Engine.GetPlayerID())); 74 80 } 75 81 76 82 function updateBuildingPlacementPreview() … … 714 720 else if (ev.type == "hotkeyup" && ev.hotkey == "timewarp.rewind") 715 721 Engine.RewindTimeWarp(); 716 722 } 723 724 if (ev.type == "hotkeydown" && ev.hotkey == "healthbars.toggle") 725 showStatusBars = true; 726 if (ev.type == "hotkeyup" && ev.hotkey == "healthbars.toggle") 727 { 728 showStatusBars = false; 729 error("Remove: " + entsOnScreen); 730 Engine.GuiInterfaceCall("SetStatusBars", { "entities":entsOnScreen, "enabled":false }); 731 Engine.GuiInterfaceCall("SetStatusBars", { "entities":Engine.PickEntitiesAtPoint(mouseX, mouseY), "enabled":true }); 732 } 717 733 718 734 // State-machine processing: 719 735 … … 1359 1375 { 1360 1376 Engine.PostNetworkCommand({"type": "unload-all", "garrisonHolder": garrisonHolder}); 1361 1377 } 1378 // Set all inactive status bars on screen to active, removes those off screen 1379 function allStatusBars(ents) 1380 { 1381 var temp = entsOnScreen; 1382 entsOnScreen = ents; 1383 for (var ent in entsOnScreen) 1384 { 1385 if (temp.indexOf(entsOnScreen[ent]) >=0) 1386 { 1387 if(temp.length == 1 && temp[0] == entsOnScreen[ent]) 1388 temp = []; 1389 temp.splice(temp.indexOf(entsOnScreen[ent]), 1); 1390 } 1391 } 1392 error("Selection: " + g_Selection.toList()); 1393 for (var ent in g_Selection.toList()) 1394 { 1395 if (entsOnScreen.indexOf(g_Selection.toList()[ent]) >=0) 1396 entsOnScreen.splice(entsOnScreen.indexOf(g_Selection.toList()[ent]), 1); 1397 if (entsOnScreen.indexOf(g_Selection.toList()[ent]) >=0) 1398 { 1399 if(temp.length == 1 && temp[i] == g_Selection.toList()[ent]) 1400 temp = {}; 1401 temp.splice(temp.indexOf(g_Selection.toList()[ent]), 1); 1402 } 1403 } 1404 for (var ent in g_Selection.toList()) 1405 { 1406 if (entsOnScreen.indexOf(g_Selection.toList()[ent]) >=0) 1407 entsOnScreen.splice(entsOnScreen.indexOf(g_Selection.toList()[ent]), 1); 1408 if (entsOnScreen.indexOf(g_Selection.toList()[ent]) >=0) 1409 { 1410 if(temp.length == 1 && temp[i] == g_Selection.toList()[ent]) 1411 temp = {}; 1412 temp.splice(temp.indexOf(g_Selection.toList()[ent]), 1); 1413 } 1414 } 1415 error("ents: " + entsOnScreen); 1416 error("temp: " + temp); 1417 Engine.GuiInterfaceCall("SetStatusBars", { "entities":entsOnScreen, "enabled":true }); 1418 Engine.GuiInterfaceCall("SetStatusBars", { "entities":temp, "enabled":false }); 1419 } 1420 No newline at end of file