6 lines
31 KiB
JavaScript
6 lines
31 KiB
JavaScript
import{_ as He,r as p,c as I,o as Ve,b as i,d as t,n as k,p as g,v as ae,i as F,q as b,F as y,B as S,t as u,C as T,G as qe,z as o,K as je}from"./index-DGJ6dnLh.js";const Xe={class:"app-container"},Ge={class:"sidebar"},$e={class:"main-content"},ze={class:"match-section"},Je={class:"upload-area"},Ke={class:"upload-card"},Ye={class:"upload-card"},Ze={key:0,class:"result-card"},Qe={class:"table-responsive"},et={class:"result-table"},tt={key:0},lt={key:1,class:"no-match"},at={class:"compare-section"},nt={class:"control-panel"},it={class:"reload-card"},ot={class:"pagination-card"},st={class:"pagination-controls"},rt=["disabled"],ut={class:"page-info"},dt=["disabled"],ct={class:"weapon-list-card"},pt={class:"table-responsive"},vt={class:"weapon-table"},mt={class:"checkbox-container"},gt=["value"],ft={class:"compare-tools"},ht={class:"toolbar"},bt={class:"attribute-selector-panel"},yt={class:"attribute-controls"},St={class:"search-box"},At={class:"button-group"},Ct={class:"select-container"},kt=["value"],Tt={class:"selection-info"},Dt={class:"selected-preview"},Ft={class:"selected-tags"},Rt=["onClick"],xt={key:0,class:"empty-hint"},Ot={key:0,class:"comparison-result"},Wt={class:"table-responsive"},Et={class:"comparison-table"},_t={class:"attr-name"},Mt={class:"attr-name"},wt={key:1,class:"empty-state"},Nt={class:"additional-info"},It={class:"info-card"},Pt={key:0,class:"table-responsive"},Bt={class:"info-table"},Ut={key:1,class:"empty-state small"},Lt={class:"info-card"},Ht={key:0,class:"ranking-list"},Vt={class:"rank"},qt={class:"weapon-name"},jt={class:"count"},Xt={key:1,class:"empty-state small"},Gt={class:"GOBeditor-section"},$t={class:"file-input-container"},zt={key:0,class:"unit-editor"},Jt={class:"unit-list"},Kt=["onClick"],Yt={key:0,class:"unit-details"},Zt={class:"detail-row"},Qt={class:"detail-group"},el={class:"toggle-icon"},tl={key:0,class:"group-content"},ll={class:"detail-row"},al={class:"detail-row"},nl={class:"detail-row"},il={class:"detail-row"},ol={class:"detail-group"},sl={class:"toggle-icon"},rl={key:0,class:"group-content"},ul={class:"detail-row"},dl={class:"detail-row"},cl={class:"detail-group"},pl={class:"toggle-icon"},vl={key:0,class:"group-content"},ml={class:"detail-row"},gl={class:"detail-row"},fl={class:"detail-group"},hl={class:"toggle-icon"},bl={key:0,class:"group-content"},yl={key:0,class:"detail-row"},Sl={class:"detail-label"},Al={class:"weapon-stats"},Cl={__name:"WeaponMatch",setup(kl){const P=p(null),w=p([]),r=p(null),B=p(["csf","tech","costHealth"]),d=p({id:"",displayName:"",typeDescription:"",description:"",buildTime:"",neededUpgrade:"",maxSimultaneous:"",buildCost:"",maxHealth:""});function he(a){r.value=a,be(),ce()}function be(){r.value&&(d.value={id:r.value.getAttribute("id")||"",displayName:De(r.value)||"",typeDescription:r.value.getAttribute("TypeDescription")||"",description:r.value.getAttribute("Description")||"",buildTime:r.value.getAttribute("BuildTime")||"",neededUpgrade:Fe(r.value)||"",maxSimultaneous:r.value.getAttribute("MaxSimultaneousOfType")||"",buildCost:Re(r.value)||"",maxHealth:xe(r.value)||""})}function U(){r.value&&(r.value.setAttribute("id",d.value.id),r.value.setAttribute("TypeDescription",d.value.typeDescription),r.value.setAttribute("Description",d.value.description),r.value.setAttribute("BuildTime",d.value.buildTime),r.value.setAttribute("MaxSimultaneousOfType",d.value.maxSimultaneous))}function ye(){if(!r.value)return;let a=r.value.querySelector("DisplayName");a||(a=f.value.createElement("DisplayName"),r.value.appendChild(a)),a.textContent=d.value.displayName}function Se(){if(!r.value)return;let a=r.value.querySelector("GameDependency");a||(a=f.value.createElement("GameDependency"),r.value.appendChild(a)),a.setAttribute("NeededUpgrade",d.value.neededUpgrade)}function Ae(){if(!r.value)return;let a=r.value.querySelector("ObjectResourceInfo");a||(a=f.value.createElement("ObjectResourceInfo"),r.value.appendChild(a));let e=a.querySelector("BuildCost");e||(e=f.value.createElement("BuildCost"),a.appendChild(e)),e.setAttribute("Amount",d.value.buildCost)}function Ce(){if(!r.value)return;let a=r.value.querySelector("Body");a||(a=f.value.createElement("Body"),r.value.appendChild(a));let e=a.querySelector("ActiveBody");e||(e=f.value.createElement("ActiveBody"),a.appendChild(e)),e.setAttribute("MaxHealth",d.value.maxHealth)}function ke(){if(!f.value||!r.value)return;const a=new XMLSerializer,e=r.value.getAttribute("id")||"unit",l=a.serializeToString(f.value);ne(`${e}.xml`,l);const n=document.implementation.createDocument("uri:ea.com:eala:asset","AssetDeclaration"),s='<?xml version="1.0" encoding="utf-8" ?>',c=n.createElement("Tags");n.documentElement.appendChild(c);const v=n.createElement("Includes"),m=n.createElement("Include");m.setAttribute("type","all"),m.setAttribute("source","DATA:GlobalData/GlobalDefines.xml"),v.appendChild(m),n.documentElement.appendChild(v);const A=n.createElement("Defines"),N=n.createElement("Define");N.setAttribute("name","FACTION_WEAPON_SECONDARY_DAMAGE_AMOUNT"),N.setAttribute("value","-500.0"),A.appendChild(N);const M=n.createElement("Define");M.setAttribute("name","EMPERORS_RESOLVE_AFFECTS"),M.setAttribute("value","ALLIES NEUTRALS ENEMIES"),A.appendChild(M),n.documentElement.appendChild(A),w.value.length>0&&P.value&&w.value.forEach(Le=>{const te=P.value.querySelector(`WeaponTemplate[id="${Le.id}"]`);if(te){const le=n.createElement("WeaponTemplate");Array.from(te.attributes).forEach(D=>{le.setAttribute(D.name,D.value)}),Array.from(te.children).forEach(D=>{const G=n.createElement(D.tagName);Array.from(D.attributes).forEach(j=>{G.setAttribute(j.name,j.value)}),D.textContent.trim()&&(G.textContent=D.textContent),D.tagName==="Nuggets"&&Array.from(D.children).forEach(j=>{const ge=n.createElement(j.tagName);Array.from(j.attributes).forEach(fe=>{ge.setAttribute(fe.name,fe.value)}),G.appendChild(ge)}),le.appendChild(G)}),n.documentElement.appendChild(le)}});let ee=a.serializeToString(n);ee=s+`
|
||
`+Te(ee),setTimeout(()=>{ne("config.xml",ee)},500)}function Te(a){const e=" ",l=/(>)(<)(\/*)/g;let n="",s=0;return a=a.replace(l,`$1\r
|
||
$2$3`),a.split(`\r
|
||
`).forEach(c=>{let v=0;c.match(/.+<\/\w[^>]*>$/)?v=0:c.match(/^<\/\w/)?s!==0&&(s-=1):c.match(/^<\w[^>]*[^\/]>.*$/)?v=1:v=0,n+=e.repeat(s)+c+`\r
|
||
`,s+=v}),n}function ne(a,e){const l=new Blob([e],{type:"text/xml"}),n=URL.createObjectURL(l),s=document.createElement("a");s.href=n,s.download=a,document.body.appendChild(s),s.click(),document.body.removeChild(s),setTimeout(()=>URL.revokeObjectURL(n),1e3)}function X(a){B.value.includes(a)?B.value=B.value.filter(e=>e!==a):B.value.push(a)}function R(a){return B.value.includes(a)}function De(a){const e=a.querySelector("DisplayName");return e?e.textContent.trim():null}function Fe(a){const e=a.querySelector("GameDependency");return e?e.getAttribute("NeededUpgrade"):null}function Re(a){const e=a.querySelector("ObjectResourceInfo");if(!e)return null;const l=e.querySelector("BuildCost");return l?l.getAttribute("Amount"):null}function xe(a){const e=a.querySelector("Body");if(!e)return null;const l=e.querySelector("ActiveBody");return l?l.getAttribute("MaxHealth"):null}const C=p("match"),ie=p(""),f=p(null),L=p([]),$=p(new Set),O=p([]),H=p([]),x=p(1),z=p(20),h=p([]),W=p(!1),E=p(!1),J=p(""),V=p(!1),K=p([]),oe=I(()=>{const a=new Set,e={id:"武器ID",inheritFrom:"继承自",AttackRange:"射程",MinimumAttackRange:"最小射程",RangeBonusMinHeight:"射程加成最小高度",RangeBonus:"射程加成值",RangeBonusPerFoot:"每英尺射程加成",RequestAssistRange:"请求援助范围",AcceptableAimDelta:"允许瞄准偏差角",AimDirection:"基准瞄准方向",ScatterRadius:"散射半径",ScatterLength:"散射长度",ScatterIndependently:"多抛射物独立散射",WeaponSpeed:"武器/抛射物速度",MinWeaponSpeed:"最小抛射物速度",MaxWeaponSpeed:"最大抛射物速度",ScaleWeaponSpeed:"缩放抛射物速度",IgnoresContactPoints:"忽略碰撞体积(将武器瞄准目标几何中心)",ScaleAttackRangeByAmmoRemaining:"射程随弹药剩余量缩放",CanBeDodged:"可被躲避",IdleAfterFiringDelaySeconds:"开火后待机延迟",HoldAfterFiringDelaySeconds:"开火后保持延迟",HoldDuringReload:"保持先前姿态时即可装填",CanFireWhileMoving:"移动射击能力",WeaponRecoil:"启用后坐力",MinTargetPitch:"最小俯仰角",MaxTargetPitch:"最大俯仰角",PreferredTargetBone:"首选目标骨骼",FireSound:"开火音效",FireSoundPerClip:"整弹匣开火音效",FiringLoopSound:"持续开火音效",FiringLoopSoundContinuesDuringReload:"装填时保持开火音效",FireFX:"开火特效",FireVeteranFX:"升级后开火特效",FireFlankFX:"侧翼开火特效",PreAttackFX:"预攻击特效",ClipSize:"弹匣容量",ContinuousFireOne:"第一阶段连续射击次数",ContinuousFireTwo:"第二阶段连续射击次数",ContinuousFireCoastSeconds:"连续射击间隔",AutoReloadWhenIdleSeconds:"空闲时自动装弹时间",ShotsPerBarrel:"每炮管射弹数",DamageDealtAtSelfPosition:"伤害作用于自身位置",RequiredFiringObjectStatus:"开火所需状态标志",ForbiddenFiringObjectStatus:"禁止开火的状态标志",CheckStatusFlagsInRangeChecks:"射程检查时包含状态标志",ProjectileSelf:"发射自身作为抛射物",MeleeWeapon:"近战武器",ChaseWeapon:"追击武器",LeechRangeWeapon:"吸血射程武器",HitStoredTarget:"会攻击预设目标",CapableOfFollowingWaypoints:"能否跟随路径点",ShowsAmmoPips:"是否显示弹药指示器",AllowAttackGarrisonedBldgs:"能否攻击驻军建筑",PlayFXWhenStealthed:"隐身时是否播放特效",ContinueAttackRange:"持续攻击范围",SuspendFXDelaySeconds:"特效暂停延迟",IsAimingWeapon:"是否为瞄准武器",NoVictimNeeded:"是否需要攻击目标",HitPercentage:"命中率",HitPassengerPercentage:"乘客命中概率",PassengerProportionalAttack:"是否按乘客比例攻击",HealthProportionalResolution:"生命值比例分辨率",MaxAttackPassengers:"最大攻击乘客数",FinishAttackOnceStarted:"强制完成已开始攻击",RestrictedHeightRange:"高度限制范围",CannotTargetCastleVictims:"能否攻击城堡保护目标",RequireFollowThru:"攻击动作必须完整执行",ShareTimers:"共享计时器",ShouldPlayUnderAttackEvaEvent:"是否播放受袭语音",InstantLoadClipOnActivate:"激活武器时才开始装填(无法立刻发射)",Flags:"行为控制标志集",LockWhenUsing:"使用时锁定",BombardType:"轰炸类型武器",UseInnateAttributes:"使用先天属性",PreAttackType:"攻击前准备类型",ReAcquireDetailType:"目标重锁定模式",AutoReloadsClip:"自动装填机制 (AUTO-自动再装填/NONE-无法再装填/RETURN_TO_BASE-只能在基地再装填)",SingleAmmoReloadedNotFullSound:"单发装填音效",ClipReloadedSound:"弹匣重装音效",RadiusDamageAffects:"范围伤害影响对象",FXTrigger:"特效触发类型",ProjectileCollidesWith:"抛射物碰撞对象类型",RequiredAntiMask:"可攻击的目标类型",ForbiddenAntiMask:"禁止攻击的目标类型",StopFiringOnCanBeInvisible:"隐身时停止开火",ProjectileStreamName:"投射物流名称",ContactWeapon:"接触式武器",UseCenterForRangeCheck:"使用几何中心点计算射程",VirtualDamage:"自动分弹模式/虚拟伤害类型(NONE-不进行自动分弹/SOLO-自动分弹时只计算自己/SHARED-自动分弹时计算所有单位的总火力)",PreAttackWeapon:"预攻击武器",RevealShroudOnFire:"开火时揭露战争迷雾",ShouldPlayTargetDeadEvaEvent:"目标死亡时播放语音",MinSeconds:"最小持续时间(秒)",MaxSeconds:"最大持续时间(秒)",IsAntiGarrisonWeapon:"反驻军武器",MaxSpeedOfTarget:"可命中的目标最大速度",UseLongLockOnTimeCode:"使用长锁定时间逻辑",UseAsWarheadForDamageCalculations:"AI伤害计算弹头",Radius:"作用半径",PartitionFilterTestType:"属性过滤器作用区域形状",ForbiddenTargetObjectStatus:"瘫痪/冲击波失效的目标对象状态",ForbiddenTargetModelCondition:"瘫痪/冲击波失效的目标模型状态",RequiredUpgrade:"所需升级",ForbiddenUpgrade:"禁止升级",Damage:"基础伤害值",DamageTaperOff:"伤害衰减系数",MinRadius:"最小作用半径",DamageArc:"扇形伤害范围角度",DamageArcInverted:"反转伤害扇形",DamageMaxHeight:"伤害最大高度",DamageMaxHeightAboveTerrain:"伤害最大离地高度",FlankingBonus:"侧翼攻击加成",FlankedScalar:"被侧翼攻击倍率",DelayTimeSeconds:"伤害延迟时间(秒)",DamageType:"伤害类型",DeathType:"死亡效果类型",DamageFXType:"伤害特效类型",DamageSubType:"伤害子类型",OnlyKillOwnerWhenTriggered:"仅在被触发时杀死拥有者",DrainLifeMultiplier:"生命吸取倍率",DrainLife:"生命吸取",DamageSpeed:"伤害传播速度",UnderAttackOverrideEvaEvent:"覆盖受袭语音事件",VictimShroudRevealer:"目标战争迷雾揭示者",NotifyOwnerOnVictimDeath:"目标死亡通知拥有者",NotifyObserversOnPreDamageEffectPosition:"伤害位置预报",ForceFXPositionToVictim:"特效绑定目标位置",RadiusAffectsBridges:"影响桥梁",InvalidTargetStatus:"无效目标状态标志",DamageScalarDetails:"伤害比例详情",Scalar:"伤害比例",Filter:"对象过滤器",DamageInterval:"伤害间隔(秒)",DamageDuration:"伤害总时长(秒)",RemoveIfHealed:"治疗时移除效果",PercentDamageToHeal:"伤害转化为治疗百分比",PercentMaxHealthToTake:"最大生命值吸取比例",ProjectileTemplate:"抛射物模板",WarheadTemplate:"弹头模板",WeaponLaunchBoneSlotOverride:"武器发射骨骼槽",AttackOffset:"攻击位置偏移",VeterancyLevel:"老兵等级",SpecificBarrelOverride:"特定炮管覆盖",x:"X轴偏移",y:"Y轴偏移",z:"Z轴偏移",Suppression:"压制强度",DurationSeconds:"效果持续时间(秒)",SuppressionTaperOff:"压制衰减系数",SuppressionArc:"压制扇形角度",SuppressionArcInverted:"反转压制扇形",Lifetime:"激光持续时间",LaserId:"激光ID",HitGroundFX:"命中地面特效",OverShootDistance:"激光延长线距离",WeaponOCL:"武器对象创建列表",TargetAsPrimaryObject:"设目标为主要对象",EffectArc:"麻痹效果扇形角度",DurationSeconds:"麻痹持续时间(秒)",ParalyzeType:"麻痹类型",RemoveParalyzeType:"解除麻痹类型",ParalyzeFX:"麻痹特效",InfoWarType:"信息战类型",RadarJamRadius:"雷达干扰半径",RadarJamDuration:"雷达干扰持续时间",AmountToSpend:"消耗泰矿数量",ShockWaveAmount:"冲击波强度",ShockWaveRadius:"冲击波半径",ShockWaveArc:"扇形冲击波范围角度",ShockWaveTaperOff:"冲击波衰减",ShockWaveSpeed:"冲击波速度",ShockWaveZMult:"垂直方向冲击波系数",CyclonicFactor:"气旋因子",ShockwaveDelaySeconds:"冲击波延迟时间(秒)",InvertShockWave:"反转冲击波方向",FlipDirection:"翻转方向",OnlyWhenJustDied:"仅在目标刚死亡时触发",ShockWaveClearRadius:"冲击波清除半径",ShockWaveClearWaveMult:"清除冲击波倍数",ShockWaveClearFlingHeight:"清除抛射高度",KillObjectFilter:"击杀对象过滤器",SpecialPowerTemplate:"特殊能力模板",AttributeModifierName:"属性修改器名称",AttributeModifierOwnerName:"属性修改器所有者",DamageFXType:"伤害特效类型",DamageArc:"伤害作用弧度",AntiCategories:"反制类别",AntiFX:"反制特效",OffsetAngle:"线性伤害偏移角度",LineWidth:"线性伤害宽度",LineLengthLeadIn:"起始线长",LineLengthLeadOut:"结束线长",UseDynamicLineLength:"线性伤害使用动态线长",OverShootDistance:"线性伤害延长距离",PreColorTime:"着色淡入时间",SustainedColorTime:"持续着色时间",PostColorTime:"着色淡出时间",Frequency:"脉冲频率",Amplitude:"脉冲幅度",Color:"着色颜色",r:"红色分量",g:"绿色分量",b:"蓝色分量",Depth:"弹坑深度",Lift:"地形隆起比例",FieldAmount:"矿场数量",SpawnedInFieldBonus:"矿场内生成加成",ScatterMin:"最小散射角度",ScatterMax:"最大散射角度",AttachModuleId:"ATTR模块ID",AmountToStrip:"生命值剥离百分比",Weapon:"使用的武器",FireOnVictimObject:"对目标使用武器",VictimMustBeAlive:"目标必须存活",Filter:"对象过滤器",MinTimeToImpactFudgeFactor:"最小命中时间容差",MaxTimeToImpactFudgeFactor:"最大命中时间容差",Rule:"生效规则(ALL/ANY/NONE)",Include:"包含对象类型",Exclude:"排除对象类型",Relationship:"阵营关系(敌/友/中等)",StatusBitFlags:"目标需要的状态标志",StatusBitFlagsExclude:"排除目标的状态标志",RequiredModelConditions:"所需模型状态",SpecialObjectFilter:"特殊对象过滤器",OverrideVoiceAttackSound:"覆盖攻击语音",OverrideVoiceEnterStateAttackSound:"覆盖状态切换攻击语音",SurpriseAttackObjectFilter:"突袭攻击对象过滤器",CombinedAttackObjectFilter:"联合攻击对象过滤器",HitStoredObjectFilter:"命中存储对象过滤器",ScatterRadiusVsType:"散射类型设置",IncompatibleAttributeModifier:"不兼容属性修改器",SpawnTemplate:"生成模板",SpawnProbability:"生成概率",SpawnedModelConditionFlags:"生成模型状态标志",Amount:"伤害量",PercentDamageToContained:"对包含单位的伤害比例",DamageObjectFilter:"伤害对象过滤器",MaxUnitsToDamage:"最大伤害单位数",WindowBlastFX:"窗口爆炸特效",EventName:"事件名称",SendToEnemies:"发送给敌人",SendToAllies:"发送给盟友",SendToNeutral:"发送给中立单位","ScatterRadiusVsType.Radius":"散射半径","ScatterRadiusVsType.RequiredModelConditions":"散射所需模型状态"},l=(n,s="")=>{Array.from(n.attributes||[]).forEach(c=>{const v=e[c.name],m=v?`${c.name}(${v})`:c.name,A=s?`${s}下的${m}`:m;s?a.add(A):a.add(`**${A}**`)}),Array.from(n.children||[]).forEach(c=>{var m,A;const v=((A=(m=n.attributes)==null?void 0:m.name)==null?void 0:A.value)||n.nodeName;l(c,v)})};return O.value.forEach(n=>{l(n.node)}),Array.from(a)}),Oe=I(()=>{const a=(x.value-1)*z.value;return O.value.slice(a,a+z.value)}),Y=I(()=>Math.ceil(O.value.length/z.value)),_=I(()=>O.value.filter(a=>H.value.includes(a.id))),se=I(()=>{const a=new Map;return O.value.forEach(e=>{const l=e.node.getAttribute("inheritFrom");l&&a.set(l,(a.get(l)||0)+1)}),Array.from(a.entries()).map(([e,l])=>({weapon:e,count:l})).sort((e,l)=>l.count-e.count)}),Z=I(()=>W.value&&E.value?"normal":W.value?"reversed":E.value?"transposed":"normal");function q(a,e,l=!0){let n=e;n=n.replace(/\*\*/g,""),n.includes("下的")&&(n=n.split("下的")[1]),n.includes("(")&&(n=n.split("(")[0]),n=n.trim();const s=a.node.getAttribute(n);if(s!==null)return s;if(l&&a.node.children)for(const c of a.node.children){const v=q({node:c},n,!0);if(v!==null)return v}return null}function re(){K.value=oe.value.filter(a=>a.toLowerCase().includes(J.value.toLowerCase())),V.value=!1}function We(){V.value=!V.value,V.value?h.value=[...K.value]:h.value=[]}function Ee(){h.value=[]}function _e(a){h.value=h.value.filter(e=>e!==a)}function Me(){x.value>1&&x.value--}function we(){x.value<Y.value&&x.value++}function Ne(){W.value=!W.value}function Ie(){E.value=!E.value}function ue(a){return a?"has-value":"no-value"}function de(){H.value=[]}function Pe(){const a=new Set;L.value.forEach(e=>{e.templates&&e.templates.length>0&&e.templates.forEach(l=>a.add(l))}),H.value=Array.from(a),C.value="compare"}function Q(a){const e=a.target.files[0];if(!e)return;const l=new FileReader;l.onload=()=>{const n=new DOMParser,s=l.result;P.value=n.parseFromString(l.result,"text/xml"),ie.value=s,localStorage.setItem("weaponXml",s),ve(s),ce()},l.readAsText(e)}function ce(){if(!r.value||!P.value){w.value=[];return}const a=[];for(let e of["WeaponSlotHardpoint","WeaponSlotTurret","WeaponSlotHierarchicalTurret","WeaponSlotContained"])r.value.querySelectorAll(`Behaviors > WeaponSetUpdate > ${e} > Weapon`).forEach(n=>{const s=n.getAttribute("Template");if(s){const c=P.value.querySelector(`WeaponTemplate[id="${s}"]`);if(c){const v=c.getAttribute("AttackRange"),m=c.getAttribute("MinimumAttackRange");let A=0,N=0;const M=c.querySelector("Nuggets > DamageNugget");M&&(A=M.getAttribute("Radius")||0,N=M.getAttribute("Damage")||0),a.push({id:s,attackRange:v,minAttackRange:m,Damage:N,Radius:A})}}});w.value=a}function Be(a){Q(a)}function pe(a){const e=a.target.files[0];if(!e)return;const l=new FileReader;l.onload=()=>{const n=new DOMParser;f.value=n.parseFromString(l.result,"text/xml"),me()},l.readAsText(e)}function ve(a){const n=new DOMParser().parseFromString(a,"text/xml").querySelectorAll("WeaponTemplate");$.value=new Set(Array.from(n).map(s=>s.getAttribute("id")).filter(Boolean)),O.value=Array.from(n).map(s=>({id:s.getAttribute("id"),node:s})),me()}function me(){if(!f.value||$.value.size===0)return;L.value=[],f.value.querySelectorAll("GameObject").forEach(e=>{const l=e.getAttribute("id")||"(无 ID)",n=new Set;for(let s of["WeaponSlotHardpoint","WeaponSlotTurret","WeaponSlotHierarchicalTurret","WeaponSlotContained"])if(e.querySelectorAll(`Behaviors > WeaponSetUpdate > ${s} > Weapon`).forEach(v=>{const m=v.getAttribute("Template");m&&$.value.has(m)&&n.add(m)}),n.size)break;L.value.push({id:l,templates:Array.from(n)})})}function Ue(a){const e=[a.id];let l=a.node.getAttribute("inheritFrom");for(;l;){e.push(l);const n=O.value.find(s=>s.id===l);if(!n)break;l=n.node.getAttribute("inheritFrom")}return e}return Ve(()=>{const a=localStorage.getItem("weaponXml");a&&(ie.value=a,ve(a)),re()}),(a,e)=>(o(),i("div",Xe,[t("div",Ge,[e[19]||(e[19]=t("h2",null,"功能导航",-1)),t("ul",null,[t("li",{class:k({active:C.value==="match"}),onClick:e[0]||(e[0]=l=>C.value="match")},"模板匹配",2),t("li",{class:k({active:C.value==="compare"}),onClick:e[1]||(e[1]=l=>C.value="compare")},"武器对比",2),t("li",{class:k({active:C.value==="GOBedit"}),onClick:e[2]||(e[2]=l=>C.value="GOBedit")},"物体编辑器",2)])]),t("div",$e,[g(t("section",ze,[e[25]||(e[25]=t("h1",null,[t("i",{class:"icon icon-match"}),b(" WeaponTemplate 匹配到单位 GameObject")],-1)),t("div",Je,[t("div",Ke,[e[20]||(e[20]=t("h3",null,"上传 Weapon.xml",-1)),t("input",{type:"file",onChange:Q,class:"file-upload",accept:".xml"},null,32)]),t("div",Ye,[e[21]||(e[21]=t("h3",null,"上传单位 XML",-1)),t("input",{type:"file",onChange:pe,class:"file-upload",accept:".xml"},null,32)])]),L.value.length?(o(),i("div",Ze,[t("div",{class:"card-header"},[e[23]||(e[23]=t("h3",null,"匹配结果",-1)),t("button",{onClick:Pe,class:"action-btn"},e[22]||(e[22]=[t("i",{class:"icon icon-auto-select"},null,-1),b(" 自动选择匹配项 ")]))]),t("div",Qe,[t("table",et,[e[24]||(e[24]=t("thead",null,[t("tr",null,[t("th",{width:"50%"},"GameObject ID"),t("th",{width:"50%"},"匹配到的 WeaponTemplate")])],-1)),t("tbody",null,[(o(!0),i(y,null,S(L.value,(l,n)=>(o(),i("tr",{key:n},[t("td",null,u(l.id),1),t("td",null,[l.templates&&l.templates.length>0?(o(),i("span",tt,u(l.templates.join(", ")),1)):(o(),i("span",lt,"None"))])]))),128))])])])])):F("",!0)],512),[[ae,C.value==="match"]]),g(t("section",at,[e[44]||(e[44]=t("h1",null,[t("i",{class:"icon icon-compare"}),b(" 武器对比工具")],-1)),t("div",nt,[t("div",it,[e[26]||(e[26]=t("h3",null,"重新导入 Weapon.xml",-1)),t("input",{type:"file",onChange:Be,class:"file-upload",accept:".xml"},null,32)]),t("div",ot,[t("div",st,[t("button",{onClick:Me,disabled:x.value===1,class:"page-btn"},e[27]||(e[27]=[t("i",{class:"icon icon-prev"},null,-1),b(" 上一页 ")]),8,rt),t("span",ut,"第 "+u(x.value)+" 页 / 共 "+u(Y.value)+" 页",1),t("button",{onClick:we,disabled:x.value>=Y.value,class:"page-btn"},e[28]||(e[28]=[b(" 下一页 "),t("i",{class:"icon icon-next"},null,-1)]),8,dt)])])]),t("div",ct,[t("div",{class:"card-header"},[e[30]||(e[30]=t("h3",null,"武器列表",-1)),t("div",null,[t("button",{onClick:de,class:"action-btn danger"},e[29]||(e[29]=[t("i",{class:"icon icon-clear"},null,-1),b(" 清空选择 ")]))])]),t("div",pt,[t("table",vt,[e[32]||(e[32]=t("thead",null,[t("tr",null,[t("th",{width:"60px"},"选择"),t("th",null,"武器 ID")])],-1)),t("tbody",null,[(o(!0),i(y,null,S(Oe.value,l=>(o(),i("tr",{key:l.id},[t("td",null,[t("label",mt,[g(t("input",{type:"checkbox",value:l.id,"onUpdate:modelValue":e[3]||(e[3]=n=>H.value=n)},null,8,gt),[[je,H.value]]),e[31]||(e[31]=t("span",{class:"checkmark"},null,-1))])]),t("td",null,u(l.id),1)]))),128))])])])]),t("div",ft,[e[38]||(e[38]=t("h3",null,[t("i",{class:"icon icon-attribute"}),b(" 属性对比")],-1)),t("div",ht,[t("button",{onClick:Ne,class:k(["tool-btn",{active:W.value}])},[t("i",{class:k(["icon",W.value?"icon-restore":"icon-reverse"])},null,2),b(" "+u(W.value?"恢复默认视图":"反转行列"),1)],2),t("button",{onClick:Ie,class:k(["tool-btn",{active:E.value}])},[t("i",{class:k(["icon",E.value?"icon-restore":"icon-transpose"])},null,2),b(" "+u(E.value?"取消转置":"转置表格"),1)],2),t("button",{onClick:de,class:"tool-btn danger"},e[33]||(e[33]=[t("i",{class:"icon icon-clear"},null,-1),b(" 清空对比武器 ")]))]),t("div",bt,[t("div",yt,[t("div",St,[e[34]||(e[34]=t("i",{class:"icon icon-search"},null,-1)),g(t("input",{"onUpdate:modelValue":e[4]||(e[4]=l=>J.value=l),placeholder:"搜索属性...",onInput:re,class:"search-input"},null,544),[[T,J.value]]),t("div",At,[t("button",{onClick:We,class:"small-btn"},u(V.value?"取消全选":"全选"),1),t("button",{onClick:Ee,class:"small-btn danger"}," 清空 ")])]),t("div",Ct,[g(t("select",{multiple:"","onUpdate:modelValue":e[5]||(e[5]=l=>h.value=l),class:"multi-select",size:"10"},[(o(!0),i(y,null,S(K.value,l=>(o(),i("option",{key:l,value:l,class:"select-option"},u(l),9,kt))),128))],512),[[qe,h.value]]),t("div",Tt," 已选择 "+u(h.value.length)+" / "+u(oe.value.length)+" 个属性 ",1)])]),t("div",Dt,[e[36]||(e[36]=t("div",{class:"preview-header"},[t("h4",null,"已选属性预览"),t("span",{class:"hint-text"},"点击属性可移除")],-1)),t("div",Ft,[(o(!0),i(y,null,S(h.value,l=>(o(),i("span",{key:l,class:"tag",onClick:n=>_e(l)},[b(u(l)+" ",1),e[35]||(e[35]=t("i",{class:"icon icon-close"},null,-1))],8,Rt))),128)),h.value.length===0?(o(),i("span",xt,"暂无选择")):F("",!0)])])]),_.value.length&&h.value.length?(o(),i("div",Ot,[t("div",Wt,[t("table",Et,[t("thead",null,[t("tr",null,[t("th",null,u(Z.value==="normal"?"属性名":"武器 ID"),1),(o(!0),i(y,null,S(_.value,l=>(o(),i("th",{key:l.id},u(Z.value==="normal"?l.id:"属性名"),1))),128))])]),t("tbody",null,[Z.value==="normal"?(o(!0),i(y,{key:0},S(h.value,l=>(o(),i("tr",{key:l},[t("td",_t,u(l),1),(o(!0),i(y,null,S(_.value,n=>(o(),i("td",{key:n.id,class:k(ue(q(n,l)))},u(q(n,l)||"-"),3))),128))]))),128)):(o(!0),i(y,{key:1},S(_.value,l=>(o(),i("tr",{key:l.id},[t("td",Mt,u(l.id),1),(o(!0),i(y,null,S(h.value,n=>(o(),i("td",{key:n,class:k(ue(q(l,n)))},u(q(l,n)||"-"),3))),128))]))),128))])])])])):(o(),i("div",wt,[e[37]||(e[37]=t("i",{class:"icon icon-empty"},null,-1)),t("p",null,u(_.value.length?"请选择要对比的属性":"请先选择要对比的武器"),1)]))]),t("div",Nt,[t("div",It,[e[41]||(e[41]=t("h3",null,[t("i",{class:"icon icon-inheritance"}),b(" 继承关系")],-1)),_.value.length?(o(),i("div",Pt,[t("table",Bt,[e[39]||(e[39]=t("thead",null,[t("tr",null,[t("th",{width:"30%"},"武器 ID"),t("th",{width:"70%"},"继承链")])],-1)),t("tbody",null,[(o(!0),i(y,null,S(_.value,l=>(o(),i("tr",{key:l.id},[t("td",null,u(l.id),1),t("td",null,u(Ue(l).join(" → ")),1)]))),128))])])])):(o(),i("div",Ut,e[40]||(e[40]=[t("i",{class:"icon icon-info"},null,-1),t("p",null,"选择武器查看继承关系",-1)])))]),t("div",Lt,[e[43]||(e[43]=t("h3",null,[t("i",{class:"icon icon-ranking"}),b(" 继承排行榜")],-1)),se.value.length?(o(),i("div",Ht,[(o(!0),i(y,null,S(se.value.slice(0,5),(l,n)=>(o(),i("div",{key:n,class:"ranking-item"},[t("span",Vt,u(n+1),1),t("span",qt,u(l.weapon),1),t("span",jt,u(l.count)+" 次",1)]))),128))])):(o(),i("div",Xt,e[42]||(e[42]=[t("i",{class:"icon icon-info"},null,-1),t("p",null,"暂无继承数据",-1)])))])])],512),[[ae,C.value==="compare"]]),g(t("section",Gt,[t("div",$t,[t("input",{type:"file",onChange:pe,accept:".xml",class:"file-input",title:"加载单位.xml"},null,32),t("input",{type:"file",onChange:Q,accept:".xml",class:"file-input",title:"加载Weapon.xml"},null,32),f.value?(o(),i("button",{key:0,onClick:ke,class:"export-btn"},"导出XML")):F("",!0)]),f.value?(o(),i("div",zt,[t("div",Jt,[(o(!0),i(y,null,S(f.value.querySelectorAll("GameObject"),l=>(o(),i("div",{key:l.getAttribute("id"),class:k(["unit-item",{selected:r.value===l}]),onClick:n=>he(l)},u(l.getAttribute("id")||"未命名单位"),11,Kt))),128))]),r.value?(o(),i("div",Yt,[e[60]||(e[60]=t("h3",null,"单位详细信息",-1)),t("div",Zt,[e[45]||(e[45]=t("span",{class:"detail-label"},"ID:",-1)),g(t("input",{class:"detail-value edit-input","onUpdate:modelValue":e[6]||(e[6]=l=>d.value.id=l),onChange:U},null,544),[[T,d.value.id]])]),t("div",Qt,[t("div",{class:"group-header",onClick:e[7]||(e[7]=l=>X("csf"))},[e[46]||(e[46]=t("span",null,"CSF相关描述",-1)),t("span",el,u(R("csf")?"−":"+"),1)]),R("csf")?(o(),i("div",tl,[t("div",ll,[e[47]||(e[47]=t("span",{class:"detail-label"},"DisplayName:",-1)),g(t("input",{class:"detail-value edit-input","onUpdate:modelValue":e[8]||(e[8]=l=>d.value.displayName=l),onChange:ye},null,544),[[T,d.value.displayName]])]),t("div",al,[e[48]||(e[48]=t("span",{class:"detail-label"},"TypeDescription:",-1)),g(t("input",{class:"detail-value edit-input","onUpdate:modelValue":e[9]||(e[9]=l=>d.value.typeDescription=l),onChange:U},null,544),[[T,d.value.typeDescription]])]),t("div",nl,[e[49]||(e[49]=t("span",{class:"detail-label"},"Description:",-1)),g(t("input",{class:"detail-value edit-input","onUpdate:modelValue":e[10]||(e[10]=l=>d.value.description=l),onChange:U},null,544),[[T,d.value.description]])])])):F("",!0)]),t("div",il,[e[50]||(e[50]=t("span",{class:"detail-label"},"建造时间:",-1)),g(t("input",{class:"detail-value edit-input","onUpdate:modelValue":e[11]||(e[11]=l=>d.value.buildTime=l),onChange:U,type:"number"},null,544),[[T,d.value.buildTime]]),e[51]||(e[51]=t("span",{class:"unit-suffix"},"秒",-1))]),t("div",ol,[t("div",{class:"group-header",onClick:e[12]||(e[12]=l=>X("tech"))},[e[52]||(e[52]=t("span",null,"科技需求",-1)),t("span",sl,u(R("tech")?"−":"+"),1)]),R("tech")?(o(),i("div",rl,[t("div",ul,[e[53]||(e[53]=t("span",{class:"detail-label"},"NeededUpgrade:",-1)),g(t("input",{class:"detail-value edit-input","onUpdate:modelValue":e[13]||(e[13]=l=>d.value.neededUpgrade=l),onChange:Se},null,544),[[T,d.value.neededUpgrade]])]),t("div",dl,[e[54]||(e[54]=t("span",{class:"detail-label"},"建造数量上限:",-1)),g(t("input",{class:"detail-value edit-input","onUpdate:modelValue":e[14]||(e[14]=l=>d.value.maxSimultaneous=l),onChange:U,type:"number"},null,544),[[T,d.value.maxSimultaneous]])])])):F("",!0)]),t("div",cl,[t("div",{class:"group-header",onClick:e[15]||(e[15]=l=>X("costHealth"))},[e[55]||(e[55]=t("span",null,"造价与生命值",-1)),t("span",pl,u(R("costHealth")?"−":"+"),1)]),R("costHealth")?(o(),i("div",vl,[t("div",ml,[e[56]||(e[56]=t("span",{class:"detail-label"},"造价:",-1)),g(t("input",{class:"detail-value edit-input","onUpdate:modelValue":e[16]||(e[16]=l=>d.value.buildCost=l),onChange:Ae,type:"number"},null,544),[[T,d.value.buildCost]])]),t("div",gl,[e[57]||(e[57]=t("span",{class:"detail-label"},"生命值:",-1)),g(t("input",{class:"detail-value edit-input","onUpdate:modelValue":e[17]||(e[17]=l=>d.value.maxHealth=l),onChange:Ce,type:"number"},null,544),[[T,d.value.maxHealth]])])])):F("",!0)]),t("div",fl,[t("div",{class:"group-header",onClick:e[18]||(e[18]=l=>X("range"))},[e[58]||(e[58]=t("span",null,"武器射程",-1)),t("span",hl,u(R("range")?"−":"+"),1)]),R("range")?(o(),i("div",bl,[w.value.length===0?(o(),i("div",yl,e[59]||(e[59]=[t("span",{class:"detail-label"},"无武器数据",-1)]))):(o(!0),i(y,{key:1},S(w.value,(l,n)=>(o(),i("div",{class:"detail-row",key:n},[t("span",Sl,"武器 "+u(n+1)+" ("+u(l.id)+"):",1),t("div",Al,[t("div",null,"攻击范围: "+u(l.attackRange||0),1),t("div",null,"最小射程: "+u(l.minAttackRange||0),1),t("div",null,"伤害值: "+u(l.Damage||0),1),t("div",null,"伤害范围: "+u(l.Radius||0),1)])]))),128))])):F("",!0)])])):F("",!0)])):F("",!0)],512),[[ae,C.value==="GOBedit"]])])]))}},Dl=He(Cl,[["__scopeId","data-v-934ead49"]]);export{Dl as default};
|