From 33012c48e64dfd0d9488960bc5305feaa64a1cca Mon Sep 17 00:00:00 2001 From: Leonmmcoset Date: Thu, 5 Feb 2026 13:15:17 +0800 Subject: [PATCH] =?UTF-8?q?GUI=E6=B5=8B=E8=AF=95+Lua=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=AE=A1=E6=97=B6=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMLeonOS.csproj | 2 +- docs/cmleonos/docs/.vuepress/dist/404.html | 8 ++-- ....html-quW2M2uK.js => 404.html-xtbd148X.js} | 2 +- .../{app-DPqZ-Olm.js => app-Qcj6bGr7.js} | 2 +- ...ESuujR.js => get-started.html-CiROnutu.js} | 2 +- ...tml-C2W3YGc4.js => index.html-68ZyroCH.js} | 2 +- ....html-CwfoAtde.js => lua.html-BpPm4nZm.js} | 30 +++++++++++-- .../docs/.vuepress/dist/get-started.html | 8 ++-- docs/cmleonos/docs/.vuepress/dist/index.html | 6 +-- docs/cmleonos/docs/.vuepress/dist/lua.html | 34 +++++++++++--- docs/cmleonos/docs/lua.md | 24 ++++++++++ interpreter/UniLua/LuaOsLib.cs | 29 +++++++++++- shell/CommandList.cs | 3 ++ shell/Commands/TestGuiCommand.cs | 44 +++++++++++++++++++ shell/Shell.cs | 5 +++ 15 files changed, 174 insertions(+), 27 deletions(-) rename docs/cmleonos/docs/.vuepress/dist/assets/{404.html-quW2M2uK.js => 404.html-xtbd148X.js} (82%) rename docs/cmleonos/docs/.vuepress/dist/assets/{app-DPqZ-Olm.js => app-Qcj6bGr7.js} (99%) rename docs/cmleonos/docs/.vuepress/dist/assets/{get-started.html-CZESuujR.js => get-started.html-CiROnutu.js} (69%) rename docs/cmleonos/docs/.vuepress/dist/assets/{index.html-C2W3YGc4.js => index.html-68ZyroCH.js} (64%) rename docs/cmleonos/docs/.vuepress/dist/assets/{lua.html-CwfoAtde.js => lua.html-BpPm4nZm.js} (88%) create mode 100644 shell/Commands/TestGuiCommand.cs diff --git a/CMLeonOS.csproj b/CMLeonOS.csproj index 8b3b7f6..9fbd48c 100644 --- a/CMLeonOS.csproj +++ b/CMLeonOS.csproj @@ -19,7 +19,7 @@ VMware Use VMware Player or Workstation to deploy and debug. 192.168.0.8 - None + Gzip Elf False False diff --git a/docs/cmleonos/docs/.vuepress/dist/404.html b/docs/cmleonos/docs/.vuepress/dist/404.html index e41be1d..b7f4497 100644 --- a/docs/cmleonos/docs/.vuepress/dist/404.html +++ b/docs/cmleonos/docs/.vuepress/dist/404.html @@ -33,11 +33,11 @@ CMLeonOS官方文档站 - - + + -

404

How did we get here?
Take me home
- +

404

Looks like we've got some broken links.
Take me home
+ diff --git a/docs/cmleonos/docs/.vuepress/dist/assets/404.html-quW2M2uK.js b/docs/cmleonos/docs/.vuepress/dist/assets/404.html-xtbd148X.js similarity index 82% rename from docs/cmleonos/docs/.vuepress/dist/assets/404.html-quW2M2uK.js rename to docs/cmleonos/docs/.vuepress/dist/assets/404.html-xtbd148X.js index 4d69e83..0494957 100644 --- a/docs/cmleonos/docs/.vuepress/dist/assets/404.html-quW2M2uK.js +++ b/docs/cmleonos/docs/.vuepress/dist/assets/404.html-xtbd148X.js @@ -1 +1 @@ -import{_ as e,c as o,b as a,o as n}from"./app-DPqZ-Olm.js";const l={};function r(s,t){return n(),o("div",null,[...t[0]||(t[0]=[a("p",null,"404 Not Found",-1)])])}const _=e(l,[["render",r]]),d=JSON.parse('{"path":"/404.html","title":"","lang":"zh-CN","frontmatter":{"layout":"NotFound"},"headers":[],"git":{},"filePathRelative":null}');export{_ as comp,d as data}; +import{_ as e,c as o,b as a,o as n}from"./app-Qcj6bGr7.js";const l={};function r(s,t){return n(),o("div",null,[...t[0]||(t[0]=[a("p",null,"404 Not Found",-1)])])}const _=e(l,[["render",r]]),d=JSON.parse('{"path":"/404.html","title":"","lang":"zh-CN","frontmatter":{"layout":"NotFound"},"headers":[],"git":{},"filePathRelative":null}');export{_ as comp,d as data}; diff --git a/docs/cmleonos/docs/.vuepress/dist/assets/app-DPqZ-Olm.js b/docs/cmleonos/docs/.vuepress/dist/assets/app-Qcj6bGr7.js similarity index 99% rename from docs/cmleonos/docs/.vuepress/dist/assets/app-DPqZ-Olm.js rename to docs/cmleonos/docs/.vuepress/dist/assets/app-Qcj6bGr7.js index 1f1f5e8..bc99aa7 100644 --- a/docs/cmleonos/docs/.vuepress/dist/assets/app-DPqZ-Olm.js +++ b/docs/cmleonos/docs/.vuepress/dist/assets/app-Qcj6bGr7.js @@ -16,7 +16,7 @@ * @vue/runtime-dom v3.5.27 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/let Xo;const ai=typeof window<"u"&&window.trustedTypes;if(ai)try{Xo=ai.createPolicy("vue",{createHTML:e=>e})}catch{}const Ta=Xo?e=>Xo.createHTML(e):e=>e,Cf="http://www.w3.org/2000/svg",Tf="http://www.w3.org/1998/Math/MathML",Rt=typeof document<"u"?document:null,ci=Rt&&Rt.createElement("template"),Af={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const o=t==="svg"?Rt.createElementNS(Cf,e):t==="mathml"?Rt.createElementNS(Tf,e):n?Rt.createElement(e,{is:n}):Rt.createElement(e);return e==="select"&&r&&r.multiple!=null&&o.setAttribute("multiple",r.multiple),o},createText:e=>Rt.createTextNode(e),createComment:e=>Rt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Rt.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,o,s){const i=n?n.previousSibling:t.lastChild;if(o&&(o===s||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===s||!(o=o.nextSibling)););else{ci.innerHTML=Ta(r==="svg"?`${e}`:r==="mathml"?`${e}`:e);const l=ci.content;if(r==="svg"||r==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},zt="transition",Bn="animation",ir=Symbol("_vtc"),Aa={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},xf=Me({},ql,Aa),Lf=e=>(e.displayName="Transition",e.props=xf,e),bs=Lf((e,{slots:t})=>Q(_u,Rf(e),t)),rn=(e,t=[])=>{re(e)?e.forEach(n=>n(...t)):e&&e(...t)},ui=e=>e?re(e)?e.some(t=>t.length>1):e.length>1:!1;function Rf(e){const t={};for(const E in e)E in Aa||(t[E]=e[E]);if(e.css===!1)return t;const{name:n="v",type:r,duration:o,enterFromClass:s=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=s,appearActiveClass:c=i,appearToClass:u=l,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,v=Of(o),_=v&&v[0],S=v&&v[1],{onBeforeEnter:C,onEnter:T,onEnterCancelled:g,onLeave:b,onLeaveCancelled:H,onBeforeAppear:J=C,onAppear:$=T,onAppearCancelled:w=g}=t,R=(E,M,D,j)=>{E._enterCancelled=j,on(E,M?u:l),on(E,M?c:i),D&&D()},k=(E,M)=>{E._isLeaving=!1,on(E,f),on(E,p),on(E,h),M&&M()},z=E=>(M,D)=>{const j=E?$:T,L=()=>R(M,E,D);rn(j,[M,L]),fi(()=>{on(M,E?a:s),Tt(M,E?u:l),ui(j)||di(M,r,_,L)})};return Me(t,{onBeforeEnter(E){rn(C,[E]),Tt(E,s),Tt(E,i)},onBeforeAppear(E){rn(J,[E]),Tt(E,a),Tt(E,c)},onEnter:z(!1),onAppear:z(!0),onLeave(E,M){E._isLeaving=!0;const D=()=>k(E,M);Tt(E,f),E._enterCancelled?(Tt(E,h),mi(E)):(mi(E),Tt(E,h)),fi(()=>{E._isLeaving&&(on(E,f),Tt(E,p),ui(b)||di(E,r,S,D))}),rn(b,[E,D])},onEnterCancelled(E){R(E,!1,void 0,!0),rn(g,[E])},onAppearCancelled(E){R(E,!0,void 0,!0),rn(w,[E])},onLeaveCancelled(E){k(E),rn(H,[E])}})}function Of(e){if(e==null)return null;if(Ee(e))return[Io(e.enter),Io(e.leave)];{const t=Io(e);return[t,t]}}function Io(e){return Cc(e)}function Tt(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[ir]||(e[ir]=new Set)).add(t)}function on(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[ir];n&&(n.delete(t),n.size||(e[ir]=void 0))}function fi(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Pf=0;function di(e,t,n,r){const o=e._endId=++Pf,s=()=>{o===e._endId&&r()};if(n!=null)return setTimeout(s,n);const{type:i,timeout:l,propCount:a}=If(e,t);if(!i)return r();const c=i+"end";let u=0;const f=()=>{e.removeEventListener(c,h),s()},h=p=>{p.target===e&&++u>=a&&f()};setTimeout(()=>{u(n[v]||"").split(", "),o=r(`${zt}Delay`),s=r(`${zt}Duration`),i=hi(o,s),l=r(`${Bn}Delay`),a=r(`${Bn}Duration`),c=hi(l,a);let u=null,f=0,h=0;t===zt?i>0&&(u=zt,f=i,h=s.length):t===Bn?c>0&&(u=Bn,f=c,h=a.length):(f=Math.max(i,c),u=f>0?i>c?zt:Bn:null,h=u?u===zt?s.length:a.length:0);const p=u===zt&&/\b(?:transform|all)(?:,|$)/.test(r(`${zt}Property`).toString());return{type:u,timeout:f,propCount:h,hasTransform:p}}function hi(e,t){for(;e.lengthpi(n)+pi(e[r])))}function pi(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function mi(e){return(e?e.ownerDocument:document).body.offsetHeight}function kf(e,t,n){const r=e[ir];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Zr=Symbol("_vod"),xa=Symbol("_vsh"),eo={name:"show",beforeMount(e,{value:t},{transition:n}){e[Zr]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):jn(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),jn(e,!0),r.enter(e)):r.leave(e,()=>{jn(e,!1)}):jn(e,t))},beforeUnmount(e,{value:t}){jn(e,t)}};function jn(e,t){e.style.display=t?e[Zr]:"none",e[xa]=!t}const Nf=Symbol(""),Mf=/(?:^|;)\s*display\s*:/;function Df(e,t,n){const r=e.style,o=Oe(n);let s=!1;if(n&&!o){if(t)if(Oe(t))for(const i of t.split(";")){const l=i.slice(0,i.indexOf(":")).trim();n[l]==null&&Br(r,l,"")}else for(const i in t)n[i]==null&&Br(r,i,"");for(const i in n)i==="display"&&(s=!0),Br(r,i,n[i])}else if(o){if(t!==n){const i=r[Nf];i&&(n+=";"+i),r.cssText=n,s=Mf.test(n)}}else t&&e.removeAttribute("style");Zr in e&&(e[Zr]=s?r.display:"",e[xa]&&(r.display="none"))}const gi=/\s*!important$/;function Br(e,t,n){if(re(n))n.forEach(r=>Br(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=$f(e,t);gi.test(n)?e.setProperty(en(r),n.replace(gi,""),"important"):e[r]=n}}const vi=["Webkit","Moz","ms"],ko={};function $f(e,t){const n=ko[t];if(n)return n;let r=tt(t);if(r!=="filter"&&r in e)return ko[t]=r;r=fr(r);for(let o=0;oNo||(Vf.then(()=>No=0),No=Date.now());function Uf(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;gt(Wf(r,n.value),t,5,[r])};return n.value=e,n.attached=zf(),n}function Wf(e,t){if(re(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>o=>!o._stopped&&r&&r(o))}else return t}const wi=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Gf=(e,t,n,r,o,s)=>{const i=o==="svg";t==="class"?kf(e,r,i):t==="style"?Df(e,n,r):ur(t)?is(t)||Bf(e,t,n,r,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Kf(e,t,r,i))?(yi(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&_i(e,t,r,i,s,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!Oe(r))?yi(e,tt(t),r,s,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),_i(e,t,r,i))};function Kf(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&wi(t)&&oe(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return wi(t)&&Oe(n)?!1:t in e}const qf={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Yf=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=o=>{if(!("key"in o))return;const s=en(o.key);if(t.some(i=>i===s||qf[i]===s))return e(o)})},Jf=Me({patchProp:Gf},Af);let Mo,Ci=!1;function Qf(){return Mo=Ci?Mo:lf(Jf),Ci=!0,Mo}const Xf=(...e)=>{const t=Qf().createApp(...e),{mount:n}=t;return t.mount=r=>{const o=ed(r);if(o)return n(o,!0,Zf(o))},t};function Zf(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function ed(e){return Oe(e)?document.querySelector(e):e}var vr=e=>/^[a-z][a-z0-9+.-]*:/.test(e)||e.startsWith("//"),td=/.md((\?|#).*)?$/,nd=(e,t="/")=>vr(e)||e.startsWith("/")&&!e.startsWith(t)&&!td.test(e),br=e=>/^(https?:)?\/\//.test(e),Ti=e=>{if(!e||e.endsWith("/"))return e;let t=e.replace(/(^|\/)README.md$/i,"$1index.html");return t.endsWith(".md")?t=`${t.substring(0,t.length-3)}.html`:t.endsWith(".html")||(t=`${t}.html`),t.endsWith("/index.html")&&(t=t.substring(0,t.length-10)),t},rd="http://.",od=(e,t)=>{if(!e.startsWith("/")&&t){const n=t.slice(0,t.lastIndexOf("/"));return Ti(new URL(`${n}/${e}`,rd).pathname)}return Ti(e)},sd=(e,t)=>{const n=Object.keys(e).sort((r,o)=>{const s=o.split("/").length-r.split("/").length;return s!==0?s:o.length-r.length});for(const r of n)if(t.startsWith(r))return r;return"/"},id=/(#|\?)/,La=e=>{const[t,...n]=e.split(id);return{pathname:t,hashAndQueries:n.join("")}},ld=["link","meta","script","style","noscript","template"],ad=["title","base"],cd=([e,t,n])=>ad.includes(e)?e:ld.includes(e)?e==="meta"&&t.name?`${e}.${t.name}`:e==="template"&&t.id?`${e}.${t.id}`:JSON.stringify([e,Object.entries(t).map(([r,o])=>typeof o=="boolean"?o?[r,""]:null:[r,o]).filter(r=>r!=null).sort(([r],[o])=>r.localeCompare(o)),n]):null,ud=e=>{const t=new Set,n=[];return e.forEach(r=>{const o=cd(r);o&&!t.has(o)&&(t.add(o),n.push(r))}),n},fd=e=>e.endsWith("/")||e.endsWith(".html")?e:`${e}/`,Ra=e=>e.endsWith("/")?e.slice(0,-1):e,Oa=e=>e.startsWith("/")?e.slice(1):e,_s=e=>Object.prototype.toString.call(e)==="[object Object]",pt=e=>typeof e=="string";const dd="modulepreload",hd=function(e){return"/"+e},Ai={},Or=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),l=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));o=Promise.allSettled(n.map(a=>{if(a=hd(a),a in Ai)return;Ai[a]=!0;const c=a.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${u}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":dd,c||(f.as="script"),f.crossOrigin="",f.href=a,l&&f.setAttribute("nonce",l),document.head.appendChild(f),c)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${a}`)))})}))}function s(i){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=i,window.dispatchEvent(l),!l.defaultPrevented)throw i}return o.then(i=>{for(const l of i||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})},pd=JSON.parse("{}"),md=Object.fromEntries([["/get-started.html",{loader:()=>Or(()=>import("./get-started.html-CZESuujR.js"),[]),meta:{title:"配置教程"}}],["/lua.html",{loader:()=>Or(()=>import("./lua.html-CwfoAtde.js"),[]),meta:{title:"CMLeonOS Lua API 文档"}}],["/",{loader:()=>Or(()=>import("./index.html-C2W3YGc4.js"),[]),meta:{title:"主页"}}],["/404.html",{loader:()=>Or(()=>import("./404.html-quW2M2uK.js"),[]),meta:{title:""}}]]);/*! +**/let Xo;const ai=typeof window<"u"&&window.trustedTypes;if(ai)try{Xo=ai.createPolicy("vue",{createHTML:e=>e})}catch{}const Ta=Xo?e=>Xo.createHTML(e):e=>e,Cf="http://www.w3.org/2000/svg",Tf="http://www.w3.org/1998/Math/MathML",Rt=typeof document<"u"?document:null,ci=Rt&&Rt.createElement("template"),Af={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const o=t==="svg"?Rt.createElementNS(Cf,e):t==="mathml"?Rt.createElementNS(Tf,e):n?Rt.createElement(e,{is:n}):Rt.createElement(e);return e==="select"&&r&&r.multiple!=null&&o.setAttribute("multiple",r.multiple),o},createText:e=>Rt.createTextNode(e),createComment:e=>Rt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Rt.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,o,s){const i=n?n.previousSibling:t.lastChild;if(o&&(o===s||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===s||!(o=o.nextSibling)););else{ci.innerHTML=Ta(r==="svg"?`${e}`:r==="mathml"?`${e}`:e);const l=ci.content;if(r==="svg"||r==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},zt="transition",Bn="animation",ir=Symbol("_vtc"),Aa={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},xf=Me({},ql,Aa),Lf=e=>(e.displayName="Transition",e.props=xf,e),bs=Lf((e,{slots:t})=>Q(_u,Rf(e),t)),rn=(e,t=[])=>{re(e)?e.forEach(n=>n(...t)):e&&e(...t)},ui=e=>e?re(e)?e.some(t=>t.length>1):e.length>1:!1;function Rf(e){const t={};for(const E in e)E in Aa||(t[E]=e[E]);if(e.css===!1)return t;const{name:n="v",type:r,duration:o,enterFromClass:s=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=s,appearActiveClass:c=i,appearToClass:u=l,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,v=Of(o),_=v&&v[0],S=v&&v[1],{onBeforeEnter:C,onEnter:T,onEnterCancelled:g,onLeave:b,onLeaveCancelled:H,onBeforeAppear:J=C,onAppear:$=T,onAppearCancelled:w=g}=t,R=(E,M,D,j)=>{E._enterCancelled=j,on(E,M?u:l),on(E,M?c:i),D&&D()},k=(E,M)=>{E._isLeaving=!1,on(E,f),on(E,p),on(E,h),M&&M()},z=E=>(M,D)=>{const j=E?$:T,L=()=>R(M,E,D);rn(j,[M,L]),fi(()=>{on(M,E?a:s),Tt(M,E?u:l),ui(j)||di(M,r,_,L)})};return Me(t,{onBeforeEnter(E){rn(C,[E]),Tt(E,s),Tt(E,i)},onBeforeAppear(E){rn(J,[E]),Tt(E,a),Tt(E,c)},onEnter:z(!1),onAppear:z(!0),onLeave(E,M){E._isLeaving=!0;const D=()=>k(E,M);Tt(E,f),E._enterCancelled?(Tt(E,h),mi(E)):(mi(E),Tt(E,h)),fi(()=>{E._isLeaving&&(on(E,f),Tt(E,p),ui(b)||di(E,r,S,D))}),rn(b,[E,D])},onEnterCancelled(E){R(E,!1,void 0,!0),rn(g,[E])},onAppearCancelled(E){R(E,!0,void 0,!0),rn(w,[E])},onLeaveCancelled(E){k(E),rn(H,[E])}})}function Of(e){if(e==null)return null;if(Ee(e))return[Io(e.enter),Io(e.leave)];{const t=Io(e);return[t,t]}}function Io(e){return Cc(e)}function Tt(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[ir]||(e[ir]=new Set)).add(t)}function on(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[ir];n&&(n.delete(t),n.size||(e[ir]=void 0))}function fi(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Pf=0;function di(e,t,n,r){const o=e._endId=++Pf,s=()=>{o===e._endId&&r()};if(n!=null)return setTimeout(s,n);const{type:i,timeout:l,propCount:a}=If(e,t);if(!i)return r();const c=i+"end";let u=0;const f=()=>{e.removeEventListener(c,h),s()},h=p=>{p.target===e&&++u>=a&&f()};setTimeout(()=>{u(n[v]||"").split(", "),o=r(`${zt}Delay`),s=r(`${zt}Duration`),i=hi(o,s),l=r(`${Bn}Delay`),a=r(`${Bn}Duration`),c=hi(l,a);let u=null,f=0,h=0;t===zt?i>0&&(u=zt,f=i,h=s.length):t===Bn?c>0&&(u=Bn,f=c,h=a.length):(f=Math.max(i,c),u=f>0?i>c?zt:Bn:null,h=u?u===zt?s.length:a.length:0);const p=u===zt&&/\b(?:transform|all)(?:,|$)/.test(r(`${zt}Property`).toString());return{type:u,timeout:f,propCount:h,hasTransform:p}}function hi(e,t){for(;e.lengthpi(n)+pi(e[r])))}function pi(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function mi(e){return(e?e.ownerDocument:document).body.offsetHeight}function kf(e,t,n){const r=e[ir];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Zr=Symbol("_vod"),xa=Symbol("_vsh"),eo={name:"show",beforeMount(e,{value:t},{transition:n}){e[Zr]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):jn(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),jn(e,!0),r.enter(e)):r.leave(e,()=>{jn(e,!1)}):jn(e,t))},beforeUnmount(e,{value:t}){jn(e,t)}};function jn(e,t){e.style.display=t?e[Zr]:"none",e[xa]=!t}const Nf=Symbol(""),Mf=/(?:^|;)\s*display\s*:/;function Df(e,t,n){const r=e.style,o=Oe(n);let s=!1;if(n&&!o){if(t)if(Oe(t))for(const i of t.split(";")){const l=i.slice(0,i.indexOf(":")).trim();n[l]==null&&Br(r,l,"")}else for(const i in t)n[i]==null&&Br(r,i,"");for(const i in n)i==="display"&&(s=!0),Br(r,i,n[i])}else if(o){if(t!==n){const i=r[Nf];i&&(n+=";"+i),r.cssText=n,s=Mf.test(n)}}else t&&e.removeAttribute("style");Zr in e&&(e[Zr]=s?r.display:"",e[xa]&&(r.display="none"))}const gi=/\s*!important$/;function Br(e,t,n){if(re(n))n.forEach(r=>Br(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=$f(e,t);gi.test(n)?e.setProperty(en(r),n.replace(gi,""),"important"):e[r]=n}}const vi=["Webkit","Moz","ms"],ko={};function $f(e,t){const n=ko[t];if(n)return n;let r=tt(t);if(r!=="filter"&&r in e)return ko[t]=r;r=fr(r);for(let o=0;oNo||(Vf.then(()=>No=0),No=Date.now());function Uf(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;gt(Wf(r,n.value),t,5,[r])};return n.value=e,n.attached=zf(),n}function Wf(e,t){if(re(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>o=>!o._stopped&&r&&r(o))}else return t}const wi=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Gf=(e,t,n,r,o,s)=>{const i=o==="svg";t==="class"?kf(e,r,i):t==="style"?Df(e,n,r):ur(t)?is(t)||Bf(e,t,n,r,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Kf(e,t,r,i))?(yi(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&_i(e,t,r,i,s,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!Oe(r))?yi(e,tt(t),r,s,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),_i(e,t,r,i))};function Kf(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&wi(t)&&oe(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return wi(t)&&Oe(n)?!1:t in e}const qf={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Yf=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=o=>{if(!("key"in o))return;const s=en(o.key);if(t.some(i=>i===s||qf[i]===s))return e(o)})},Jf=Me({patchProp:Gf},Af);let Mo,Ci=!1;function Qf(){return Mo=Ci?Mo:lf(Jf),Ci=!0,Mo}const Xf=(...e)=>{const t=Qf().createApp(...e),{mount:n}=t;return t.mount=r=>{const o=ed(r);if(o)return n(o,!0,Zf(o))},t};function Zf(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function ed(e){return Oe(e)?document.querySelector(e):e}var vr=e=>/^[a-z][a-z0-9+.-]*:/.test(e)||e.startsWith("//"),td=/.md((\?|#).*)?$/,nd=(e,t="/")=>vr(e)||e.startsWith("/")&&!e.startsWith(t)&&!td.test(e),br=e=>/^(https?:)?\/\//.test(e),Ti=e=>{if(!e||e.endsWith("/"))return e;let t=e.replace(/(^|\/)README.md$/i,"$1index.html");return t.endsWith(".md")?t=`${t.substring(0,t.length-3)}.html`:t.endsWith(".html")||(t=`${t}.html`),t.endsWith("/index.html")&&(t=t.substring(0,t.length-10)),t},rd="http://.",od=(e,t)=>{if(!e.startsWith("/")&&t){const n=t.slice(0,t.lastIndexOf("/"));return Ti(new URL(`${n}/${e}`,rd).pathname)}return Ti(e)},sd=(e,t)=>{const n=Object.keys(e).sort((r,o)=>{const s=o.split("/").length-r.split("/").length;return s!==0?s:o.length-r.length});for(const r of n)if(t.startsWith(r))return r;return"/"},id=/(#|\?)/,La=e=>{const[t,...n]=e.split(id);return{pathname:t,hashAndQueries:n.join("")}},ld=["link","meta","script","style","noscript","template"],ad=["title","base"],cd=([e,t,n])=>ad.includes(e)?e:ld.includes(e)?e==="meta"&&t.name?`${e}.${t.name}`:e==="template"&&t.id?`${e}.${t.id}`:JSON.stringify([e,Object.entries(t).map(([r,o])=>typeof o=="boolean"?o?[r,""]:null:[r,o]).filter(r=>r!=null).sort(([r],[o])=>r.localeCompare(o)),n]):null,ud=e=>{const t=new Set,n=[];return e.forEach(r=>{const o=cd(r);o&&!t.has(o)&&(t.add(o),n.push(r))}),n},fd=e=>e.endsWith("/")||e.endsWith(".html")?e:`${e}/`,Ra=e=>e.endsWith("/")?e.slice(0,-1):e,Oa=e=>e.startsWith("/")?e.slice(1):e,_s=e=>Object.prototype.toString.call(e)==="[object Object]",pt=e=>typeof e=="string";const dd="modulepreload",hd=function(e){return"/"+e},Ai={},Or=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),l=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));o=Promise.allSettled(n.map(a=>{if(a=hd(a),a in Ai)return;Ai[a]=!0;const c=a.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${u}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":dd,c||(f.as="script"),f.crossOrigin="",f.href=a,l&&f.setAttribute("nonce",l),document.head.appendChild(f),c)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${a}`)))})}))}function s(i){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=i,window.dispatchEvent(l),!l.defaultPrevented)throw i}return o.then(i=>{for(const l of i||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})},pd=JSON.parse("{}"),md=Object.fromEntries([["/get-started.html",{loader:()=>Or(()=>import("./get-started.html-CiROnutu.js"),[]),meta:{title:"配置教程"}}],["/lua.html",{loader:()=>Or(()=>import("./lua.html-BpPm4nZm.js"),[]),meta:{title:"CMLeonOS Lua API 文档"}}],["/",{loader:()=>Or(()=>import("./index.html-68ZyroCH.js"),[]),meta:{title:"主页"}}],["/404.html",{loader:()=>Or(()=>import("./404.html-xtbd148X.js"),[]),meta:{title:""}}]]);/*! * vue-router v4.6.4 * (c) 2025 Eduardo San Martin Morote * @license MIT diff --git a/docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-CZESuujR.js b/docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-CiROnutu.js similarity index 69% rename from docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-CZESuujR.js rename to docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-CiROnutu.js index 166879b..d563600 100644 --- a/docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-CZESuujR.js +++ b/docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-CiROnutu.js @@ -1 +1 @@ -import{_ as a,c as l,a as t,o as n}from"./app-DPqZ-Olm.js";const i={};function s(r,e){return n(),l("div",null,[...e[0]||(e[0]=[t('

配置教程

准备工作

首先,准备一台实体机/虚拟机,确保这台机器等于或大于以下配置:

  • 处理器:一核以上
  • 内存:512MB以上
  • 硬盘:512MB以上
  • 一个键盘
  • 一个蜂鸣器或音频输出设备
  • 建议装上AMD驱动的网卡(Intel驱动的网卡似乎无法运行)

配置硬盘

使用PE或其它工具格式化硬盘(注意只分一个区,文件系统选择FAT32)

安装CMLeonOS

将CMLeonOS的ISO文件挂载到虚拟机或实体机上,启动后按照提示进行 First time setup。

在 First time setup 中,系统会让你配置用户名、密码、主机名,配置完后会进行重启,重启之后正常登陆系统,然后就可以开始使用CMLeonOS了。

',9)])])}const c=a(i,[["render",s]]),h=JSON.parse('{"path":"/get-started.html","title":"配置教程","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"准备工作","slug":"准备工作","link":"#准备工作","children":[]},{"level":2,"title":"配置硬盘","slug":"配置硬盘","link":"#配置硬盘","children":[]},{"level":2,"title":"安装CMLeonOS","slug":"安装cmleonos","link":"#安装cmleonos","children":[]}],"git":{},"filePathRelative":"get-started.md"}');export{c as comp,h as data}; +import{_ as t,c as a,a as l,o as s}from"./app-Qcj6bGr7.js";const n={};function i(o,e){return s(),a("div",null,[...e[0]||(e[0]=[l('

配置教程

准备工作

首先,准备一台实体机/虚拟机,确保这台机器等于或大于以下配置:

  • 处理器:一核以上
  • 内存:512MB以上
  • 硬盘:512MB以上
  • 一个键盘
  • 一个蜂鸣器或音频输出设备
  • 建议装上AMD驱动的网卡(Intel驱动的网卡似乎无法运行)

配置硬盘

使用PE或其它工具格式化硬盘(注意只分一个区,文件系统选择FAT32)

安装CMLeonOS

将CMLeonOS的ISO文件挂载到虚拟机或实体机上,启动后按照提示进行 First time setup。

在 First time setup 中,系统会让你配置用户名、密码、主机名,配置完后会进行重启,重启之后正常登陆系统,然后就可以开始使用CMLeonOS了。

',9)])])}const r=t(n,[["render",i]]),m=JSON.parse('{"path":"/get-started.html","title":"配置教程","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"准备工作","slug":"准备工作","link":"#准备工作","children":[]},{"level":2,"title":"配置硬盘","slug":"配置硬盘","link":"#配置硬盘","children":[]},{"level":2,"title":"安装CMLeonOS","slug":"安装cmleonos","link":"#安装cmleonos","children":[]}],"git":{"updatedTime":1770190333000,"contributors":[{"name":"Leonmmcoset","username":"Leonmmcoset","email":"testmod@qq.com","commits":1,"url":"https://github.com/Leonmmcoset"}],"changelog":[{"hash":"33510365f48beba3a56b2dc6afd4c54b1fbdab60","time":1770190333000,"email":"testmod@qq.com","author":"Leonmmcoset","message":"docs&Lua input()"}]},"filePathRelative":"get-started.md"}');export{r as comp,m as data}; diff --git a/docs/cmleonos/docs/.vuepress/dist/assets/index.html-C2W3YGc4.js b/docs/cmleonos/docs/.vuepress/dist/assets/index.html-68ZyroCH.js similarity index 64% rename from docs/cmleonos/docs/.vuepress/dist/assets/index.html-C2W3YGc4.js rename to docs/cmleonos/docs/.vuepress/dist/assets/index.html-68ZyroCH.js index 2faab8f..94ccb82 100644 --- a/docs/cmleonos/docs/.vuepress/dist/assets/index.html-C2W3YGc4.js +++ b/docs/cmleonos/docs/.vuepress/dist/assets/index.html-68ZyroCH.js @@ -1 +1 @@ -import{_ as t,c as e,o as a}from"./app-DPqZ-Olm.js";const i={};function l(n,o){return a(),e("div")}const r=t(i,[["render",l]]),c=JSON.parse('{"path":"/","title":"主页","lang":"zh-CN","frontmatter":{"home":true,"title":"主页","actions":[{"text":"开始配置","link":"/get-started.html","type":"primary"},{"text":"Lua 文档","link":"/lua.html","type":"secondary"}],"features":[{"title":"安全用户系统","details":"用户系统是直接绑定在内核下的,通过 SHA-256 密码哈希算法对用户密码进行加密存储,确保用户密码的安全性。"},{"title":"Lua 脚本支持","details":"CMLeonOS支持 Lua 脚本,用户可以通过 Lua 脚本实现自定义功能。"},{"title":"网络","details":"CMLeonOS支持 TCP/IP 协议栈,用户可以通过网络连接到其他设备。"},{"title":"FTP 服务器","details":"CMLeonOS支持 FTP 服务器,用户可以通过 FTP 协议上传下载文件。"},{"title":"内置编辑器","details":"CMLeonOS支持内置编辑器,用户可以直接在CMLeonOS中编辑文件。"},{"title":"硬盘存储","details":"CMLeonOS支持硬盘存储,用户可以将文件持久存储在硬盘中。"}]},"headers":[],"git":{},"filePathRelative":"README.md"}');export{r as comp,c as data}; +import{_ as e,c as t,o as a}from"./app-Qcj6bGr7.js";const o={};function s(m,i){return a(),t("div")}const c=e(o,[["render",s]]),l=JSON.parse('{"path":"/","title":"主页","lang":"zh-CN","frontmatter":{"home":true,"title":"主页","actions":[{"text":"开始配置","link":"/get-started.html","type":"primary"},{"text":"Lua 文档","link":"/lua.html","type":"secondary"}],"features":[{"title":"安全用户系统","details":"用户系统是直接绑定在内核下的,通过 SHA-256 密码哈希算法对用户密码进行加密存储,确保用户密码的安全性。"},{"title":"Lua 脚本支持","details":"CMLeonOS支持 Lua 脚本,用户可以通过 Lua 脚本实现自定义功能。"},{"title":"网络","details":"CMLeonOS支持 TCP/IP 协议栈,用户可以通过网络连接到其他设备。"},{"title":"FTP 服务器","details":"CMLeonOS支持 FTP 服务器,用户可以通过 FTP 协议上传下载文件。"},{"title":"内置编辑器","details":"CMLeonOS支持内置编辑器,用户可以直接在CMLeonOS中编辑文件。"},{"title":"硬盘存储","details":"CMLeonOS支持硬盘存储,用户可以将文件持久存储在硬盘中。"}]},"headers":[],"git":{"updatedTime":1770190333000,"contributors":[{"name":"Leonmmcoset","username":"Leonmmcoset","email":"testmod@qq.com","commits":1,"url":"https://github.com/Leonmmcoset"}],"changelog":[{"hash":"33510365f48beba3a56b2dc6afd4c54b1fbdab60","time":1770190333000,"email":"testmod@qq.com","author":"Leonmmcoset","message":"docs&Lua input()"}]},"filePathRelative":"README.md"}');export{c as comp,l as data}; diff --git a/docs/cmleonos/docs/.vuepress/dist/assets/lua.html-CwfoAtde.js b/docs/cmleonos/docs/.vuepress/dist/assets/lua.html-BpPm4nZm.js similarity index 88% rename from docs/cmleonos/docs/.vuepress/dist/assets/lua.html-CwfoAtde.js rename to docs/cmleonos/docs/.vuepress/dist/assets/lua.html-BpPm4nZm.js index b060f50..0eb5bac 100644 --- a/docs/cmleonos/docs/.vuepress/dist/assets/lua.html-CwfoAtde.js +++ b/docs/cmleonos/docs/.vuepress/dist/assets/lua.html-BpPm4nZm.js @@ -1,4 +1,4 @@ -import{_ as s,c as a,a as e,o as t}from"./app-DPqZ-Olm.js";const p={};function l(i,n){return t(),a("div",null,[...n[0]||(n[0]=[e(`

CMLeonOS Lua API 文档

本文档记录了 CMLeonOS 中 Lua 支持的所有函数和库。

基础库 (base)

assert(v [, message])

如果 v 为 false 或 nil,则抛出错误。可选参数 message 为错误信息。

assert(true, "This should be true")
+import{_ as s,c as a,a as e,o as t}from"./app-Qcj6bGr7.js";const p={};function l(i,n){return t(),a("div",null,[...n[0]||(n[0]=[e(`

CMLeonOS Lua API 文档

本文档记录了 CMLeonOS 中 Lua 支持的所有函数和库。

基础库 (base)

assert(v [, message])

如果 v 为 false 或 nil,则抛出错误。可选参数 message 为错误信息。

assert(true, "This should be true")
 assert(false, "This is false")
 

collectgarbage([opt])

垃圾回收控制。支持以下选项:

  • "collect" - 执行垃圾回收
  • "count" - 返回当前内存使用量(千字节)
  • "step" - 执行一步垃圾回收
  • "isrunning" - 返回垃圾回收器是否在运行
collectgarbage("collect")
 collectgarbage("count")
@@ -159,7 +159,14 @@ import{_ as s,c as a,a as e,o as t}from"./app-DPqZ-Olm.js";const p={};function l
 print(encoded)
 

os.base64decrypt(input)

将 Base64 字符串解码。

local decoded = os.base64decrypt("SGVsbG8gV29ybGxcmVvcmxvYg==")
 print(decoded)
-

输入输出库 (io)

io.close(file)

关闭文件。

local file = io.open("test.txt", "w")
+

os.timerstart()

启动计时器,记录当前时间。

os.timerstart()
+

os.timerstop()

停止计时器并返回从 timerstart 到 timerstop 之间的时间(秒)。

os.timerstart()
+for i = 1, 1000000 do
+    local x = i * 2
+end
+local elapsed = os.timerstop()
+print("Elapsed time:", elapsed, "seconds")
+

注意

  • 如果在未调用 timerstart 的情况下调用 timerstop,将返回 nil
  • 每次调用 timerstop 后,计时器会被重置
  • 返回的时间单位为秒(浮点数)

输入输出库 (io)

io.close(file)

关闭文件。

local file = io.open("test.txt", "w")
 file:write("Hello")
 io.close(file)
 

io.flush()

刷新所有打开文件的输出缓冲区。

io.flush()
@@ -235,7 +242,22 @@ import{_ as s,c as a,a as e,o as t}from"./app-DPqZ-Olm.js";const p={};function l
 print(encoded)
 

enc.base64decode(input)

将 Base64 字符串解码。

local decoded = enc.base64decode("SGVsbG8gV29ybGxcmVvcmxvYg==")
 print(decoded)
-

包库 (package)

package.loaded

已加载的包表。

print(package.loaded)
+

JSON 库

json.encode(table)

将 Lua 表编码为 JSON 字符串。

local data = {name = "John", age = 30}
+local jsonStr = json.encode(data)
+print(jsonStr)
+

json.decode(string)

将 JSON 字符串解码为 Lua 表。

local jsonStr = '{"name": "John", "age": 30}'
+local data = json.decode(jsonStr)
+print(data.name)
+print(data.age)
+

json.null()

返回 null 值。

local nullValue = json.null()
+print(nullValue)
+

json.parse(string)

解析 JSON 字符串(同 decode)。

local jsonStr = '{"name": "John", "age": 30}'
+local data = json.parse(jsonStr)
+print(data.name)
+

json.stringify(table)

将 Lua 表转换为 JSON 字符串(同 encode)。

local data = {name = "John", age = 30}
+local jsonStr = json.stringify(data)
+print(jsonStr)
+

包库 (package)

package.loaded

已加载的包表。

print(package.loaded)
 

package.loaders

包加载器表。

print(package.loaders)
 

package.loadlib(libname [, initfunc])

加载 C 库。

package.loadlib("mylib")
 

package.path

包搜索路径。

print(package.path)
@@ -272,4 +294,4 @@ import{_ as s,c as a,a as e,o as t}from"./app-DPqZ-Olm.js";const p={};function l
 print("Hash:", hash)
 print("Encoded:", encoded)
 print("Decoded:", decoded)
-

注意事项

  1. 交互模式:使用 lua --shell 进入交互式 Lua Shell
  2. 错误处理:所有 Lua 执行错误都会被捕获并显示
  3. 系统函数os 库包含 CMLeonOS 特定的系统函数
  4. 加密支持:支持 SHA256 和 Base64 编码/解码
  5. 标准 Lua:完全兼容 Lua 5.1 标准

版本信息

  • Lua 版本:5.2
  • CMLeonOS 版本:最新
`,461)])])}const o=s(p,[["render",l]]),u=JSON.parse('{"path":"/lua.html","title":"CMLeonOS Lua API 文档","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"基础库 (base)","slug":"基础库-base","link":"#基础库-base","children":[{"level":3,"title":"assert(v [, message])","slug":"assert-v-message","link":"#assert-v-message","children":[]},{"level":3,"title":"collectgarbage([opt])","slug":"collectgarbage-opt","link":"#collectgarbage-opt","children":[]},{"level":3,"title":"dofile([filename])","slug":"dofile-filename","link":"#dofile-filename","children":[]},{"level":3,"title":"input([prompt])","slug":"input-prompt","link":"#input-prompt","children":[]},{"level":3,"title":"error(message [, level])","slug":"error-message-level","link":"#error-message-level","children":[]},{"level":3,"title":"ipairs(t)","slug":"ipairs-t","link":"#ipairs-t","children":[]},{"level":3,"title":"loadfile([filename])","slug":"loadfile-filename","link":"#loadfile-filename","children":[]},{"level":3,"title":"load(string [, chunkname])","slug":"load-string-chunkname","link":"#load-string-chunkname","children":[]},{"level":3,"title":"loadstring(string [, chunkname])","slug":"loadstring-string-chunkname","link":"#loadstring-string-chunkname","children":[]},{"level":3,"title":"next(table [, index])","slug":"next-table-index","link":"#next-table-index","children":[]},{"level":3,"title":"pairs(t)","slug":"pairs-t","link":"#pairs-t","children":[]},{"level":3,"title":"pcall(f [, arg1, ...])","slug":"pcall-f-arg1","link":"#pcall-f-arg1","children":[]},{"level":3,"title":"print(...)","slug":"print","link":"#print","children":[]},{"level":3,"title":"rawequal(v1, v2)","slug":"rawequal-v1-v2","link":"#rawequal-v1-v2","children":[]},{"level":3,"title":"rawlen(v)","slug":"rawlen-v","link":"#rawlen-v","children":[]},{"level":3,"title":"rawget(table, index)","slug":"rawget-table-index","link":"#rawget-table-index","children":[]},{"level":3,"title":"rawset(table, index, value)","slug":"rawset-table-index-value","link":"#rawset-table-index-value","children":[]},{"level":3,"title":"select(index, ...)","slug":"select-index","link":"#select-index","children":[]},{"level":3,"title":"getmetatable(object)","slug":"getmetatable-object","link":"#getmetatable-object","children":[]},{"level":3,"title":"setmetatable(table, metatable)","slug":"setmetatable-table-metatable","link":"#setmetatable-table-metatable","children":[]},{"level":3,"title":"tonumber(e [, base])","slug":"tonumber-e-base","link":"#tonumber-e-base","children":[]},{"level":3,"title":"tostring(v)","slug":"tostring-v","link":"#tostring-v","children":[]},{"level":3,"title":"type(v)","slug":"type-v","link":"#type-v","children":[]},{"level":3,"title":"xpcall(f [, arg1, ...])","slug":"xpcall-f-arg1","link":"#xpcall-f-arg1","children":[]}]},{"level":2,"title":"数学库 (math)","slug":"数学库-math","link":"#数学库-math","children":[{"level":3,"title":"math.abs(x)","slug":"math-abs-x","link":"#math-abs-x","children":[]},{"level":3,"title":"math.acos(x)","slug":"math-acos-x","link":"#math-acos-x","children":[]},{"level":3,"title":"math.asin(x)","slug":"math-asin-x","link":"#math-asin-x","children":[]},{"level":3,"title":"math.atan2(y, x)","slug":"math-atan2-y-x","link":"#math-atan2-y-x","children":[]},{"level":3,"title":"math.atan(x)","slug":"math-atan-x","link":"#math-atan-x","children":[]},{"level":3,"title":"math.ceil(x)","slug":"math-ceil-x","link":"#math-ceil-x","children":[]},{"level":3,"title":"math.cosh(x)","slug":"math-cosh-x","link":"#math-cosh-x","children":[]},{"level":3,"title":"math.cos(x)","slug":"math-cos-x","link":"#math-cos-x","children":[]},{"level":3,"title":"math.deg(x)","slug":"math-deg-x","link":"#math-deg-x","children":[]},{"level":3,"title":"math.exp(x)","slug":"math-exp-x","link":"#math-exp-x","children":[]},{"level":3,"title":"math.floor(x)","slug":"math-floor-x","link":"#math-floor-x","children":[]},{"level":3,"title":"math.fmod(x, y)","slug":"math-fmod-x-y","link":"#math-fmod-x-y","children":[]},{"level":3,"title":"math.frexp(x)","slug":"math-frexp-x","link":"#math-frexp-x","children":[]},{"level":3,"title":"math.ldexp(m, e)","slug":"math-ldexp-m-e","link":"#math-ldexp-m-e","children":[]},{"level":3,"title":"math.log10(x)","slug":"math-log10-x","link":"#math-log10-x","children":[]},{"level":3,"title":"math.log(x [, base])","slug":"math-log-x-base","link":"#math-log-x-base","children":[]},{"level":3,"title":"math.max(x1, ...)","slug":"math-max-x1","link":"#math-max-x1","children":[]},{"level":3,"title":"math.min(x1, ...)","slug":"math-min-x1","link":"#math-min-x1","children":[]},{"level":3,"title":"math.modf(x)","slug":"math-modf-x","link":"#math-modf-x","children":[]},{"level":3,"title":"math.pow(x, y)","slug":"math-pow-x-y","link":"#math-pow-x-y","children":[]},{"level":3,"title":"math.rad(x)","slug":"math-rad-x","link":"#math-rad-x","children":[]},{"level":3,"title":"math.random([m [, n]])","slug":"math-random-m-n","link":"#math-random-m-n","children":[]},{"level":3,"title":"math.randomseed(x)","slug":"math-randomseed-x","link":"#math-randomseed-x","children":[]},{"level":3,"title":"math.sinh(x)","slug":"math-sinh-x","link":"#math-sinh-x","children":[]},{"level":3,"title":"math.sin(x)","slug":"math-sin-x","link":"#math-sin-x","children":[]},{"level":3,"title":"math.sqrt(x)","slug":"math-sqrt-x","link":"#math-sqrt-x","children":[]},{"level":3,"title":"math.tanh(x)","slug":"math-tanh-x","link":"#math-tanh-x","children":[]},{"level":3,"title":"math.tan(x)","slug":"math-tan-x","link":"#math-tan-x","children":[]},{"level":3,"title":"math.pi","slug":"math-pi","link":"#math-pi","children":[]},{"level":3,"title":"math.huge","slug":"math-huge","link":"#math-huge","children":[]}]},{"level":2,"title":"字符串库 (string)","slug":"字符串库-string","link":"#字符串库-string","children":[{"level":3,"title":"string.byte(s [, i [, j]])","slug":"string-byte-s-i-j","link":"#string-byte-s-i-j","children":[]},{"level":3,"title":"string.char(...)","slug":"string-char","link":"#string-char","children":[]},{"level":3,"title":"string.dump(function)","slug":"string-dump-function","link":"#string-dump-function","children":[]},{"level":3,"title":"string.find(s, pattern [, init [, plain]])","slug":"string-find-s-pattern-init-plain","link":"#string-find-s-pattern-init-plain","children":[]},{"level":3,"title":"string.format(formatstring, ...)","slug":"string-format-formatstring","link":"#string-format-formatstring","children":[]},{"level":3,"title":"string.gmatch(s, pattern)","slug":"string-gmatch-s-pattern","link":"#string-gmatch-s-pattern","children":[]},{"level":3,"title":"string.gsub(s, pattern, repl [, n])","slug":"string-gsub-s-pattern-repl-n","link":"#string-gsub-s-pattern-repl-n","children":[]},{"level":3,"title":"string.len(s)","slug":"string-len-s","link":"#string-len-s","children":[]},{"level":3,"title":"string.lower(s)","slug":"string-lower-s","link":"#string-lower-s","children":[]},{"level":3,"title":"string.match(s, pattern [, init])","slug":"string-match-s-pattern-init","link":"#string-match-s-pattern-init","children":[]},{"level":3,"title":"string.rep(s, n)","slug":"string-rep-s-n","link":"#string-rep-s-n","children":[]},{"level":3,"title":"string.reverse(s)","slug":"string-reverse-s","link":"#string-reverse-s","children":[]},{"level":3,"title":"string.sub(s, i [, j])","slug":"string-sub-s-i-j","link":"#string-sub-s-i-j","children":[]},{"level":3,"title":"string.upper(s)","slug":"string-upper-s","link":"#string-upper-s","children":[]}]},{"level":2,"title":"操作系统库 (os)","slug":"操作系统库-os","link":"#操作系统库-os","children":[{"level":3,"title":"os.clock()","slug":"os-clock","link":"#os-clock","children":[]},{"level":3,"title":"os.gethostname()","slug":"os-gethostname","link":"#os-gethostname","children":[]},{"level":3,"title":"os.getenv(varname)","slug":"os-getenv-varname","link":"#os-getenv-varname","children":[]},{"level":3,"title":"os.setenv(varname, value)","slug":"os-setenv-varname-value","link":"#os-setenv-varname-value","children":[]},{"level":3,"title":"os.delenv(varname)","slug":"os-delenv-varname","link":"#os-delenv-varname","children":[]},{"level":3,"title":"os.addenv(varname, value)","slug":"os-addenv-varname-value","link":"#os-addenv-varname-value","children":[]},{"level":3,"title":"os.execute(command)","slug":"os-execute-command","link":"#os-execute-command","children":[]},{"level":3,"title":"os.executefile(path)","slug":"os-executefile-path","link":"#os-executefile-path","children":[]},{"level":3,"title":"os.reboot()","slug":"os-reboot","link":"#os-reboot","children":[]},{"level":3,"title":"os.shutdown()","slug":"os-shutdown","link":"#os-shutdown","children":[]},{"level":3,"title":"os.sleep(seconds)","slug":"os-sleep-seconds","link":"#os-sleep-seconds","children":[]},{"level":3,"title":"os.beep()","slug":"os-beep","link":"#os-beep","children":[]},{"level":3,"title":"os.clear()","slug":"os-clear","link":"#os-clear","children":[]},{"level":3,"title":"os.getusername()","slug":"os-getusername","link":"#os-getusername","children":[]},{"level":3,"title":"os.isadmin()","slug":"os-isadmin","link":"#os-isadmin","children":[]},{"level":3,"title":"os.sha256(input)","slug":"os-sha256-input","link":"#os-sha256-input","children":[]},{"level":3,"title":"os.base64encrypt(input)","slug":"os-base64encrypt-input","link":"#os-base64encrypt-input","children":[]},{"level":3,"title":"os.base64decrypt(input)","slug":"os-base64decrypt-input","link":"#os-base64decrypt-input","children":[]}]},{"level":2,"title":"输入输出库 (io)","slug":"输入输出库-io","link":"#输入输出库-io","children":[{"level":3,"title":"io.close(file)","slug":"io-close-file","link":"#io-close-file","children":[]},{"level":3,"title":"io.flush()","slug":"io-flush","link":"#io-flush","children":[]},{"level":3,"title":"io.input([file])","slug":"io-input-file","link":"#io-input-file","children":[]},{"level":3,"title":"io.lines([filename])","slug":"io-lines-filename","link":"#io-lines-filename","children":[]},{"level":3,"title":"io.open(filename [, mode])","slug":"io-open-filename-mode","link":"#io-open-filename-mode","children":[]},{"level":3,"title":"io.output([file])","slug":"io-output-file","link":"#io-output-file","children":[]},{"level":3,"title":"io.popen(prog [, mode])","slug":"io-popen-prog-mode","link":"#io-popen-prog-mode","children":[]},{"level":3,"title":"io.read(...)","slug":"io-read","link":"#io-read","children":[]},{"level":3,"title":"io.tmpfile()","slug":"io-tmpfile","link":"#io-tmpfile","children":[]},{"level":3,"title":"io.type(file)","slug":"io-type-file","link":"#io-type-file","children":[]},{"level":3,"title":"io.write(...)","slug":"io-write","link":"#io-write","children":[]}]},{"level":2,"title":"协程库 (coroutine)","slug":"协程库-coroutine","link":"#协程库-coroutine","children":[{"level":3,"title":"coroutine.create(f)","slug":"coroutine-create-f","link":"#coroutine-create-f","children":[]},{"level":3,"title":"coroutine.resume(co [, val1, ...])","slug":"coroutine-resume-co-val1","link":"#coroutine-resume-co-val1","children":[]},{"level":3,"title":"coroutine.running()","slug":"coroutine-running","link":"#coroutine-running","children":[]},{"level":3,"title":"coroutine.status(co)","slug":"coroutine-status-co","link":"#coroutine-status-co","children":[]},{"level":3,"title":"coroutine.wrap(f)","slug":"coroutine-wrap-f","link":"#coroutine-wrap-f","children":[]},{"level":3,"title":"coroutine.yield(...)","slug":"coroutine-yield","link":"#coroutine-yield","children":[]}]},{"level":2,"title":"表库 (table)","slug":"表库-table","link":"#表库-table","children":[{"level":3,"title":"table.concat(list [, sep [, i [, j]])","slug":"table-concat-list-sep-i-j","link":"#table-concat-list-sep-i-j","children":[]},{"level":3,"title":"table.insert(list, [pos,] value)","slug":"table-insert-list-pos-value","link":"#table-insert-list-pos-value","children":[]},{"level":3,"title":"table.maxn(t)","slug":"table-maxn-t","link":"#table-maxn-t","children":[]},{"level":3,"title":"table.remove(list [, pos])","slug":"table-remove-list-pos","link":"#table-remove-list-pos","children":[]},{"level":3,"title":"table.sort(list [, comp])","slug":"table-sort-list-comp","link":"#table-sort-list-comp","children":[]}]},{"level":2,"title":"调试库 (debug)","slug":"调试库-debug","link":"#调试库-debug","children":[{"level":3,"title":"debug.debug()","slug":"debug-debug","link":"#debug-debug","children":[]},{"level":3,"title":"debug.getfenv(object)","slug":"debug-getfenv-object","link":"#debug-getfenv-object","children":[]},{"level":3,"title":"debug.gethook()","slug":"debug-gethook","link":"#debug-gethook","children":[]},{"level":3,"title":"debug.getinfo([thread [, f [, what]])","slug":"debug-getinfo-thread-f-what","link":"#debug-getinfo-thread-f-what","children":[]},{"level":3,"title":"debug.getlocal([thread [, f [, loc]])","slug":"debug-getlocal-thread-f-loc","link":"#debug-getlocal-thread-f-loc","children":[]},{"level":3,"title":"debug.getmetatable(object)","slug":"debug-getmetatable-object","link":"#debug-getmetatable-object","children":[]},{"level":3,"title":"debug.getregistry()","slug":"debug-getregistry","link":"#debug-getregistry","children":[]},{"level":3,"title":"debug.getupvalue(f [, i])","slug":"debug-getupvalue-f-i","link":"#debug-getupvalue-f-i","children":[]},{"level":3,"title":"debug.setfenv(object, table)","slug":"debug-setfenv-object-table","link":"#debug-setfenv-object-table","children":[]},{"level":3,"title":"debug.sethook(hook, mask [, count])","slug":"debug-sethook-hook-mask-count","link":"#debug-sethook-hook-mask-count","children":[]},{"level":3,"title":"debug.setlocal([thread [, f,] level, value)","slug":"debug-setlocal-thread-f-level-value","link":"#debug-setlocal-thread-f-level-value","children":[]},{"level":3,"title":"debug.setmetatable(object, table)","slug":"debug-setmetatable-object-table","link":"#debug-setmetatable-object-table","children":[]},{"level":3,"title":"debug.setupvalue(f [, i,] value)","slug":"debug-setupvalue-f-i-value","link":"#debug-setupvalue-f-i-value","children":[]},{"level":3,"title":"debug.traceback([thread [, message [, level]])","slug":"debug-traceback-thread-message-level","link":"#debug-traceback-thread-message-level","children":[]}]},{"level":2,"title":"位运算库 (bit)","slug":"位运算库-bit","link":"#位运算库-bit","children":[{"level":3,"title":"bit.band(x1, x2 [, ...])","slug":"bit-band-x1-x2","link":"#bit-band-x1-x2","children":[]},{"level":3,"title":"bit.bnot(x)","slug":"bit-bnot-x","link":"#bit-bnot-x","children":[]},{"level":3,"title":"bit.bor(x1, x2 [, ...])","slug":"bit-bor-x1-x2","link":"#bit-bor-x1-x2","children":[]},{"level":3,"title":"bit.bxor(x1, x2 [, ...])","slug":"bit-bxor-x1-x2","link":"#bit-bxor-x1-x2","children":[]},{"level":3,"title":"bit.lshift(x, disp)","slug":"bit-lshift-x-disp","link":"#bit-lshift-x-disp","children":[]},{"level":3,"title":"bit.rshift(x, disp)","slug":"bit-rshift-x-disp","link":"#bit-rshift-x-disp","children":[]},{"level":3,"title":"bit.arshift(x, disp)","slug":"bit-arshift-x-disp","link":"#bit-arshift-x-disp","children":[]},{"level":3,"title":"bit.rol(x, disp)","slug":"bit-rol-x-disp","link":"#bit-rol-x-disp","children":[]},{"level":3,"title":"bit.ror(x, disp)","slug":"bit-ror-x-disp","link":"#bit-ror-x-disp","children":[]},{"level":3,"title":"bit.tobit(x)","slug":"bit-tobit-x","link":"#bit-tobit-x","children":[]}]},{"level":2,"title":"编码库 (enc)","slug":"编码库-enc","link":"#编码库-enc","children":[{"level":3,"title":"enc.base64encode(input)","slug":"enc-base64encode-input","link":"#enc-base64encode-input","children":[]},{"level":3,"title":"enc.base64decode(input)","slug":"enc-base64decode-input","link":"#enc-base64decode-input","children":[]}]},{"level":2,"title":"包库 (package)","slug":"包库-package","link":"#包库-package","children":[{"level":3,"title":"package.loaded","slug":"package-loaded","link":"#package-loaded","children":[]},{"level":3,"title":"package.loaders","slug":"package-loaders","link":"#package-loaders","children":[]},{"level":3,"title":"package.loadlib(libname [, initfunc])","slug":"package-loadlib-libname-initfunc","link":"#package-loadlib-libname-initfunc","children":[]},{"level":3,"title":"package.path","slug":"package-path","link":"#package-path","children":[]},{"level":3,"title":"package.searchpath(name [, path [, sep [, rep]])","slug":"package-searchpath-name-path-sep-rep","link":"#package-searchpath-name-path-sep-rep","children":[]},{"level":3,"title":"package.seeall([name])","slug":"package-seeall-name","link":"#package-seeall-name","children":[]}]},{"level":2,"title":"使用示例","slug":"使用示例","link":"#使用示例","children":[{"level":3,"title":"交互式 Lua Shell","slug":"交互式-lua-shell","link":"#交互式-lua-shell","children":[]},{"level":3,"title":"执行 Lua 脚本文件","slug":"执行-lua-脚本文件","link":"#执行-lua-脚本文件","children":[]},{"level":3,"title":"系统信息查询","slug":"系统信息查询","link":"#系统信息查询","children":[]},{"level":3,"title":"环境变量操作","slug":"环境变量操作","link":"#环境变量操作","children":[]},{"level":3,"title":"加密和编码","slug":"加密和编码","link":"#加密和编码","children":[]}]},{"level":2,"title":"注意事项","slug":"注意事项","link":"#注意事项","children":[]},{"level":2,"title":"版本信息","slug":"版本信息","link":"#版本信息","children":[]}],"git":{},"filePathRelative":"lua.md"}');export{o as comp,u as data}; +

注意事项

  1. 交互模式:使用 lua --shell 进入交互式 Lua Shell
  2. 错误处理:所有 Lua 执行错误都会被捕获并显示
  3. 系统函数os 库包含 CMLeonOS 特定的系统函数
  4. 加密支持:支持 SHA256 和 Base64 编码/解码
  5. 标准 Lua:完全兼容 Lua 5.1 标准

版本信息

  • Lua 版本:5.2
  • CMLeonOS 版本:最新
`,486)])])}const o=s(p,[["render",l]]),u=JSON.parse('{"path":"/lua.html","title":"CMLeonOS Lua API 文档","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"基础库 (base)","slug":"基础库-base","link":"#基础库-base","children":[{"level":3,"title":"assert(v [, message])","slug":"assert-v-message","link":"#assert-v-message","children":[]},{"level":3,"title":"collectgarbage([opt])","slug":"collectgarbage-opt","link":"#collectgarbage-opt","children":[]},{"level":3,"title":"dofile([filename])","slug":"dofile-filename","link":"#dofile-filename","children":[]},{"level":3,"title":"input([prompt])","slug":"input-prompt","link":"#input-prompt","children":[]},{"level":3,"title":"error(message [, level])","slug":"error-message-level","link":"#error-message-level","children":[]},{"level":3,"title":"ipairs(t)","slug":"ipairs-t","link":"#ipairs-t","children":[]},{"level":3,"title":"loadfile([filename])","slug":"loadfile-filename","link":"#loadfile-filename","children":[]},{"level":3,"title":"load(string [, chunkname])","slug":"load-string-chunkname","link":"#load-string-chunkname","children":[]},{"level":3,"title":"loadstring(string [, chunkname])","slug":"loadstring-string-chunkname","link":"#loadstring-string-chunkname","children":[]},{"level":3,"title":"next(table [, index])","slug":"next-table-index","link":"#next-table-index","children":[]},{"level":3,"title":"pairs(t)","slug":"pairs-t","link":"#pairs-t","children":[]},{"level":3,"title":"pcall(f [, arg1, ...])","slug":"pcall-f-arg1","link":"#pcall-f-arg1","children":[]},{"level":3,"title":"print(...)","slug":"print","link":"#print","children":[]},{"level":3,"title":"rawequal(v1, v2)","slug":"rawequal-v1-v2","link":"#rawequal-v1-v2","children":[]},{"level":3,"title":"rawlen(v)","slug":"rawlen-v","link":"#rawlen-v","children":[]},{"level":3,"title":"rawget(table, index)","slug":"rawget-table-index","link":"#rawget-table-index","children":[]},{"level":3,"title":"rawset(table, index, value)","slug":"rawset-table-index-value","link":"#rawset-table-index-value","children":[]},{"level":3,"title":"select(index, ...)","slug":"select-index","link":"#select-index","children":[]},{"level":3,"title":"getmetatable(object)","slug":"getmetatable-object","link":"#getmetatable-object","children":[]},{"level":3,"title":"setmetatable(table, metatable)","slug":"setmetatable-table-metatable","link":"#setmetatable-table-metatable","children":[]},{"level":3,"title":"tonumber(e [, base])","slug":"tonumber-e-base","link":"#tonumber-e-base","children":[]},{"level":3,"title":"tostring(v)","slug":"tostring-v","link":"#tostring-v","children":[]},{"level":3,"title":"type(v)","slug":"type-v","link":"#type-v","children":[]},{"level":3,"title":"xpcall(f [, arg1, ...])","slug":"xpcall-f-arg1","link":"#xpcall-f-arg1","children":[]}]},{"level":2,"title":"数学库 (math)","slug":"数学库-math","link":"#数学库-math","children":[{"level":3,"title":"math.abs(x)","slug":"math-abs-x","link":"#math-abs-x","children":[]},{"level":3,"title":"math.acos(x)","slug":"math-acos-x","link":"#math-acos-x","children":[]},{"level":3,"title":"math.asin(x)","slug":"math-asin-x","link":"#math-asin-x","children":[]},{"level":3,"title":"math.atan2(y, x)","slug":"math-atan2-y-x","link":"#math-atan2-y-x","children":[]},{"level":3,"title":"math.atan(x)","slug":"math-atan-x","link":"#math-atan-x","children":[]},{"level":3,"title":"math.ceil(x)","slug":"math-ceil-x","link":"#math-ceil-x","children":[]},{"level":3,"title":"math.cosh(x)","slug":"math-cosh-x","link":"#math-cosh-x","children":[]},{"level":3,"title":"math.cos(x)","slug":"math-cos-x","link":"#math-cos-x","children":[]},{"level":3,"title":"math.deg(x)","slug":"math-deg-x","link":"#math-deg-x","children":[]},{"level":3,"title":"math.exp(x)","slug":"math-exp-x","link":"#math-exp-x","children":[]},{"level":3,"title":"math.floor(x)","slug":"math-floor-x","link":"#math-floor-x","children":[]},{"level":3,"title":"math.fmod(x, y)","slug":"math-fmod-x-y","link":"#math-fmod-x-y","children":[]},{"level":3,"title":"math.frexp(x)","slug":"math-frexp-x","link":"#math-frexp-x","children":[]},{"level":3,"title":"math.ldexp(m, e)","slug":"math-ldexp-m-e","link":"#math-ldexp-m-e","children":[]},{"level":3,"title":"math.log10(x)","slug":"math-log10-x","link":"#math-log10-x","children":[]},{"level":3,"title":"math.log(x [, base])","slug":"math-log-x-base","link":"#math-log-x-base","children":[]},{"level":3,"title":"math.max(x1, ...)","slug":"math-max-x1","link":"#math-max-x1","children":[]},{"level":3,"title":"math.min(x1, ...)","slug":"math-min-x1","link":"#math-min-x1","children":[]},{"level":3,"title":"math.modf(x)","slug":"math-modf-x","link":"#math-modf-x","children":[]},{"level":3,"title":"math.pow(x, y)","slug":"math-pow-x-y","link":"#math-pow-x-y","children":[]},{"level":3,"title":"math.rad(x)","slug":"math-rad-x","link":"#math-rad-x","children":[]},{"level":3,"title":"math.random([m [, n]])","slug":"math-random-m-n","link":"#math-random-m-n","children":[]},{"level":3,"title":"math.randomseed(x)","slug":"math-randomseed-x","link":"#math-randomseed-x","children":[]},{"level":3,"title":"math.sinh(x)","slug":"math-sinh-x","link":"#math-sinh-x","children":[]},{"level":3,"title":"math.sin(x)","slug":"math-sin-x","link":"#math-sin-x","children":[]},{"level":3,"title":"math.sqrt(x)","slug":"math-sqrt-x","link":"#math-sqrt-x","children":[]},{"level":3,"title":"math.tanh(x)","slug":"math-tanh-x","link":"#math-tanh-x","children":[]},{"level":3,"title":"math.tan(x)","slug":"math-tan-x","link":"#math-tan-x","children":[]},{"level":3,"title":"math.pi","slug":"math-pi","link":"#math-pi","children":[]},{"level":3,"title":"math.huge","slug":"math-huge","link":"#math-huge","children":[]}]},{"level":2,"title":"字符串库 (string)","slug":"字符串库-string","link":"#字符串库-string","children":[{"level":3,"title":"string.byte(s [, i [, j]])","slug":"string-byte-s-i-j","link":"#string-byte-s-i-j","children":[]},{"level":3,"title":"string.char(...)","slug":"string-char","link":"#string-char","children":[]},{"level":3,"title":"string.dump(function)","slug":"string-dump-function","link":"#string-dump-function","children":[]},{"level":3,"title":"string.find(s, pattern [, init [, plain]])","slug":"string-find-s-pattern-init-plain","link":"#string-find-s-pattern-init-plain","children":[]},{"level":3,"title":"string.format(formatstring, ...)","slug":"string-format-formatstring","link":"#string-format-formatstring","children":[]},{"level":3,"title":"string.gmatch(s, pattern)","slug":"string-gmatch-s-pattern","link":"#string-gmatch-s-pattern","children":[]},{"level":3,"title":"string.gsub(s, pattern, repl [, n])","slug":"string-gsub-s-pattern-repl-n","link":"#string-gsub-s-pattern-repl-n","children":[]},{"level":3,"title":"string.len(s)","slug":"string-len-s","link":"#string-len-s","children":[]},{"level":3,"title":"string.lower(s)","slug":"string-lower-s","link":"#string-lower-s","children":[]},{"level":3,"title":"string.match(s, pattern [, init])","slug":"string-match-s-pattern-init","link":"#string-match-s-pattern-init","children":[]},{"level":3,"title":"string.rep(s, n)","slug":"string-rep-s-n","link":"#string-rep-s-n","children":[]},{"level":3,"title":"string.reverse(s)","slug":"string-reverse-s","link":"#string-reverse-s","children":[]},{"level":3,"title":"string.sub(s, i [, j])","slug":"string-sub-s-i-j","link":"#string-sub-s-i-j","children":[]},{"level":3,"title":"string.upper(s)","slug":"string-upper-s","link":"#string-upper-s","children":[]}]},{"level":2,"title":"操作系统库 (os)","slug":"操作系统库-os","link":"#操作系统库-os","children":[{"level":3,"title":"os.clock()","slug":"os-clock","link":"#os-clock","children":[]},{"level":3,"title":"os.gethostname()","slug":"os-gethostname","link":"#os-gethostname","children":[]},{"level":3,"title":"os.getenv(varname)","slug":"os-getenv-varname","link":"#os-getenv-varname","children":[]},{"level":3,"title":"os.setenv(varname, value)","slug":"os-setenv-varname-value","link":"#os-setenv-varname-value","children":[]},{"level":3,"title":"os.delenv(varname)","slug":"os-delenv-varname","link":"#os-delenv-varname","children":[]},{"level":3,"title":"os.addenv(varname, value)","slug":"os-addenv-varname-value","link":"#os-addenv-varname-value","children":[]},{"level":3,"title":"os.execute(command)","slug":"os-execute-command","link":"#os-execute-command","children":[]},{"level":3,"title":"os.executefile(path)","slug":"os-executefile-path","link":"#os-executefile-path","children":[]},{"level":3,"title":"os.reboot()","slug":"os-reboot","link":"#os-reboot","children":[]},{"level":3,"title":"os.shutdown()","slug":"os-shutdown","link":"#os-shutdown","children":[]},{"level":3,"title":"os.sleep(seconds)","slug":"os-sleep-seconds","link":"#os-sleep-seconds","children":[]},{"level":3,"title":"os.beep()","slug":"os-beep","link":"#os-beep","children":[]},{"level":3,"title":"os.clear()","slug":"os-clear","link":"#os-clear","children":[]},{"level":3,"title":"os.getusername()","slug":"os-getusername","link":"#os-getusername","children":[]},{"level":3,"title":"os.isadmin()","slug":"os-isadmin","link":"#os-isadmin","children":[]},{"level":3,"title":"os.sha256(input)","slug":"os-sha256-input","link":"#os-sha256-input","children":[]},{"level":3,"title":"os.base64encrypt(input)","slug":"os-base64encrypt-input","link":"#os-base64encrypt-input","children":[]},{"level":3,"title":"os.base64decrypt(input)","slug":"os-base64decrypt-input","link":"#os-base64decrypt-input","children":[]},{"level":3,"title":"os.timerstart()","slug":"os-timerstart","link":"#os-timerstart","children":[]},{"level":3,"title":"os.timerstop()","slug":"os-timerstop","link":"#os-timerstop","children":[]}]},{"level":2,"title":"输入输出库 (io)","slug":"输入输出库-io","link":"#输入输出库-io","children":[{"level":3,"title":"io.close(file)","slug":"io-close-file","link":"#io-close-file","children":[]},{"level":3,"title":"io.flush()","slug":"io-flush","link":"#io-flush","children":[]},{"level":3,"title":"io.input([file])","slug":"io-input-file","link":"#io-input-file","children":[]},{"level":3,"title":"io.lines([filename])","slug":"io-lines-filename","link":"#io-lines-filename","children":[]},{"level":3,"title":"io.open(filename [, mode])","slug":"io-open-filename-mode","link":"#io-open-filename-mode","children":[]},{"level":3,"title":"io.output([file])","slug":"io-output-file","link":"#io-output-file","children":[]},{"level":3,"title":"io.popen(prog [, mode])","slug":"io-popen-prog-mode","link":"#io-popen-prog-mode","children":[]},{"level":3,"title":"io.read(...)","slug":"io-read","link":"#io-read","children":[]},{"level":3,"title":"io.tmpfile()","slug":"io-tmpfile","link":"#io-tmpfile","children":[]},{"level":3,"title":"io.type(file)","slug":"io-type-file","link":"#io-type-file","children":[]},{"level":3,"title":"io.write(...)","slug":"io-write","link":"#io-write","children":[]}]},{"level":2,"title":"协程库 (coroutine)","slug":"协程库-coroutine","link":"#协程库-coroutine","children":[{"level":3,"title":"coroutine.create(f)","slug":"coroutine-create-f","link":"#coroutine-create-f","children":[]},{"level":3,"title":"coroutine.resume(co [, val1, ...])","slug":"coroutine-resume-co-val1","link":"#coroutine-resume-co-val1","children":[]},{"level":3,"title":"coroutine.running()","slug":"coroutine-running","link":"#coroutine-running","children":[]},{"level":3,"title":"coroutine.status(co)","slug":"coroutine-status-co","link":"#coroutine-status-co","children":[]},{"level":3,"title":"coroutine.wrap(f)","slug":"coroutine-wrap-f","link":"#coroutine-wrap-f","children":[]},{"level":3,"title":"coroutine.yield(...)","slug":"coroutine-yield","link":"#coroutine-yield","children":[]}]},{"level":2,"title":"表库 (table)","slug":"表库-table","link":"#表库-table","children":[{"level":3,"title":"table.concat(list [, sep [, i [, j]])","slug":"table-concat-list-sep-i-j","link":"#table-concat-list-sep-i-j","children":[]},{"level":3,"title":"table.insert(list, [pos,] value)","slug":"table-insert-list-pos-value","link":"#table-insert-list-pos-value","children":[]},{"level":3,"title":"table.maxn(t)","slug":"table-maxn-t","link":"#table-maxn-t","children":[]},{"level":3,"title":"table.remove(list [, pos])","slug":"table-remove-list-pos","link":"#table-remove-list-pos","children":[]},{"level":3,"title":"table.sort(list [, comp])","slug":"table-sort-list-comp","link":"#table-sort-list-comp","children":[]}]},{"level":2,"title":"调试库 (debug)","slug":"调试库-debug","link":"#调试库-debug","children":[{"level":3,"title":"debug.debug()","slug":"debug-debug","link":"#debug-debug","children":[]},{"level":3,"title":"debug.getfenv(object)","slug":"debug-getfenv-object","link":"#debug-getfenv-object","children":[]},{"level":3,"title":"debug.gethook()","slug":"debug-gethook","link":"#debug-gethook","children":[]},{"level":3,"title":"debug.getinfo([thread [, f [, what]])","slug":"debug-getinfo-thread-f-what","link":"#debug-getinfo-thread-f-what","children":[]},{"level":3,"title":"debug.getlocal([thread [, f [, loc]])","slug":"debug-getlocal-thread-f-loc","link":"#debug-getlocal-thread-f-loc","children":[]},{"level":3,"title":"debug.getmetatable(object)","slug":"debug-getmetatable-object","link":"#debug-getmetatable-object","children":[]},{"level":3,"title":"debug.getregistry()","slug":"debug-getregistry","link":"#debug-getregistry","children":[]},{"level":3,"title":"debug.getupvalue(f [, i])","slug":"debug-getupvalue-f-i","link":"#debug-getupvalue-f-i","children":[]},{"level":3,"title":"debug.setfenv(object, table)","slug":"debug-setfenv-object-table","link":"#debug-setfenv-object-table","children":[]},{"level":3,"title":"debug.sethook(hook, mask [, count])","slug":"debug-sethook-hook-mask-count","link":"#debug-sethook-hook-mask-count","children":[]},{"level":3,"title":"debug.setlocal([thread [, f,] level, value)","slug":"debug-setlocal-thread-f-level-value","link":"#debug-setlocal-thread-f-level-value","children":[]},{"level":3,"title":"debug.setmetatable(object, table)","slug":"debug-setmetatable-object-table","link":"#debug-setmetatable-object-table","children":[]},{"level":3,"title":"debug.setupvalue(f [, i,] value)","slug":"debug-setupvalue-f-i-value","link":"#debug-setupvalue-f-i-value","children":[]},{"level":3,"title":"debug.traceback([thread [, message [, level]])","slug":"debug-traceback-thread-message-level","link":"#debug-traceback-thread-message-level","children":[]}]},{"level":2,"title":"位运算库 (bit)","slug":"位运算库-bit","link":"#位运算库-bit","children":[{"level":3,"title":"bit.band(x1, x2 [, ...])","slug":"bit-band-x1-x2","link":"#bit-band-x1-x2","children":[]},{"level":3,"title":"bit.bnot(x)","slug":"bit-bnot-x","link":"#bit-bnot-x","children":[]},{"level":3,"title":"bit.bor(x1, x2 [, ...])","slug":"bit-bor-x1-x2","link":"#bit-bor-x1-x2","children":[]},{"level":3,"title":"bit.bxor(x1, x2 [, ...])","slug":"bit-bxor-x1-x2","link":"#bit-bxor-x1-x2","children":[]},{"level":3,"title":"bit.lshift(x, disp)","slug":"bit-lshift-x-disp","link":"#bit-lshift-x-disp","children":[]},{"level":3,"title":"bit.rshift(x, disp)","slug":"bit-rshift-x-disp","link":"#bit-rshift-x-disp","children":[]},{"level":3,"title":"bit.arshift(x, disp)","slug":"bit-arshift-x-disp","link":"#bit-arshift-x-disp","children":[]},{"level":3,"title":"bit.rol(x, disp)","slug":"bit-rol-x-disp","link":"#bit-rol-x-disp","children":[]},{"level":3,"title":"bit.ror(x, disp)","slug":"bit-ror-x-disp","link":"#bit-ror-x-disp","children":[]},{"level":3,"title":"bit.tobit(x)","slug":"bit-tobit-x","link":"#bit-tobit-x","children":[]}]},{"level":2,"title":"编码库 (enc)","slug":"编码库-enc","link":"#编码库-enc","children":[{"level":3,"title":"enc.base64encode(input)","slug":"enc-base64encode-input","link":"#enc-base64encode-input","children":[]},{"level":3,"title":"enc.base64decode(input)","slug":"enc-base64decode-input","link":"#enc-base64decode-input","children":[]}]},{"level":2,"title":"JSON 库","slug":"json-库","link":"#json-库","children":[{"level":3,"title":"json.encode(table)","slug":"json-encode-table","link":"#json-encode-table","children":[]},{"level":3,"title":"json.decode(string)","slug":"json-decode-string","link":"#json-decode-string","children":[]},{"level":3,"title":"json.null()","slug":"json-null","link":"#json-null","children":[]},{"level":3,"title":"json.parse(string)","slug":"json-parse-string","link":"#json-parse-string","children":[]},{"level":3,"title":"json.stringify(table)","slug":"json-stringify-table","link":"#json-stringify-table","children":[]}]},{"level":2,"title":"包库 (package)","slug":"包库-package","link":"#包库-package","children":[{"level":3,"title":"package.loaded","slug":"package-loaded","link":"#package-loaded","children":[]},{"level":3,"title":"package.loaders","slug":"package-loaders","link":"#package-loaders","children":[]},{"level":3,"title":"package.loadlib(libname [, initfunc])","slug":"package-loadlib-libname-initfunc","link":"#package-loadlib-libname-initfunc","children":[]},{"level":3,"title":"package.path","slug":"package-path","link":"#package-path","children":[]},{"level":3,"title":"package.searchpath(name [, path [, sep [, rep]])","slug":"package-searchpath-name-path-sep-rep","link":"#package-searchpath-name-path-sep-rep","children":[]},{"level":3,"title":"package.seeall([name])","slug":"package-seeall-name","link":"#package-seeall-name","children":[]}]},{"level":2,"title":"使用示例","slug":"使用示例","link":"#使用示例","children":[{"level":3,"title":"交互式 Lua Shell","slug":"交互式-lua-shell","link":"#交互式-lua-shell","children":[]},{"level":3,"title":"执行 Lua 脚本文件","slug":"执行-lua-脚本文件","link":"#执行-lua-脚本文件","children":[]},{"level":3,"title":"系统信息查询","slug":"系统信息查询","link":"#系统信息查询","children":[]},{"level":3,"title":"环境变量操作","slug":"环境变量操作","link":"#环境变量操作","children":[]},{"level":3,"title":"加密和编码","slug":"加密和编码","link":"#加密和编码","children":[]}]},{"level":2,"title":"注意事项","slug":"注意事项","link":"#注意事项","children":[]},{"level":2,"title":"版本信息","slug":"版本信息","link":"#版本信息","children":[]}],"git":{"updatedTime":1770196518000,"contributors":[{"name":"Leonmmcoset","username":"Leonmmcoset","email":"testmod@qq.com","commits":4,"url":"https://github.com/Leonmmcoset"}],"changelog":[{"hash":"d02fb85b1c8625458e60f9eea59c37544a521f88","time":1770196518000,"email":"testmod@qq.com","author":"Leonmmcoset","message":"json"},{"hash":"33510365f48beba3a56b2dc6afd4c54b1fbdab60","time":1770190333000,"email":"testmod@qq.com","author":"Leonmmcoset","message":"docs&Lua input()"},{"hash":"33afd6f2b50d2185e2c906d8abbc7ddd3f67947f","time":1770185997000,"email":"testmod@qq.com","author":"Leonmmcoset","message":"网络"},{"hash":"0020d125c77f60f3e62911609af9a418daf60bec","time":1770143767000,"email":"testmod@qq.com","author":"Leonmmcoset","message":"Lua更新"}]},"filePathRelative":"lua.md"}');export{o as comp,u as data}; diff --git a/docs/cmleonos/docs/.vuepress/dist/get-started.html b/docs/cmleonos/docs/.vuepress/dist/get-started.html index 2d55fb6..cda4817 100644 --- a/docs/cmleonos/docs/.vuepress/dist/get-started.html +++ b/docs/cmleonos/docs/.vuepress/dist/get-started.html @@ -33,11 +33,11 @@ 配置教程 | CMLeonOS官方文档站 - - + + -
- +
+ diff --git a/docs/cmleonos/docs/.vuepress/dist/index.html b/docs/cmleonos/docs/.vuepress/dist/index.html index 9bc6dca..0e3a577 100644 --- a/docs/cmleonos/docs/.vuepress/dist/index.html +++ b/docs/cmleonos/docs/.vuepress/dist/index.html @@ -33,11 +33,11 @@ 主页 | CMLeonOS官方文档站 - - + +
- + diff --git a/docs/cmleonos/docs/.vuepress/dist/lua.html b/docs/cmleonos/docs/.vuepress/dist/lua.html index 0ecc25d..95e4f05 100644 --- a/docs/cmleonos/docs/.vuepress/dist/lua.html +++ b/docs/cmleonos/docs/.vuepress/dist/lua.html @@ -33,8 +33,8 @@ CMLeonOS Lua API 文档 | CMLeonOS官方文档站 - - + +
- +

注意事项

  1. 交互模式:使用 lua --shell 进入交互式 Lua Shell
  2. 错误处理:所有 Lua 执行错误都会被捕获并显示
  3. 系统函数os 库包含 CMLeonOS 特定的系统函数
  4. 加密支持:支持 SHA256 和 Base64 编码/解码
  5. 标准 Lua:完全兼容 Lua 5.1 标准

版本信息

  • Lua 版本:5.2
  • CMLeonOS 版本:最新
最近更新::
Contributors: Leonmmcoset
+ diff --git a/docs/cmleonos/docs/lua.md b/docs/cmleonos/docs/lua.md index 47837ce..5465305 100644 --- a/docs/cmleonos/docs/lua.md +++ b/docs/cmleonos/docs/lua.md @@ -697,6 +697,30 @@ local decoded = os.base64decrypt("SGVsbG8gV29ybGxcmVvcmxvYg==") print(decoded) ``` +### os.timerstart() +启动计时器,记录当前时间。 + +```lua +os.timerstart() +``` + +### os.timerstop() +停止计时器并返回从 timerstart 到 timerstop 之间的时间(秒)。 + +```lua +os.timerstart() +for i = 1, 1000000 do + local x = i * 2 +end +local elapsed = os.timerstop() +print("Elapsed time:", elapsed, "seconds") +``` + +**注意**: +- 如果在未调用 `timerstart` 的情况下调用 `timerstop`,将返回 `nil` +- 每次调用 `timerstop` 后,计时器会被重置 +- 返回的时间单位为秒(浮点数) + --- ## 输入输出库 (io) diff --git a/interpreter/UniLua/LuaOsLib.cs b/interpreter/UniLua/LuaOsLib.cs index 1397280..dc2c3c5 100644 --- a/interpreter/UniLua/LuaOsLib.cs +++ b/interpreter/UniLua/LuaOsLib.cs @@ -11,12 +11,14 @@ namespace UniLua { public const string LIB_NAME = "os"; + private static DateTime? _timerStartTime; + public static int OpenLib( ILuaState lua ) { NameFuncPair[] define = new NameFuncPair[] { #if !UNITY_WEBPLAYER - new NameFuncPair("clock", OS_Clock), + new NameFuncPair("clock", OS_Clock), new NameFuncPair("gethostname", OS_Gethostname), new NameFuncPair("getenv", OS_Getenv), new NameFuncPair("setenv", OS_Setenv), @@ -34,6 +36,8 @@ namespace UniLua new NameFuncPair("sha256", OS_Sha256), new NameFuncPair("base64encrypt", OS_Base64Encrypt), new NameFuncPair("base64decrypt", OS_Base64Decrypt), + new NameFuncPair("timerstart", OS_TimerStart), + new NameFuncPair("timerstop", OS_TimerStop), #endif }; @@ -204,6 +208,29 @@ namespace UniLua lua.PushString(decoded); return 1; } + + private static int OS_TimerStart( ILuaState lua ) + { + _timerStartTime = DateTime.Now; + lua.PushBoolean(true); + return 1; + } + + private static int OS_TimerStop( ILuaState lua ) + { + if (!_timerStartTime.HasValue) + { + lua.PushNil(); + return 1; + } + + TimeSpan elapsed = DateTime.Now - _timerStartTime.Value; + double elapsedSeconds = elapsed.TotalSeconds; + + lua.PushNumber(elapsedSeconds); + _timerStartTime = null; + return 1; + } #endif } } diff --git a/shell/CommandList.cs b/shell/CommandList.cs index d9d50b9..0d6dea6 100644 --- a/shell/CommandList.cs +++ b/shell/CommandList.cs @@ -184,6 +184,9 @@ namespace CMLeonOS.shell case "lua": shell.ExecuteLuaScript(args); break; + case "testgui": + shell.ProcessTestGui(); + break; default: shell.ShowError($"Unknown command: {command}"); break; diff --git a/shell/Commands/TestGuiCommand.cs b/shell/Commands/TestGuiCommand.cs new file mode 100644 index 0000000..65f2be9 --- /dev/null +++ b/shell/Commands/TestGuiCommand.cs @@ -0,0 +1,44 @@ +using System; +using Sys = Cosmos.System; +using Cosmos.System.Graphics; + +namespace CMLeonOS.Commands +{ + public static class TestGuiCommand + { + public static void RunTestGui() + { + Canvas canvas; + + Console.WriteLine("Cosmos booted successfully. Let's go in Graphical Mode"); + + canvas = FullScreenCanvas.GetFullScreenCanvas(new Mode(640, 480, ColorDepth.ColorDepth32)); + + canvas.Clear(global::System.Drawing.Color.FromArgb(0, 0, 255)); + + try + { + canvas.DrawPoint(global::System.Drawing.Color.FromArgb(255, 0, 0), 69, 69); + + canvas.DrawLine(global::System.Drawing.Color.FromArgb(173, 255, 47), 250, 100, 400, 100); + + canvas.DrawLine(global::System.Drawing.Color.FromArgb(205, 92, 92), 350, 150, 350, 250); + + canvas.DrawLine(global::System.Drawing.Color.FromArgb(245, 245, 220), 250, 150, 400, 250); + + canvas.DrawRectangle(global::System.Drawing.Color.FromArgb(219, 112, 147), 350, 350, 80, 60); + + canvas.DrawRectangle(global::System.Drawing.Color.FromArgb(50, 205, 50), 450, 450, 80, 60); + + canvas.Display(); + + Console.WriteLine("Press any key to return to shell..."); + Console.ReadKey(true); + } + catch (Exception e) + { + Console.WriteLine("Exception occurred: " + e.Message); + } + } + } +} diff --git a/shell/Shell.cs b/shell/Shell.cs index 23caca5..5e3924a 100644 --- a/shell/Shell.cs +++ b/shell/Shell.cs @@ -1216,6 +1216,11 @@ namespace CMLeonOS Commands.Script.LuaCommand.ExecuteLuaScript(args, fileSystem, this, ShowError, ShowWarning); } + public void ProcessTestGui() + { + Commands.TestGuiCommand.RunTestGui(); + } + public void SetDnsServer(string args) { if (string.IsNullOrWhiteSpace(args))