import{s as j,x as q,e as a,J,W,c as K,a6 as O,q as H,a7 as Q,d as X,r as m,u as Z,k as ee,a9 as te,H as S,i as U,b as z,w as l,g as b,a as ae,j as N,m as L,h as n,p as T,f as R,v as D}from"./index-BrhME0Dw.js";import{V as le,a as g,b as f,_ as oe}from"./SimplePage.vue_vue_type_script_setup_true_lang-CxFFd9iP.js";import{u as se,l as ne}from"./common-CvoIC5ir.js";import{m as ie}from"./markdown-BS2QN_WF.js";import{V as de,b as ue}from"./VCard-DgPOJonh.js";import{V as re}from"./VDivider-CRnuQWb1.js";import{u as me,b as Y,e as $,d as ce,f as fe,V as E,g as pe}from"./VSelect-B8fdXrAN.js";import{V as w}from"./VBtn-W2di21BR.js";import{a as ve}from"./VList-BcMyXGiT.js";import{u as G,a as _e,m as he}from"./dimensions-g-Hg75km.js";import{_ as Ve}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./VSpacer-Cyb0OpTp.js";import"./index-W86lZ1ks.js";import"./VAvatar-BvBVx7K7.js";import"./index-CHUUO2Gl.js";import"./forwardRefs-YZME3Z-4.js";import"./scopeId-Bb-xzR7W.js";import"./VMenu-qoiHRwtH.js";import"./resizeObserver-BLxqKstE.js";import"./VProgressCircular-jw_3a1Fn.js";import"./ssrBoot-CnxmaXlH.js";const be=q({start:Boolean,end:Boolean,...he(),..._e()},"VListItemAction"),ge=j()({name:"VListItemAction",props:be(),setup(o,p){let{slots:u}=p;return G(()=>a(o.tag,{class:["v-list-item-action",{"v-list-item-action--start":o.start,"v-list-item-action--end":o.end},o.class],style:o.style},u)),{}}}),Ce=q({...ce(),...Q(fe(),["inline"])},"VCheckbox"),ke=j()({name:"VCheckbox",inheritAttrs:!1,props:Ce(),emits:{"update:modelValue":o=>!0,"update:focused":o=>!0},setup(o,p){let{attrs:u,slots:d}=p;const c=J(o,"modelValue"),{isFocused:i,focus:r,blur:C}=me(o),k=W(),y=K(()=>o.id||`checkbox-${k}`);return G(()=>{const[v,I]=O(u),F=Y.filterProps(o),_=$.filterProps(o);return a(Y,H({class:["v-checkbox",o.class]},v,F,{modelValue:c.value,"onUpdate:modelValue":h=>c.value=h,id:y.value,focused:i.value,style:o.style}),{...d,default:h=>{let{id:B,messagesId:P,isDisabled:A,isReadonly:M,isValid:x}=h;return a($,H(_,{id:B.value,"aria-describedby":P.value,disabled:A.value,readonly:M.value},I,{error:x.value===!1,modelValue:c.value,"onUpdate:modelValue":t=>c.value=t,onFocus:r,onBlur:C}),d)}})}),{}}}),xe={key:0,style:{padding:"30px"}},we=["innerHTML"],ye={style:{height:"30px"}},Ie=X({__name:"yuzuCheatsManagement",setup(o){let p=m(!1),u=m([]),d=m(""),c=m([]),i=m(""),r=m([]),C=m(window.innerHeight-450),k=m("");const y=se(),v=Z();let I=`
这个模块是对 Yuzu 金手指功能的一个补充，目标是实现类似 Ryujinx 对金手指中单个作弊项进行开关的功能.

在使用前请先阅读以下说明：

1. 请先确认金手指文件已经可以在 Yuzu 中被识别，如果 Yuzu 不能识别你的金手指，那么这里也不能
2. 如果不清楚如何在 Yuzu 中添加金手指，可以在 B 站上搜索相关教程
3. 某些金手指中的前面的一些公共的作弊项是必须启用的，请不要关闭这些作弊项（这些项目一般都在文件的最上面
4. 修改后需要重启游戏才会生效
5. 点击保存时会自动备份原来的金手指文件，如果出现问题，可以自行用这些备份文件来还原
`;ee(async()=>{v.cleanMessages(),await F(),_(),window.addEventListener("resize",_),k.value=ie.parse(I)}),te(()=>{window.removeEventListener("resize",_)});async function F(){let t=await window.eel.scan_all_cheats_folder()();return t.code===0&&t.data?(u.value=t.data,ne().then(e=>{let s=[];for(let V of u.value)V.game_name=e[V.game_id],s.push(V);u.value=s}),p.value=!0,u.value):[]}function _(){C.value=window.innerHeight-460}function h(t){if(!t)return"";let e=t.game_name?t.game_name:y.gameDataInited?"未知游戏":"游戏信息加载中...";return`[${t.game_id}] ${e}`}function B(t){window.eel.list_all_cheat_files_from_folder(t)(e=>{e.code===0&&e.data?(c.value=e.data,i.value=e.data[0].path):(u.value=[],i.value="")})}function P(t){r.value=[],window.eel.load_cheat_chunk_info(t)(e=>{e.code===0&&e.data&&(r.value=e.data)})}function A(){if(!r.value)return;let t=r.value.filter(e=>e.enable).map(e=>e.title);window.eel.update_current_cheats(t,i.value)(e=>{e.code===0&&(v.appendConsoleMessage("保存成功"),v.showConsoleDialog())})}function M(){window.eel.open_cheat_mod_folder(d.value)(t=>{t.code===0&&v.appendConsoleMessage("打开文件夹成功")})}function x(t){for(let e of r.value)e.enable=t}return S(d,t=>{t&&t.length>0&&B(t)},{immediate:!1}),S(i,t=>{t&&t.length>0&&P(t)},{immediate:!1}),(t,e)=>(z(),U(oe,null,{default:l(()=>[a(de,{style:{height:"100%"}},{default:l(()=>[a(ue,{class:"text-h4 text-primary"},{default:l(()=>e[4]||(e[4]=[b(" Yuzu 金手指管理 ")])),_:1}),a(re),a(le,null,{default:l(()=>[a(g,null,{default:l(()=>[a(f,null,{default:l(()=>[a(E,{items:n(u),modelValue:n(d),"onUpdate:modelValue":e[0]||(e[0]=s=>T(d)?d.value=s:d=s),"item-title":h,"item-value":"cheats_path",label:"选择游戏 mod 目录","hide-details":"",variant:"underlined",disabled:!n(p)},null,8,["items","modelValue","disabled"])]),_:1})]),_:1}),n(d)===""?(z(),ae("div",xe,[R("div",{class:"body-1 text--primary",innerHTML:n(k)},null,8,we)])):N("",!0),L(a(g,null,{default:l(()=>[a(f,null,{default:l(()=>[a(E,{items:n(c),modelValue:n(i),"onUpdate:modelValue":e[1]||(e[1]=s=>T(i)?i.value=s:i=s),label:"选择金手指文件","item-title":"name","item-value":"path",variant:"underlined","hide-details":""},null,8,["items","modelValue"])]),_:1})]),_:1},512),[[D,n(d)!==""]]),L(a(g,null,{default:l(()=>[a(f,null,{default:l(()=>[a(w,{block:"",variant:"outlined",color:"success",onClick:A},{default:l(()=>e[5]||(e[5]=[b("保存设定")])),_:1})]),_:1}),a(f,null,{default:l(()=>[a(w,{block:"",variant:"outlined",color:"info",onClick:M},{default:l(()=>e[6]||(e[6]=[b("打开 Mod 文件夹")])),_:1})]),_:1})]),_:1},512),[[D,n(i)!==""]]),L(a(g,null,{default:l(()=>[a(f,null,{default:l(()=>[a(pe,{items:n(r),height:n(C)},{default:l(({item:s})=>[a(ve,null,{default:l(()=>[a(ge,null,{default:l(()=>[R("div",ye,[a(ke,{modelValue:s.enable,"onUpdate:modelValue":V=>s.enable=V,label:s.title,"hide-details":"",color:"primary",density:"compact"},null,8,["modelValue","onUpdate:modelValue","label"])])]),_:2},1024)]),_:2},1024)]),_:1},8,["items","height"])]),_:1})]),_:1},512),[[D,n(i)!==""]]),n(r)&&n(r).length>0?(z(),U(g,{key:1},{default:l(()=>[a(f,null,{default:l(()=>[a(w,{block:"",variant:"outlined",color:"info",onClick:e[2]||(e[2]=s=>x(!0))},{default:l(()=>e[7]||(e[7]=[b("选择全部")])),_:1})]),_:1}),a(f,null,{default:l(()=>[a(w,{block:"",variant:"outlined",color:"error",onClick:e[3]||(e[3]=s=>x(!1))},{default:l(()=>e[8]||(e[8]=[b("反选全部")])),_:1})]),_:1})]),_:1})):N("",!0)]),_:1})]),_:1})]),_:1}))}}),We=Ve(Ie,[["__scopeId","data-v-7d7deab5"]]);export{We as default};
