ZLoy Posted February 21, 2015 Share Posted February 21, 2015 function setupXML() { com.greensock.dataTransfer.XMLParser.load("CPSSetting.xml",function($success, $parsedObject, $xml) { if(!$success) { _root.g_modeMC.debugPanel.debugTxt.text = "XML failed to load"; _root.g_modeMC.debugPanel.play(); return undefined; } config = net.produxion.util.XML2Object.deserialize($xml); setup(); _reloadAnimation = new com.nicolasprof.wot.AnimationController(g_modeMC.reloadingBarMC,60); } ); } function setup() { enableDistPanel = config.mmms.config.strategic.maxDistance.data != "true"?false:true; g_modeMC.maxDistance._visible = enableDistPanel; g_modeMC.grid1.gotoAndStop(config.mmms.config.strategic.maxDistance.data != "true"?2:1); enableExtraPanel = config.mmms.config.strategic.extraInfo.data != "true"?false:true; g_modeMC.otrPanel._visible = enableExtraPanel; enableGrid = config.mmms.config.strategic.grid.data != "true"?false:true; g_modeMC.grid1._visible = enableGrid; enableReload = config.mmms.config.strategic.reload.data != "true"?false:true; g_modeMC.reloadingBarMC._visible = enableReload; enableHealth = config.mmms.config.strategic.health.data != "true"?false:true; g_modeMC.universalBarMC._visible = enableHealth; enableSplash = config.mmms.config.strategic.splash.data != "true"?false:true; g_modeMC.circleS._visible = enableSplash; enableAnimation = config.mmms.config.strategic.animation.data != "true"?1:2; g_modeMC.reloadStatus.gotoAndStop(enableAnimation); center = config.mmms.config.strategic.center.data; g_modeMC.center.gotoAndStop(center); EnableDistPanel = config.mmms.config.strategic.DistPanel.data != "true"?false:true; g_modeMC.distPanel._visible = EnableDistPanel; enableAnglePanel = config.mmms.config.strategic.angle.data != "true"?false:true; g_modeMC.angelPanel._visible = enableAnglePanel; enableShellType = config.mmms.config.strategic.ShellType.data != "true"?false:true; normalColor = config.mmms.config.strategic.color.attributes.normalColor; dangerColor = config.mmms.config.strategic.color.attributes.dangerColor; neutralColor = config.mmms.config.strategic.color.attributes.neutralColor; type = config.mmms.config.strategic.type.data; g_modeMC.gotoAndStop(type); g_modeMC.grid2._visible = enableGrid; g_modeMC.grid2.gotoAndStop(config.mmms.config.strategic.maxDistance.data != "true"?2:1); } function onReady() { com.greensock.TweenLite.killTweensOf(g_modeMC.reloadStatus); g_modeMC.reloadStatus._alpha = 100; g_modeMC.reloadStatus._visible = true; g_modeMC.reloadStatus._xscale = g_modeMC.reloadStatus._yscale = 100; com.greensock.TweenLite.to(g_modeMC.reloadStatus,0.8,{autoAlpha:0,_xscale:400,_yscale:400,ease:com.greensock.easing.Cubic.easeOut}); } function _onRecreateDevice(width, height, offsetX, offsetY) { g_modeMC._x = 0.5 * width * (1 + offsetX); g_modeMC._y = 0.5 * height * (1 - offsetY); } function _onSetReloading(duration, startTime, isReloading, correctionPosition) { g_Reloading = [duration,startTime,isReloading]; _reloadTimer.reset(); _reloadAnimation.stop(); var _loc3_ = g_modeMC.reloadsecMC; var _loc2_ = 0; if(duration == 0) { _reloadTimer.calculate(startTime,duration); _reloadAnimation.setPosAsPercent(100); g_modeMC.holder.reloadTimer.textColor = normalColor; _loc2_ = 1; } else if(duration == -1) { _reloadTimer.textField.text = "0"; _reloadAnimation.setPosAsPercent(0); g_modeMC.holder.reloadTimer.textColor = dangerColor; _loc2_ = 1; } else if(correctionPosition > 0) { _reloadTimer.calculate(0,duration); _reloadAnimation.setPosAsPercent(correctionPosition); _reloadAnimation.restartFromCurrentFrame(duration); g_modeMC.holder.reloadTimer.textColor = dangerColor; _loc3_.reloadsec.text = Math.round(duration * 100) / 100 + " сек"; _loc2_ = Math.round(duration * 100) / 100; } else { _reloadTimer.calculate(startTime,duration); _reloadAnimation.start(duration,startTime); g_modeMC.holder.reloadTimer.textColor = dangerColor; _loc3_.reloadsec.text = Math.round(duration * 100) / 100 + " сек"; _loc2_ = Math.round(duration * 100) / 100; } if(_loc2_ != 0) { g_modeMC.reloadingPercent._alpha = 0; } } function _onSetReloadingAsPercent(percent) { g_modeMC.reloadingPercent.status.text = int(percent) + "%"; g_modeMC.reloadingPercent.status.textColor = percent != 100?dangerColor:normalColor; if(percent >= 100) { _reloadAnimation.setPosAsPercent(100); } else { _reloadAnimation.setPosAsPercent(percent); } } function _onCorrectReloadingTime(time) { var _loc1_ = g_Reloading[2]; if(_loc1_) { _reloadTimer.reset(); _reloadTimer.calculate(0,time); _reloadAnimation.stop(); _reloadAnimation.restartFromCurrentFrame(time); } } function _onSetHealth(percent) { g_modeMC.status.text = int(percent * 100) + "%"; g_modeMC.status.textColor = _colorUtil.colorByRatio(percent,dangerColor,normalColor); _universalBar.setPosAsPercent(percent * 100); } function _onSetAmmoStock(quantity, quantityInClip, isLow, clipState, clipReloaded) { wg_trace("[_onSetAmmoStock]"); var _loc1_ = g_modeMC.ammoCountMC; _loc1_.count.textColor = !isLow?neutralColor:dangerColor; _loc1_.count.text = quantity.toString(); if(!(quantityInClipBar == null) && quantityInClipBar.initialized) { quantityInClipBar.change(quantity,quantityInClip,clipState,clipReloaded); } else { net.wargaming.ingame.QuantityInClipBar.store(quantity,quantityInClip,clipState); } } function _onSetTarget(name, type, color) { wg_trace("_onSetTarget"); targetName = type; target.text = type.toString(); target.textColor = color; if(color == 13369344) { isEnemy = true; } else if(color == 5418789) { isEnemy = false; } var _loc1_ = g_modeMC; if(!isEnemy) { _loc1_.targetName.textColor = 12844904; _loc1_.otrPanel.targetName.textColor = 12844904; _loc1_.otrPanel.maxSpeed.textColor = 12844904; } else { _loc1_.targetName.textColor = 16720418; _loc1_.otrPanel.targetName.textColor = 16711680; _loc1_.otrPanel.maxSpeed.textColor = 16711680; } } function _setDefaultDistanceState() { g_modeMC.distanceLbl.text = ""; distance.text = ""; target.text = ""; g_modeMC.otrPanel.gunName.text = "Орудие:"; g_modeMC.otrPanel.shellSplash.text = "Сплеш:"; g_modeMC.otrPanel.shellName.text = "Снаряд:"; g_modeMC.otrPanel.shellSpeed.text = "Скорость снаряда:"; g_modeMC.otrPanel.heightSights.text = "Высота:"; } function _onUpdateDistance(dist) { wg_trace("[_onUpdateDistance] dist - " + dist); g_modeMC.distanceLbl.text = dist + " м"; g_modeMC.distanceLbl.textColor = neutralColor; var _loc3_ = Math.ceil(shellSpeed * shellSpeed / shellGravity); var _loc2_ = dist > _loc3_?0.785398:Math.asin(dist * shellGravity / shellSpeed * shellSpeed) * 0.5; shellTime = Math.sin(_loc2_) * shellSpeed / shellGravity * 2; flightTime.text = shellType + pp + "~" + Math.round(shellTime * 10) / 10 + " сек"; maxDistance.text = "Max: " + _loc3_.toString() + " м"; g_modeMC.circleS._width = g_modeMC.circleS._height = shellSplash * 8.5 * zoomHeight * 2; g_modeMC.angelPanel.ang.text = Math.round(_loc2_ / 3.141593 * 180) + "°"; g_modeMC.angelPanel.gun._rotation = (- _loc2_) / 3.141593 * 180; maxDist = shellSpeed * shellSpeed / shellGravity; g_modeMC.distPanel.percentLine._x = 5 + 40 * dist / maxDist; g_modeMC.distPanel.percent.text = Math.round(dist / maxDist * 100) + "%"; refreshData(dist); } function _onUpdateHeight(height) { zoomHeight = 100 / height; g_debugPanel.heightSights.text = "Высота: " + height.toString() + " м"; } function _onSetVehicleParams(gun_Name, shell_Speed, shell_Gravity, shell_Name, shell_Splash, spg_Name, shell_Type) { shellSpeed = shell_Speed; shellGravity = shell_Gravity; gunName = gun_Name; shellName = shell_Name; shellSplash = shell_Splash; g_modeMC.otrPanel.gunName.text = "Орудие: " + gun_Name.toString(); g_modeMC.otrPanel.shellSplash.text = "Сплеш: " + Math.round(shell_Splash * 100) / 100 + " м"; g_modeMC.otrPanel.shellName.text = "Снаряд: " + shell_Name.toString(); g_modeMC.otrPanel.shellSpeed.text = "Скорость снаряда: " + Math.round(shell_Speed * 100) / 100; refreshDisplay(); if(enableShellType == true) { pp = ": "; if(shell_Type == "AP") { shellType = "ББ"; } else if(shell_Type == "HE") { shellType = "ОФ"; } else if(shell_Type == "CR") { shellType = "БП"; } else if(shell_Type == "HC") { shellType = "КС"; } else { shellType = ""; pp = ""; } } else { shellType = ""; pp = ""; } } function _setDefaultTargetState() { g_modeMC.reloadStatus._alpha = 0; g_modeMC.reloadStatus._visible = false; } function _onSetClipParams(clipCapacity, burst) { wg_trace("[_onSetClipCapacity]"); if(g_ClipCapacity == clipCapacity) { return undefined; } g_ClipCapacity = clipCapacity; if(g_ClipCapacity > 1) { var _loc1_ = g_modeMC.cassette; if(!(_loc1_ == null) && quantityInClipBar == null) { quantityInClipBar = net.wargaming.ingame.QuantityInClipBar.create(_loc1_,g_ClipCapacity,burst); } } } com.greensock.OverwriteManager.init(com.greensock.OverwriteManager.AUTO); com.greensock.plugins.TweenPlugin.activate([com.greensock.plugins.AutoAlphaPlugin]); setupXML(); var config; var enableAnglePanel = true; var enableDistPanel = false; var enableExtraPanel = false; var quant; var shellName; var shellSpeed; var shellGravity; var shellSplash; var zoomHeight = 1; var targetName = ""; var flightTimeSettings; var distanceSettings; var maxDistanceSettings; var circleSSettings; var targetNameSettings; var distance = g_modeMC.distanceLbl; var target = g_modeMC.targetName; var flightTime = g_modeMC.flightTime; var maxDistance = g_modeMC.maxDistance; var g_debugPanel = g_modeMC.otrPanel; var g_circleS = g_modeMC.circleS; var maxDist = 0; gfx.io.GameDelegate.addCallBack("Aim.onRecreateDevice",variable_1,"_onRecreateDevice"); gfx.io.GameDelegate.addCallBack("Aim.setReloading",variable_1,"_onSetReloading"); gfx.io.GameDelegate.addCallBack("Aim.correctReloadingTime",variable_1,"_onCorrectReloadingTime"); gfx.io.GameDelegate.addCallBack("Aim.setHealth",variable_1,"_onSetHealth"); gfx.io.GameDelegate.addCallBack("Aim.setAmmoStock",variable_1,"_onSetAmmoStock"); gfx.io.GameDelegate.addCallBack("Aim.setClipParams",variable_1,"_onSetClipParams"); gfx.io.GameDelegate.addCallBack("Aim.setReloadingAsPercent",variable_1,"_onSetReloadingAsPercent"); gfx.io.GameDelegate.addCallBack("Aim.setTarget",variable_1,"_onSetTarget"); gfx.io.GameDelegate.addCallBack("Aim.updateDistance",variable_1,"_onUpdateDistance"); gfx.io.GameDelegate.addCallBack("Aim.vehicleParams",variable_1,"_onSetVehicleParams"); gfx.io.GameDelegate.addCallBack("Aim.heightSight",variable_1,"_onUpdateHeight"); var g_debugEnabled = false; var g_Reloading = [0,0,false]; var normalColor; var dangerColor; var neutralColor; var _reloadTimer; var _colorUtil; var g_ClipCapacity = 1; var quantityInClipBar = null; var _reloadAnimation; onLoad = function() { _setDefaultTargetState(); _setDefaultDistanceState(); _onSetAmmoStock(0,0,true,"critical"); _reloadTimer = new com.nicolasprof.wot.ReloadTimer(g_modeMC.holder.reloadTimer,this.onReady); _colorUtil = new com.nicolasprof.wot.utils.ColorUtil(); _reloadAnimation = new MovieClip(); loadConfigFile(); }; _universalBar = new com.nicolasprof.wot.AnimationController(g_modeMC.universalBarMC,60); Stage.scaleMode = "noScale"; Stage.align = "TL"; Вот АРТ прицел помогите сменить координаты чтоб не смещало в право прицел ! crosshair_panel_strategic.swf @ Quote Link to comment Short link Share on other sites More sharing options...
KACTET Posted February 21, 2015 Share Posted February 21, 2015 (edited) function _onRecreateDevice(width, height, offsetX, offsetY) { g_modeMC._x = 0.5 * width * (1 + offsetX); g_modeMC._y = 0.5 * height * (1 - offsetY); } НА ЭТО МЕНЯТЬ function _onRecreateDevice(posX, posY) { g_modeMC._x = posX; g_modeMC._y = posY; } // End of the function Edited February 21, 2015 by KACTET @ Quote Link to comment Short link Share on other sites More sharing options...
ZLoy Posted February 22, 2015 Author Share Posted February 22, 2015 Поменял вся доп.инфа перестает работать и прицел так и остается на месте function setupXML() { com.greensock.dataTransfer.XMLParser.load("CPSSetting.xml",function($success, $parsedObject, $xml) { if(!$success) { _root.g_modeMC.debugPanel.debugTxt.text = "XML failed to load"; _root.g_modeMC.debugPanel.play(); return undefined; } config = net.produxion.util.XML2Object.deserialize($xml); setup(); _reloadAnimation = new com.nicolasprof.wot.AnimationController(g_modeMC.reloadingBarMC,60); } ); } function setup() { enableDistPanel = config.mmms.config.strategic.maxDistance.data != "true"?false:true; g_modeMC.maxDistance._visible = enableDistPanel; g_modeMC.grid1.gotoAndStop(config.mmms.config.strategic.maxDistance.data != "true"?2:1); enableExtraPanel = config.mmms.config.strategic.extraInfo.data != "true"?false:true; g_modeMC.otrPanel._visible = enableExtraPanel; enableGrid = config.mmms.config.strategic.grid.data != "true"?false:true; g_modeMC.grid1._visible = enableGrid; enableReload = config.mmms.config.strategic.reload.data != "true"?false:true; g_modeMC.reloadingBarMC._visible = enableReload; enableHealth = config.mmms.config.strategic.health.data != "true"?false:true; g_modeMC.universalBarMC._visible = enableHealth; enableSplash = config.mmms.config.strategic.splash.data != "true"?false:true; g_modeMC.circleS._visible = enableSplash; enableAnimation = config.mmms.config.strategic.animation.data != "true"?1:2; g_modeMC.reloadStatus.gotoAndStop(enableAnimation); center = config.mmms.config.strategic.center.data; g_modeMC.center.gotoAndStop(center); EnableDistPanel = config.mmms.config.strategic.DistPanel.data != "true"?false:true; g_modeMC.distPanel._visible = EnableDistPanel; enableAnglePanel = config.mmms.config.strategic.angle.data != "true"?false:true; g_modeMC.angelPanel._visible = enableAnglePanel; enableShellType = config.mmms.config.strategic.ShellType.data != "true"?false:true; normalColor = config.mmms.config.strategic.color.attributes.normalColor; dangerColor = config.mmms.config.strategic.color.attributes.dangerColor; neutralColor = config.mmms.config.strategic.color.attributes.neutralColor; type = config.mmms.config.strategic.type.data; g_modeMC.gotoAndStop(type); g_modeMC.grid2._visible = enableGrid; g_modeMC.grid2.gotoAndStop(config.mmms.config.strategic.maxDistance.data != "true"?2:1); } function onReady() { com.greensock.TweenLite.killTweensOf(g_modeMC.reloadStatus); g_modeMC.reloadStatus._alpha = 100; g_modeMC.reloadStatus._visible = true; g_modeMC.reloadStatus._xscale = g_modeMC.reloadStatus._yscale = 100; com.greensock.TweenLite.to(g_modeMC.reloadStatus,0.8,{autoAlpha:0,_xscale:400,_yscale:400,ease:com.greensock.easing.Cubic.easeOut}); } function _onRecreateDevice(posX, posY) { g_modeMC._x = posX; g_modeMC._y = posY; } function _onSetReloading(duration, startTime, isReloading, correctionPosition) { g_Reloading = [duration,startTime,isReloading]; _reloadTimer.reset(); _reloadAnimation.stop(); var _loc5_ = g_modeMC.reloadsecMC; var _loc6_ = 0; if(duration == 0) { _reloadTimer.calculate(startTime,duration); _reloadAnimation.setPosAsPercent(100); g_modeMC.holder.reloadTimer.textColor = normalColor; _loc6_ = 1; } else if(duration == -1) { _reloadTimer.textField.text = "0"; _reloadAnimation.setPosAsPercent(0); g_modeMC.holder.reloadTimer.textColor = dangerColor; _loc6_ = 1; } else if(correctionPosition > 0) { _reloadTimer.calculate(0,duration); _reloadAnimation.setPosAsPercent(correctionPosition); _reloadAnimation.restartFromCurrentFrame(duration); g_modeMC.holder.reloadTimer.textColor = dangerColor; _loc5_.reloadsec.text = Math.round(duration * 100) / 100 + " сек"; _loc6_ = Math.round(duration * 100) / 100; } else { _reloadTimer.calculate(startTime,duration); _reloadAnimation.start(duration,startTime); g_modeMC.holder.reloadTimer.textColor = dangerColor; _loc5_.reloadsec.text = Math.round(duration * 100) / 100 + " сек"; _loc6_ = Math.round(duration * 100) / 100; } if(_loc6_ != 0) { g_modeMC.reloadingPercent._alpha = 0; } } function _onSetReloadingAsPercent(percent) { g_modeMC.reloadingPercent.status.text = int(percent) + "%"; g_modeMC.reloadingPercent.status.textColor = percent != 100?dangerColor:normalColor; if(percent >= 100) { _reloadAnimation.setPosAsPercent(100); } else { _reloadAnimation.setPosAsPercent(percent); } } function _onCorrectReloadingTime(time) { var _loc2_ = g_Reloading[2]; if(_loc2_) { _reloadTimer.reset(); _reloadTimer.calculate(0,time); _reloadAnimation.stop(); _reloadAnimation.restartFromCurrentFrame(time); } } function _onSetHealth(percent) { g_modeMC.status.text = int(percent * 100) + "%"; g_modeMC.status.textColor = _colorUtil.colorByRatio(percent,dangerColor,normalColor); _universalBar.setPosAsPercent(percent * 100); } function _onSetAmmoStock(quantity, quantityInClip, isLow, clipState, clipReloaded) { wg_trace("[_onSetAmmoStock]"); var _loc6_ = g_modeMC.ammoCountMC; _loc6_.count.textColor = !isLow?neutralColor:dangerColor; _loc6_.count.text = quantity.toString(); if(!(quantityInClipBar == null) && quantityInClipBar.initialized) { quantityInClipBar.change(quantity,quantityInClip,clipState,clipReloaded); } else { net.wargaming.ingame.QuantityInClipBar.store(quantity,quantityInClip,clipState); } } function _onSetTarget(name, type, color) { wg_trace("_onSetTarget"); targetName = type; target.text = type.toString(); target.textColor = color; if(color == 13369344) { isEnemy = true; } else if(color == 5418789) { isEnemy = false; } var _loc4_ = g_modeMC; if(!isEnemy) { _loc4_.targetName.textColor = 12844904; _loc4_.otrPanel.targetName.textColor = 12844904; _loc4_.otrPanel.maxSpeed.textColor = 12844904; } else { _loc4_.targetName.textColor = 16720418; _loc4_.otrPanel.targetName.textColor = 16711680; _loc4_.otrPanel.maxSpeed.textColor = 16711680; } } function _setDefaultDistanceState() { g_modeMC.distanceLbl.text = ""; distance.text = ""; target.text = ""; g_modeMC.otrPanel.gunName.text = "Орудие:"; g_modeMC.otrPanel.shellSplash.text = "Сплеш:"; g_modeMC.otrPanel.shellName.text = "Снаряд:"; g_modeMC.otrPanel.shellSpeed.text = "Скорость снаряда:"; g_modeMC.otrPanel.heightSights.text = "Высота:"; } function _onUpdateDistance(dist) { wg_trace("[_onUpdateDistance] dist - " + dist); g_modeMC.distanceLbl.text = dist + " м"; g_modeMC.distanceLbl.textColor = neutralColor; var _loc2_ = Math.ceil(shellSpeed * shellSpeed / shellGravity); var _loc3_ = dist > _loc2_?0.785398:Math.asin(dist * shellGravity / shellSpeed * shellSpeed) * 0.5; shellTime = Math.sin(_loc3_) * shellSpeed / shellGravity * 2; flightTime.text = shellType + pp + "~" + Math.round(shellTime * 10) / 10 + " сек"; maxDistance.text = "Max: " + _loc2_.toString() + " м"; g_modeMC.circleS._width = g_modeMC.circleS._height = shellSplash * 8.5 * zoomHeight * 2; g_modeMC.angelPanel.ang.text = Math.round(_loc3_ / 3.141593 * 180) + "°"; g_modeMC.angelPanel.gun._rotation = (- _loc3_) / 3.141593 * 180; maxDist = shellSpeed * shellSpeed / shellGravity; g_modeMC.distPanel.percentLine._x = 5 + 40 * dist / maxDist; g_modeMC.distPanel.percent.text = Math.round(dist / maxDist * 100) + "%"; refreshData(dist); } function _onUpdateHeight(height) { zoomHeight = 100 / height; g_debugPanel.heightSights.text = "Высота: " + height.toString() + " м"; } function _onSetVehicleParams(gun_Name, shell_Speed, shell_Gravity, shell_Name, shell_Splash, spg_Name, shell_Type) { shellSpeed = shell_Speed; shellGravity = shell_Gravity; gunName = gun_Name; shellName = shell_Name; shellSplash = shell_Splash; g_modeMC.otrPanel.gunName.text = "Орудие: " + gun_Name.toString(); g_modeMC.otrPanel.shellSplash.text = "Сплеш: " + Math.round(shell_Splash * 100) / 100 + " м"; g_modeMC.otrPanel.shellName.text = "Снаряд: " + shell_Name.toString(); g_modeMC.otrPanel.shellSpeed.text = "Скорость снаряда: " + Math.round(shell_Speed * 100) / 100; refreshDisplay(); if(enableShellType == true) { pp = ": "; if(shell_Type == "AP") { shellType = "ББ"; } else if(shell_Type == "HE") { shellType = "ОФ"; } else if(shell_Type == "CR") { shellType = "БП"; } else if(shell_Type == "HC") { shellType = "КС"; } else { shellType = ""; pp = ""; } } else { shellType = ""; pp = ""; } } function _setDefaultTargetState() { g_modeMC.reloadStatus._alpha = 0; g_modeMC.reloadStatus._visible = false; } function _onSetClipParams(clipCapacity, burst) { wg_trace("[_onSetClipCapacity]"); if(g_ClipCapacity == clipCapacity) { return undefined; } g_ClipCapacity = clipCapacity; if(g_ClipCapacity > 1) { var _loc3_ = g_modeMC.cassette; if(!(_loc3_ == null) && quantityInClipBar == null) { quantityInClipBar = net.wargaming.ingame.QuantityInClipBar.create(_loc3_,g_ClipCapacity,burst); } } } com.greensock.OverwriteManager.init(com.greensock.OverwriteManager.AUTO); com.greensock.plugins.TweenPlugin.activate([com.greensock.plugins.AutoAlphaPlugin]); setupXML(); var config; var enableAnglePanel = true; var enableDistPanel = false; var enableExtraPanel = false; var quant; var shellName; var shellSpeed; var shellGravity; var shellSplash; var zoomHeight = 1; var targetName = ""; var flightTimeSettings; var distanceSettings; var maxDistanceSettings; var circleSSettings; var targetNameSettings; var distance = g_modeMC.distanceLbl; var target = g_modeMC.targetName; var flightTime = g_modeMC.flightTime; var maxDistance = g_modeMC.maxDistance; var g_debugPanel = g_modeMC.otrPanel; var g_circleS = g_modeMC.circleS; var maxDist = 0; gfx.io.GameDelegate.addCallBack("Aim.onRecreateDevice",variable_1,"_onRecreateDevice"); gfx.io.GameDelegate.addCallBack("Aim.setReloading",variable_1,"_onSetReloading"); gfx.io.GameDelegate.addCallBack("Aim.correctReloadingTime",variable_1,"_onCorrectReloadingTime"); gfx.io.GameDelegate.addCallBack("Aim.setHealth",variable_1,"_onSetHealth"); gfx.io.GameDelegate.addCallBack("Aim.setAmmoStock",variable_1,"_onSetAmmoStock"); gfx.io.GameDelegate.addCallBack("Aim.setClipParams",variable_1,"_onSetClipParams"); gfx.io.GameDelegate.addCallBack("Aim.setReloadingAsPercent",variable_1,"_onSetReloadingAsPercent"); gfx.io.GameDelegate.addCallBack("Aim.setTarget",variable_1,"_onSetTarget"); gfx.io.GameDelegate.addCallBack("Aim.updateDistance",variable_1,"_onUpdateDistance"); gfx.io.GameDelegate.addCallBack("Aim.vehicleParams",variable_1,"_onSetVehicleParams"); gfx.io.GameDelegate.addCallBack("Aim.heightSight",variable_1,"_onUpdateHeight"); var g_debugEnabled = false; var g_Reloading = [0,0,false]; var normalColor; var dangerColor; var neutralColor; var _reloadTimer; var _colorUtil; var g_ClipCapacity = 1; var quantityInClipBar = null; var _reloadAnimation; onLoad = function() { _setDefaultTargetState(); _setDefaultDistanceState(); _onSetAmmoStock(0,0,true,"critical"); _reloadTimer = new com.nicolasprof.wot.ReloadTimer(g_modeMC.holder.reloadTimer,this.onReady); _colorUtil = new com.nicolasprof.wot.utils.ColorUtil(); _reloadAnimation = new MovieClip(); loadConfigFile(); }; _universalBar = new com.nicolasprof.wot.AnimationController(g_modeMC.universalBarMC,60); Stage.scaleMode = "noScale"; Stage.align = "TL"; @ Quote Link to comment Short link Share on other sites More sharing options...
tunut Posted February 22, 2015 Share Posted February 22, 2015 crosshair_panel_strategic.swf 1 @ Quote Link to comment Short link Share on other sites More sharing options...
ZLoy Posted February 22, 2015 Author Share Posted February 22, 2015 (edited) crosshair_panel_strategic.swf Все гуд но, до этого работало ! Edited February 22, 2015 by ZLoy @ Quote Link to comment Short link Share on other sites More sharing options...
tunut Posted February 22, 2015 Share Posted February 22, 2015 но, до этого работало ! эти расчеты из скрипта идут, во флеше только чтобы в влево не уходил можно фиксить @ Quote Link to comment Short link Share on other sites More sharing options...
ZLoy Posted February 22, 2015 Author Share Posted February 22, 2015 эти расчеты из скрипта идут, во флеше только чтобы в влево не уходил можно фиксить Вы его сами переделали или взяли из модпака протанки? @ Quote Link to comment Short link Share on other sites More sharing options...
tunut Posted February 22, 2015 Share Posted February 22, 2015 сам @ Quote Link to comment Short link Share on other sites More sharing options...
ZLoy Posted February 22, 2015 Author Share Posted February 22, 2015 сам Извините если обидел недоверием ! ! ! Я использую этот скрипт скаченный с евро с ним все норм и он все показывает но прицел смещен я понемаю что можно включить фикс и все будет ок! Но после ваших изменений пропали расчеты (показаны выше на скрине) В чем может быть проблема? @ Quote Link to comment Short link Share on other sites More sharing options...
tunut Posted February 22, 2015 Share Posted February 22, 2015 (edited) значит у прицела обфусцированный код, правально пересобрать не получиться. вывод = пользоваться дальше фиксом sights или версией протанков Edited February 22, 2015 by tunut @ Quote Link to comment Short link Share on other sites More sharing options...
ZLoy Posted February 22, 2015 Author Share Posted February 22, 2015 значит у прицела обфусцированный код, правально пересобрать не получиться. вывод = пользоваться дальше фиксом sights или версией протанков Спасибо Вам за отзывчивость и за помощь , если Вас не затруднит еще один вопрос ! Пользуюсь этим сведением crosshair_sniper.swf в нем были надписи тонкая , средняя , толстая броня и потом сам показатель брони , я решил схитрить и убрал надписи думая что показатель сдвинется на место надписей но этого не произошло, как мне сдвинуть показатель ближе к центру ? @ Quote Link to comment Short link Share on other sites More sharing options...
tunut Posted February 22, 2015 Share Posted February 22, 2015 а почему бы не обратиться к автору сведения ? http://forum.worldoftanks.ru/index.php?/topic/1419789- человек активно помогает,с разными переделками и добавками, пользователям его творения @ Quote Link to comment Short link Share on other sites More sharing options...
ZLoy Posted March 13, 2015 Author Share Posted March 13, 2015 Обратился к автору по вашему совету так он мне и не ответил, может Вы поможите ? а почему бы не обратиться к автору сведения ? http://forum.worldoftanks.ru/index.php?/topic/1419789- человек активно помогает,с разными переделками и добавками, пользователям его творения @ Quote Link to comment Short link Share on other sites More sharing options...
chump Posted March 13, 2015 Share Posted March 13, 2015 Все гуд но, до этого работало ! shot_011.png Декломпилятор со скобками запутывается и немного корёжит код, из за этого не правильно всё считается. Вторая строка проблемная: var _loc3_ = Math.ceil(shellSpeed * shellSpeed / shellGravity); var _loc2_ = dist > _loc3_?0.785398:Math.asin(dist * shellGravity / shellSpeed * shellSpeed) * 0.5; Замени примерно на такое: var _loc3_ = Math.ceil(shellSpeed * shellSpeed / shellGravity); var shellSpeed2 = shellSpeed * shellSpeed; var _loc2_ = dist > _loc3_?0.785398:Math.asin(dist * shellGravity / shellSpeed2 ) * 0.5; Это в функции _onUpdateDistance. @ Quote Link to comment Short link Share on other sites More sharing options...
norkas Posted March 13, 2015 Share Posted March 13, 2015 (edited) /del Edited March 13, 2015 by norkas @ Quote Link to comment Short link Share on other sites More sharing options...
ZLoy Posted March 13, 2015 Author Share Posted March 13, 2015 (edited) Декломпилятор со скобками запутывается и немного корёжит код, из за этого не правильно всё считается. Вторая строка проблемная: var _loc3_ = Math.ceil(shellSpeed * shellSpeed / shellGravity); var _loc2_ = dist > _loc3_?0.785398:Math.asin(dist * shellGravity / shellSpeed * shellSpeed) * 0.5; Замени примерно на такое: var _loc3_ = Math.ceil(shellSpeed * shellSpeed / shellGravity); var shellSpeed2 = shellSpeed * shellSpeed; var _loc2_ = dist > _loc3_?0.785398:Math.asin(dist * shellGravity / shellSpeed2 ) * 0.5; Это в функции _onUpdateDistance. Время полета одно и тоже не меняется с расстоянием и угол орудия тоже хер что отображает :( function setupXML() { com.greensock.dataTransfer.XMLParser.load("CPSSetting.xml",function($success, $parsedObject, $xml) { if(!$success) { _root.g_modeMC.debugPanel.debugTxt.text = "XML failed to load"; _root.g_modeMC.debugPanel.play(); return undefined; } config = net.produxion.util.XML2Object.deserialize($xml); setup(); _reloadAnimation = new com.nicolasprof.wot.AnimationController(g_modeMC.reloadingBarMC,60); } ); } function setup() { enableDistPanel = config.mmms.config.strategic.maxDistance.data != "true"?false:true; g_modeMC.maxDistance._visible = enableDistPanel; g_modeMC.grid1.gotoAndStop(config.mmms.config.strategic.maxDistance.data != "true"?2:1); enableExtraPanel = config.mmms.config.strategic.extraInfo.data != "true"?false:true; g_modeMC.otrPanel._visible = enableExtraPanel; enableGrid = config.mmms.config.strategic.grid.data != "true"?false:true; g_modeMC.grid1._visible = enableGrid; enableReload = config.mmms.config.strategic.reload.data != "true"?false:true; g_modeMC.reloadingBarMC._visible = enableReload; enableHealth = config.mmms.config.strategic.health.data != "true"?false:true; g_modeMC.universalBarMC._visible = enableHealth; enableSplash = config.mmms.config.strategic.splash.data != "true"?false:true; g_modeMC.circleS._visible = enableSplash; enableAnimation = config.mmms.config.strategic.animation.data != "true"?1:2; g_modeMC.reloadStatus.gotoAndStop(enableAnimation); center = config.mmms.config.strategic.center.data; g_modeMC.center.gotoAndStop(center); EnableDistPanel = config.mmms.config.strategic.DistPanel.data != "true"?false:true; g_modeMC.distPanel._visible = EnableDistPanel; enableAnglePanel = config.mmms.config.strategic.angle.data != "true"?false:true; g_modeMC.angelPanel._visible = enableAnglePanel; enableShellType = config.mmms.config.strategic.ShellType.data != "true"?false:true; normalColor = config.mmms.config.strategic.color.attributes.normalColor; dangerColor = config.mmms.config.strategic.color.attributes.dangerColor; neutralColor = config.mmms.config.strategic.color.attributes.neutralColor; type = config.mmms.config.strategic.type.data; g_modeMC.gotoAndStop(type); g_modeMC.grid2._visible = enableGrid; g_modeMC.grid2.gotoAndStop(config.mmms.config.strategic.maxDistance.data != "true"?2:1); } function onReady() { com.greensock.TweenLite.killTweensOf(g_modeMC.reloadStatus); g_modeMC.reloadStatus._alpha = 100; g_modeMC.reloadStatus._visible = true; g_modeMC.reloadStatus._xscale = g_modeMC.reloadStatus._yscale = 100; com.greensock.TweenLite.to(g_modeMC.reloadStatus,0.8,{autoAlpha:0,_xscale:400,_yscale:400,ease:com.greensock.easing.Cubic.easeOut}); } function _onRecreateDevice(posX, posY) { g_modeMC._x = posX; g_modeMC._y = posY; } function _onSetReloading(duration, startTime, isReloading, correctionPosition) { g_Reloading = [duration,startTime,isReloading]; _reloadTimer.reset(); _reloadAnimation.stop(); var _loc5_ = g_modeMC.reloadsecMC; var _loc6_ = 0; if(duration == 0) { _reloadTimer.calculate(startTime,duration); _reloadAnimation.setPosAsPercent(100); g_modeMC.holder.reloadTimer.textColor = normalColor; _loc6_ = 1; } else if(duration == -1) { _reloadTimer.textField.text = "0"; _reloadAnimation.setPosAsPercent(0); g_modeMC.holder.reloadTimer.textColor = dangerColor; _loc6_ = 1; } else if(correctionPosition > 0) { _reloadTimer.calculate(0,duration); _reloadAnimation.setPosAsPercent(correctionPosition); _reloadAnimation.restartFromCurrentFrame(duration); g_modeMC.holder.reloadTimer.textColor = dangerColor; _loc5_.reloadsec.text = Math.round(duration * 100) / 100 + " сек"; _loc6_ = Math.round(duration * 100) / 100; } else { _reloadTimer.calculate(startTime,duration); _reloadAnimation.start(duration,startTime); g_modeMC.holder.reloadTimer.textColor = dangerColor; _loc5_.reloadsec.text = Math.round(duration * 100) / 100 + " сек"; _loc6_ = Math.round(duration * 100) / 100; } if(_loc6_ != 0) { g_modeMC.reloadingPercent._alpha = 0; } } function _onSetReloadingAsPercent(percent) { g_modeMC.reloadingPercent.status.text = int(percent) + "%"; g_modeMC.reloadingPercent.status.textColor = percent != 100?dangerColor:normalColor; if(percent >= 100) { _reloadAnimation.setPosAsPercent(100); } else { _reloadAnimation.setPosAsPercent(percent); } } function _onCorrectReloadingTime(time) { var _loc2_ = g_Reloading[2]; if(_loc2_) { _reloadTimer.reset(); _reloadTimer.calculate(0,time); _reloadAnimation.stop(); _reloadAnimation.restartFromCurrentFrame(time); } } function _onSetHealth(percent) { g_modeMC.status.text = int(percent * 100) + "%"; g_modeMC.status.textColor = _colorUtil.colorByRatio(percent,dangerColor,normalColor); _universalBar.setPosAsPercent(percent * 100); } function _onSetAmmoStock(quantity, quantityInClip, isLow, clipState, clipReloaded) { wg_trace("[_onSetAmmoStock]"); var _loc6_ = g_modeMC.ammoCountMC; _loc6_.count.textColor = !isLow?neutralColor:dangerColor; _loc6_.count.text = quantity.toString(); if(!(quantityInClipBar == null) && quantityInClipBar.initialized) { quantityInClipBar.change(quantity,quantityInClip,clipState,clipReloaded); } else { net.wargaming.ingame.QuantityInClipBar.store(quantity,quantityInClip,clipState); } } function _onSetTarget(name, type, color) { wg_trace("_onSetTarget"); targetName = type; target.text = type.toString(); target.textColor = color; if(color == 13369344) { isEnemy = true; } else if(color == 5418789) { isEnemy = false; } var _loc4_ = g_modeMC; if(!isEnemy) { _loc4_.targetName.textColor = 12844904; _loc4_.otrPanel.targetName.textColor = 12844904; _loc4_.otrPanel.maxSpeed.textColor = 12844904; } else { _loc4_.targetName.textColor = 16720418; _loc4_.otrPanel.targetName.textColor = 16711680; _loc4_.otrPanel.maxSpeed.textColor = 16711680; } } function _setDefaultDistanceState() { g_modeMC.distanceLbl.text = ""; distance.text = ""; target.text = ""; g_modeMC.otrPanel.gunName.text = "Орудие:"; g_modeMC.otrPanel.shellSplash.text = "Сплеш:"; g_modeMC.otrPanel.shellName.text = "Снаряд:"; g_modeMC.otrPanel.shellSpeed.text = "Скорость снаряда:"; g_modeMC.otrPanel.heightSights.text = "Высота:"; } function _onUpdateDistance(dist) { wg_trace("[_onUpdateDistance] dist - " + dist); g_modeMC.distanceLbl.text = dist + " м"; g_modeMC.distanceLbl.textColor = neutralColor; var _loc2_ = Math.ceil(shellSpeed * shellSpeed / shellGravity); var _loc3_ = shellSpeed * shellSpeed; var _loc4_ = dist > _loc2_?0.785398:Math.asin(dist * shellGravity / _loc3_) * 0.5; shellTime = Math.sin(_loc2_) * shellSpeed / shellGravity * 2; flightTime.text = shellType + pp + "~" + Math.round(shellTime * 10) / 10 + " сек"; maxDistance.text = "Max: " + _loc4_.toString() + " м"; g_modeMC.circleS._width = g_modeMC.circleS._height = shellSplash * 8.5 * zoomHeight * 2; g_modeMC.angelPanel.ang.text = Math.round(_loc2_ / 3.141593 * 180) + "°"; g_modeMC.angelPanel.gun._rotation = (- _loc2_) / 3.141593 * 180; maxDist = shellSpeed * shellSpeed / shellGravity; g_modeMC.distPanel.percentLine._x = 5 + 40 * dist / maxDist; g_modeMC.distPanel.percent.text = Math.round(dist / maxDist * 100) + "%"; refreshData(dist); } function _onUpdateHeight(height) { zoomHeight = 100 / height; g_debugPanel.heightSights.text = "Высота: " + height.toString() + " м"; } function _onSetVehicleParams(gun_Name, shell_Speed, shell_Gravity, shell_Name, shell_Splash, spg_Name, shell_Type) { shellSpeed = shell_Speed; shellGravity = shell_Gravity; gunName = gun_Name; shellName = shell_Name; shellSplash = shell_Splash; g_modeMC.otrPanel.gunName.text = "Орудие: " + gun_Name.toString(); g_modeMC.otrPanel.shellSplash.text = "Сплеш: " + Math.round(shell_Splash * 100) / 100 + " м"; g_modeMC.otrPanel.shellName.text = "Снаряд: " + shell_Name.toString(); g_modeMC.otrPanel.shellSpeed.text = "Скорость снаряда: " + Math.round(shell_Speed * 100) / 100; refreshDisplay(); if(enableShellType == true) { pp = ": "; if(shell_Type == "AP") { shellType = "ББ"; } else if(shell_Type == "HE") { shellType = "ОФ"; } else if(shell_Type == "CR") { shellType = "БП"; } else if(shell_Type == "HC") { shellType = "КС"; } else { shellType = ""; pp = ""; } } else { shellType = ""; pp = ""; } } function _setDefaultTargetState() { g_modeMC.reloadStatus._alpha = 0; g_modeMC.reloadStatus._visible = false; } function _onSetClipParams(clipCapacity, burst) { wg_trace("[_onSetClipCapacity]"); if(g_ClipCapacity == clipCapacity) { return undefined; } g_ClipCapacity = clipCapacity; if(g_ClipCapacity > 1) { var _loc3_ = g_modeMC.cassette; if(!(_loc3_ == null) && quantityInClipBar == null) { quantityInClipBar = net.wargaming.ingame.QuantityInClipBar.create(_loc3_,g_ClipCapacity,burst); } } } com.greensock.OverwriteManager.init(com.greensock.OverwriteManager.AUTO); com.greensock.plugins.TweenPlugin.activate([com.greensock.plugins.AutoAlphaPlugin]); setupXML(); var config; var enableAnglePanel = true; var enableDistPanel = false; var enableExtraPanel = false; var quant; var shellName; var shellSpeed; var shellGravity; var shellSplash; var zoomHeight = 1; var targetName = ""; var flightTimeSettings; var distanceSettings; var maxDistanceSettings; var circleSSettings; var targetNameSettings; var distance = g_modeMC.distanceLbl; var target = g_modeMC.targetName; var flightTime = g_modeMC.flightTime; var maxDistance = g_modeMC.maxDistance; var g_debugPanel = g_modeMC.otrPanel; var g_circleS = g_modeMC.circleS; var maxDist = 0; gfx.io.GameDelegate.addCallBack("Aim.onRecreateDevice",this,"_onRecreateDevice"); gfx.io.GameDelegate.addCallBack("Aim.setReloading",this,"_onSetReloading"); gfx.io.GameDelegate.addCallBack("Aim.correctReloadingTime",this,"_onCorrectReloadingTime"); gfx.io.GameDelegate.addCallBack("Aim.setHealth",this,"_onSetHealth"); gfx.io.GameDelegate.addCallBack("Aim.setAmmoStock",this,"_onSetAmmoStock"); gfx.io.GameDelegate.addCallBack("Aim.setClipParams",this,"_onSetClipParams"); gfx.io.GameDelegate.addCallBack("Aim.setReloadingAsPercent",this,"_onSetReloadingAsPercent"); gfx.io.GameDelegate.addCallBack("Aim.setTarget",this,"_onSetTarget"); gfx.io.GameDelegate.addCallBack("Aim.updateDistance",this,"_onUpdateDistance"); gfx.io.GameDelegate.addCallBack("Aim.vehicleParams",this,"_onSetVehicleParams"); gfx.io.GameDelegate.addCallBack("Aim.heightSight",this,"_onUpdateHeight"); var g_debugEnabled = false; var g_Reloading = [0,0,false]; var normalColor; var dangerColor; var neutralColor; var _reloadTimer; var _colorUtil; var g_ClipCapacity = 1; var quantityInClipBar = null; var _reloadAnimation; onLoad = function() { _setDefaultTargetState(); _setDefaultDistanceState(); _onSetAmmoStock(0,0,true,"critical"); _reloadTimer = new com.nicolasprof.wot.ReloadTimer(g_modeMC.holder.reloadTimer,this.onReady); _colorUtil = new com.nicolasprof.wot.utils.ColorUtil(); _reloadAnimation = new MovieClip(); loadConfigFile(); }; _universalBar = new com.nicolasprof.wot.AnimationController(g_modeMC.universalBarMC,60); Stage.scaleMode = "noScale"; Stage.align = "TL"; Edited March 13, 2015 by ZLoy @ Quote Link to comment Short link Share on other sites More sharing options...
chump Posted March 19, 2015 Share Posted March 19, 2015 (edited) Время полета одно и тоже не меняется с расстоянием и угол орудия тоже хер что отображает :( shot_013.png function _onUpdateDistance(dist) { wg_trace("[_onUpdateDistance] dist - " + dist); g_modeMC.distanceLbl.text = dist + " м"; g_modeMC.distanceLbl.textColor = neutralColor; var _loc2_ = Math.ceil(shellSpeed * shellSpeed / shellGravity); var _loc3_ = shellSpeed * shellSpeed; var _loc4_ = dist > _loc2_?0.785398:Math.asin(dist * shellGravity / _loc3_) * 0.5; shellTime = Math.sin(_loc2_) * shellSpeed / shellGravity * 2; flightTime.text = shellType + pp + "~" + Math.round(shellTime * 10) / 10 + " сек"; maxDistance.text = "Max: " + _loc4_.toString() + " м"; g_modeMC.circleS._width = g_modeMC.circleS._height = shellSplash * 8.5 * zoomHeight * 2; g_modeMC.angelPanel.ang.text = Math.round(_loc2_ / 3.141593 * 180) + "°"; g_modeMC.angelPanel.gun._rotation = (- _loc2_) / 3.141593 * 180; maxDist = shellSpeed * shellSpeed / shellGravity; g_modeMC.distPanel.percentLine._x = 5 + 40 * dist / maxDist; g_modeMC.distPanel.percent.text = Math.round(dist / maxDist * 100) + "%"; refreshData(dist); } Должно быть так, у меня сам декомпилёр это значение автоматом меняет, у тебя почему то _loc2_ осталось: shellTime = Math.sin(_loc4_) * shellSpeed / shellGravity * 2; и тут: g_modeMC.angelPanel.ang.text = Math.round(_loc4_ / 3.141593 * 180) + "°"; g_modeMC.angelPanel.gun._rotation = (- _loc4_) / 3.141593 * 180; Посмотори ещё maxDistance.text у меня опять по другому, а у тебя _loc4_: maxDistance.text = "Max: " + _loc2_.toString() + " м"; Если дистанция будет типа 609.1654641321м а не просто 609м поменяй вторую строку в функции на эту: g_modeMC.distanceLbl.text = Math.round(dist * 1) + " м"; Edited March 19, 2015 by chump @ Quote Link to comment Short link Share on other sites More sharing options...
ZLoy Posted March 19, 2015 Author Share Posted March 19, 2015 @chump, у меня стоит этот JPEXS Free Flash Decompiler но он сам каким то хреном сам дописывает,после редактирования ! @ Quote Link to comment Short link Share on other sites More sharing options...
chump Posted March 19, 2015 Share Posted March 19, 2015 @chump, у меня стоит этот JPEXS Free Flash Decompiler но он сам каким то хреном сам дописывает,после редактирования ! У меня он же и стоит, им же я всегда скрипты и меняю, никогда с ним проблем не было, кроме той что я в первом сообщении указал. Вот измени всё как я написал выше и у тебя будет всё хорошо. Возможно ты просто не оригинальный рабочий файл изменял, а уже покоцаный декомпилёром, когда ты координаты posX posY правил в первый раз. Вот он во второй раз что попало и записал. Рабочий исправленый файл: zloy_crosshair_panel_strategic.swf @ Quote Link to comment Short link Share on other sites More sharing options...
ZLoy Posted March 19, 2015 Author Share Posted March 19, 2015 (edited) У меня он же и стоит, им же я всегда скрипты и меняю, никогда с ним проблем не было, кроме той что я в первом сообщении указал. Вот измени всё как я написал выше и у тебя будет всё хорошо. Возможно ты просто не оригинальный рабочий файл изменял, а уже покоцаный декомпилёром, когда ты координаты posX posY правил в первый раз. Вот он во второй раз что попало и записал. Рабочий исправленый файл: zloy_crosshair_panel_strategic.swf Очень благодарен Вам , может подскажите тут Edited March 19, 2015 by ZLoy @ Quote Link to comment Short link Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.