PK j8j/scripts/client/PK j8j/scripts/client/autoexec/PK n9j/ÎþE_//#scripts/client/autoexec/hudmover.csfunction movehud(%hud) { if($movehudtoggle) { cancel(HM.moveschedule); $movehudtoggle=0; Canvas.getContent().remove(whiteghosthud); if($hudmover::useghosthud) { %hud.position = ghosthud.position; Canvas.getContent().remove(ghosthud); } $hudpos[%hud]=%hud.position; movehudMap.pop(); movehudMap.delete(); globalactionmap.push(); moveMap.push(); } else { moveMap.pop(); globalactionmap.pop(); new ActionMap(movehudMap); movehudMap.bindCmd(mouse, button0, "", "movehud(" @ %hud @ ");"); movehudMap.bindCmd(mouse, button1, "", "cancelmove(" @ %hud @ ");"); movehudMap.push(); $movehudtoggle=1; Canvas.getContent().add(whiteghosthud); Canvas.getContent().pushtoback(whiteghosthud); whiteghosthud.position=%hud.position; whiteghosthud.extent=%hud.extent; if($hudmover::useghosthud) { Canvas.getContent().add(ghosthud); ghosthud.position=%hud.position; ghosthud.extent=%hud.extent; moveghosthud(); } else { %hud.origpos = %hud.position; hudmovermovehud(%hud); } } } function cancelmove(%hud) { if($movehudtoggle) { cancel(HM.moveschedule); $movehudtoggle=0; Canvas.getContent().remove(whiteghosthud); if($hudmover::useghosthud) Canvas.getContent().remove(ghosthud); movehudMap.pop(); movehudMap.delete(); globalactionmap.push(); moveMap.push(); if(!$hudmover::useghosthud) { %hud.position = %hud.origpos; canvas.repaint(); } } } function moveghostHud() { ghosthud.position= canvas.getcursorpos(); canvas.repaint(); if($movehudtoggle) HM.moveschedule = schedule(50, 0, "moveghosthud"); } function hudmovermovehud(%hud) { %hud.position= canvas.getcursorpos(); canvas.repaint(); if($movehudtoggle) HM.moveschedule = schedule(50, 0, "hudmovermovehud",%hud); } function hudmover::toggle() { if($hudmover::isopen) hudmover::close(); else hudmover::open(); } function hudmover::open() { if(!$hudmover::isopen) { $hudmover::isopen=1; $hudmover::mouseOn = Canvas.isCursorOn(); canvas.pushdialog(HM); if(!$hudmover::mouseOn && $hudmover::isopen) schedule(4,0,"CursorOn"); hudmover::fillhudlist(); } } function hudmover::close() { if($hudmover::isopen) { if(Canvas.getContent().isMember(whiteghosthud)) Canvas.getContent().remove(whiteghosthud); $hudmover::isopen=0; if(!$hudmover::mouseOn) CursorOff(); canvas.popdialog(HM); canvas.repaint(); } } function hudmover::fillhudlist() { HML_Hud.clear(); for(%i=1;%i <= $hudmover::hudnum;%i++) HML_Hud.addRow(%i,$hudmover::hudname[%i]); HML_Hud.setSelectedByID(1); } function hudmover::save() { getSaveFilename( "*.map", "hudmover::savepos", $hudmover::currentmap ); } function hudmover::load() { getLoadFilename( "*.map", "hudmover::loadpos" ); } function hudmover::loadpos(%file) { $hudmover::currentmap = %file; hudmover::savecfg(); exec(%file); hudmover::sethuds(); } function hudmover::savepos(%file) { export( "$hudmover::hud*", %file, false ); export( "$hudpos*", %file, true ); $hudmover::currentmap = %file; hudmover::savecfg(); } function hudmover::savecfg() { export( "$hudmover::currentmap", "legends/prefs/hudmover.cfg" , false ); export( "$hudmover::useghosthud", "legends/prefs/hudmover.cfg", true ); } function hudmover::defaults() { $hudmover::hud1 = "HudMover"; $hudmover::hud2 = "weaponHud"; $hudmover::hud3 = "HudClock"; $hudmover::hud4 = "LagIcon"; $hudmover::hud5 = "CompassHud"; $hudmover::hud6 = "OuterChatHud"; $hudmover::hud7= "ChatMenuHud_control"; $hudmover::hud8= "MessageHud_Frame"; $hudmover::hudname1 = "HudMover"; $hudmover::hudname2 = "Weapons Hud"; $hudmover::hudname3 = "Timer"; $hudmover::hudname4 = "Lag Icon"; $hudmover::hudname5 = "Compass"; $hudmover::hudname6 = "Chat HUD"; $hudmover::hudname7 = "Voice Menu"; $hudmover::hudname8 = "Chat Input"; $hudmover::hudnum = 8; $hudposhudmover = "188 108"; $hudmover::currentmap = "legends/prefs/default.map"; $hudmover::useghosthud = 1; hudmover::savepos($hudmover::currentmap); } function hudmover::addhud(%name,%desc) { for(%i=1;%i <= $hudmover::hudnum;%i++) { if($hudmover::hud[%i] $= %name) return 0; } $hudmover::hudnum++; $hudmover::hud[$hudmover::hudnum] = %name; $hudmover::hudname[$hudmover::hudnum] = %desc; $hudpos[%name] = %name.position; hudmover::savepos($hudmover::currentmap); return 1; } function HML_Hud::onSelect(%this, %id, %text) { %hud=$hudmover::hud[%id]; Canvas.getContent().add(whiteghosthud); Canvas.getContent().pushtoback(whiteghosthud); whiteghosthud.position=%hud.position; whiteghosthud.extent=%hud.extent; } if (!isObject(HM)) { new GuiControlProfile(GuiDarkListViewProfile) { fillColor = "55 25 25"; fillColorHL = "128 128 128"; fontColor = "0 0 0"; fontColorHL = "20 40 60"; fontColorNA = "111 111 111"; fontColorLink = "200 200 200"; fontColorLinkHL = "0 0 255"; bitmap = "common/client/canvas/textList"; hasBitmapArray = true; }; new GuiControl(HM) { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; new GuiWindowCtrl(HudMover) { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = $hudpos[HudMover]; extent = "260 250"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "HudMover"; maxLength = "255"; resizeWidth = "0"; resizeHeight = "0"; canMove = "1"; canClose = "1"; canMinimize = "0"; canMaximize = "0"; minSize = "50 50"; closeCommand = "hudmover.close();"; new GuiControl() { profile = "GuiBorderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "5 29"; extent = "250 215"; minExtent = "48 92"; visible = "1"; helpTag = "0"; new GuiScrollCtrl() { profile = "GuiScrollTransparentProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 2"; extent = "164 210"; minExtent = "24 24"; visible = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "dynamic"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; childMargin = "0 0"; new GuiListViewCtrl(HML_Hud) { profile = "GuiDarkListViewProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 2"; extent = "160 8"; minExtent = "8 8"; visible = "1"; helpTag = "0"; altCommand = "movehud($hudmover::hud[HML_Hud.getSelectedId()]);"; enumerate = "0"; resizeCell = "1"; columns = "0"; fitParentWidth = "1"; clipColomnText = "0"; headertext = "Hud Name"; hasheader = "1"; }; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "165 10"; extent = "83 30"; minExtent = "32 30"; visible = "1"; command = "movehud($hudmover::hud[HML_Hud.getSelectedId()]);"; helpTag = "0"; text = "Move"; groupNum = "-1"; buttonStyle = "PushButton"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "165 40"; extent = "83 30"; minExtent = "32 30"; visible = "1"; command = "hudmover::save();"; helpTag = "0"; text = "Save"; groupNum = "-1"; buttonStyle = "PushButton"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "165 70"; extent = "83 30"; minExtent = "32 30"; visible = "1"; command = "hudmover::load();"; helpTag = "0"; text = "Load"; groupNum = "-1"; buttonStyle = "PushButton"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "165 100"; extent = "83 30"; minExtent = "32 30"; visible = "1"; command = "hudmover::defaults(); hudmover::fillhudlist();"; helpTag = "0"; text = "Defaults"; groupNum = "-1"; buttonStyle = "PushButton"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "165 130"; extent = "83 30"; minExtent = "32 30"; visible = "1"; command = "hudmover::close();"; helpTag = "0"; text = "Close"; groupNum = "-1"; buttonStyle = "PushButton"; }; new GuiCheckboxCtrl() { profile = "GuiCheckboxProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "169 165"; extent = "83 27"; minExtent = "26 27"; visible = "1"; variable = "$hudmover::useghosthud"; helpTag = "0"; text = "Ghost Huds?"; groupNum = "-1"; buttonStyle = "ToggleButton"; }; }; }; }; new GuiBarCtrl(whiteghosthud) { profile = "GuiContentProfile"; position = "0 0 "; extent = "1 1"; minExtent = "0 0"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; direction = "LeftRight"; startColor = "255 255 255 63"; endColor = "255 255 255 63"; texture = ""; value = "1"; }; new GuiBarCtrl(ghosthud) { profile = "GuiContentProfile"; position = "0 0 "; extent = "1 1"; minExtent = "0 0"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; direction = "LeftRight"; startColor = "0 0 0 178"; endColor = "0 0 0 178"; texture = ""; value = "1"; }; } function hudmover::sethuds() { for(%i = 1; %i <= $hudmover::hudnum; %i++) $hudmover::hud[%i].position=$hudpos[$hudmover::hud[%i]]; } package hudmover1 { function ui_optionsGui::onWake( %this ) { if(!$HudMoverRemap) { $RemapName[$RemapCount]="Toggle HudMover"; $RemapCmd[$RemapCount]="HM_Toggle"; $RemapCount++; $RemapName[$RemapCount]="Refresh HudMover"; $RemapCmd[$RemapCount]="HM_Refresh"; $RemapCount++; $HudMoverRemap = 1; } parent::onWake( %this ); } function HM_Refresh(%val) { if(%val) hudmover::sethuds(); } function HM_Toggle(%val) { if(%val) hudmover::toggle(); } function ClientCmdDisplayHuds() { parent::clientCmdDisplayHuds(); hudmover::sethuds(); hudmover.schedule(500,"sethuds"); } function ToggleMessageHud(%make) { parent::ToggleMessageHud(%make); hudmover::sethuds(); hudmover.schedule(500,"sethuds"); } function TeamMessageHud(%make) { parent::TeamMessageHud(%make); hudmover::sethuds(); hudmover.schedule(500,"sethuds"); } function resizeChatHud(%val) { parent::resizeChatHud(%val); hudmover::sethuds(); hudmover.schedule(500,"sethuds"); } function PlayGui::onWake(%this) { parent::onWake(%this); hudmover::sethuds(); hudmover.schedule(500,"sethuds"); } function ChatMenuHud::onWake( %this ) { parent::onWake(%this); hudmover::sethuds(); hudmover.schedule(500,"sethuds"); } function GuiControl::onsleep(%this) { if(!$hudmover::mouseOn && $hudmover::isopen) schedule(4,0,"CursorOn"); } function quit() { hudmover::savecfg(); parent::quit(); } }; activatepackage(hudmover1); if(isFile("legends/prefs/hudmover.cfg")) exec("legends/prefs/hudmover.cfg"); if($hudmover::currentmap $= "" || !isFile($hudmover::currentmap)) hudmover.defaults(); else exec($hudmover::currentmap); // Standard WeaponHud cant be moved as it is, so we change the sizing and extent. if(WeaponHud.position == "0 390") { WeaponHud.horizSizing = "right"; WeaponHud.vertSizing = "top"; WeaponHud.minextent = "200 100"; WeaponHud.extent = "200 100"; } PK j8j/scripts/client/PK j8j/-scripts/client/autoexec/PK n9j/ÎþE_//# €cscripts/client/autoexec/hudmover.csPKÔ¹/