// #autoload // #name = CamDistanceHUD // #version = 1.0 // #date = March 26, 2003 // #status = release // #author = LouCypher // #warrior = LouCypher // #email = asta_llama_lincoln@hotmail.com // #web = http://deadzone.cjb.net // #description = Press the CamDistanceHUD key to launch the HUD, use your mousewheel to adjust the 3rd person camera distance // #category = DioScripts // #credit = Bluez - for ChaseCam.cs // #credit = Diogenes - this script is a hack of his DioVolumeHUD // #credit = LittleWing - requested the script if(!isObject(CamDistanceHUD)) { new ScriptObject(CamDistanceHUD) { class = CamDistanceHUD; }; } package CamDistanceHUD { function CamDistanceHUD::Setup(%this){ new actionMap(camdhBinds); camdhBinds.bind(mouse0, "zaxis", CamDistanceHUDAdjust); } function CamDistanceHUDAdjust(%val){ if(%val > 0){ $pref::Player::chaseCam += 1; } else{ $pref::Player::chaseCam -= 1; } if($pref::Player::chaseCam > 50) $pref::Player::chaseCam = 0; if($pref::Player::chaseCam < 0) $pref::Player::chaseCam = 50; %distance = mfloor($pref::Player::chaseCam * 100); // 8 x 100 = 800 camdhbar.setvalue(%distance / 5000); // 800 / 100 = 8 camdhpercent.settext( $pref::Player::chaseCam ); // %distance = 800 ServerConnection.chaseCam($pref::Player::chaseCam); // error("Distance: " @ $pref::Player::chaseCam); } function CamDistanceHUDShow(%val){ if(%val){ %distance = mfloor($pref::Player::chaseCam * 100); camdhbar.setvalue(%distance / 5000); camdhpercent.settext( $pref::Player::chaseCam ); camdh.setvisible(true); camdhBinds.push(); } else{ camdh.setvisible(false); camdhBinds.pop(); ServerConnection.chaseCam($pref::Player::chaseCam); } } function camDistanceHUD::Create(%this){ if(isobject(camdh)){ camdhbar.delete(); camdhlabel.delete(); camdhpercent.delete(); camdh.delete(); } new GuiControl(camdh) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "50 200"; extent = "200 35"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiProgressCtrl(camdhbar) { profile = "BrowserProgressProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "10 5"; extent = "180 25"; minExtent = "0 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; useVariable = "0"; }; new GuiTextCtrl(camdhlabel) { profile = "BrowserFilterLabelProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "55 7"; extent = "50 26"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Distance"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl(camdhpercent) { profile = "BrowserFilterTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "115 7"; extent = "50 26"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "50%"; longTextBuffer = "0"; maxLength = "255"; }; }; if (isObject(HM) && isObject(HudMover)){ hudmover::addhud(camdh, "camDistanceHUD"); } PlayGui.add(camdh); } function LoadingGui::onWake(%this){ if (!camDistanceHUD.made) { camDistanceHUD.Create(); camDistanceHUD.made = true; } parent::onWake(%this); } function OptionsDlg::onWake( %this ){ if (!camDistanceHUD.bound) { $RemapName[$RemapCount]="CamDistanceHUD"; $RemapCmd[$RemapCount]="CamDistanceHUDShow"; $RemapCount++; camDistanceHUD.bound = true; } parent::onWake( %this ); } function PlayGui::onWake( %this ) { parent::onWake( %this ); ServerConnection.chaseCam($pref::Player::chaseCam); } }; if ( !isActivePackage(camDistanceHUD) ) activatePackage(camDistanceHUD); if($AutoloadExecuted) camDistanceHUD.Setup();