This commit is contained in:
github-actions[bot] committed 2022-04-19 14:38:55 +00:00
1 parent 50101ab4a9
commit 881f5f5abe
89 files changed
+426 -363

No files matched your search

+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[3515],{3905:function(e,t,n){n.d(t,{Zo:function(){return s},kt:function(){return d}});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var p=a.createContext({}),u=function(e){var t=a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},s=function(e){var t=u(e.components);return a.createElement(p.Provider,{value:t},e.children)},m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},c=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,p=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),c=u(n),d=r,g=c["".concat(p,".").concat(d)]||c[d]||m[d]||i;return n?a.createElement(g,o(o({ref:t},s),{},{components:n})):a.createElement(g,o({ref:t},s))}));function d(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,o=new Array(i);o[0]=c;var l={};for(var p in t)hasOwnProperty.call(t,p)&&(l[p]=t[p]);l.originalType=e,l.mdxType="string"==typeof e?e:r,o[1]=l;for(var u=2;u<i;u++)o[u]=n[u];return a.createElement.apply(null,o)}return a.createElement.apply(null,n)}c.displayName="MDXCreateElement"},899:function(e,t,n){n.r(t),n.d(t,{frontMatter:function(){return l},contentTitle:function(){return p},metadata:function(){return u},assets:function(){return s},toc:function(){return m},default:function(){return d}});var a=n(7462),r=n(3366),i=(n(7294),n(3905)),o=["components"],l={title:"Context Menu"},p=void 0,u={unversionedId:"ox_lib/Client/Interface/context",id:"ox_lib/Client/Interface/context",title:"Context Menu",description:"lib.registerContext",source:"@site/docs/ox_lib/Client/Interface/context.md",sourceDirName:"ox_lib/Client/Interface",slug:"/ox_lib/Client/Interface/context",permalink:"/docs/ox_lib/Client/Interface/context",editUrl:"https://github.com/overextended/overextended.github.io/tree/main/docs/ox_lib/Client/Interface/context.md",tags:[],version:"current",frontMatter:{title:"Context Menu"},sidebar:"docs",previous:{title:"Update",permalink:"/docs/oxmysql/Usage/update"},next:{title:"Input Dialog",permalink:"/docs/ox_lib/Client/Interface/input"}},s={},m=[{value:"lib.registerContext",id:"libregistercontext",level:3},{value:"lib.showContext",id:"libshowcontext",level:3},{value:"Usage Example",id:"usage-example",level:3}],c={toc:m};function d(e){var t=e.components,n=(0,r.Z)(e,o);return(0,i.kt)("wrapper",(0,a.Z)({},c,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h3",{id:"libregistercontext"},"lib.registerContext"),(0,i.kt)("p",null,"Used for registering a context menu."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-lua"},"-- id: string\n-- title: string\n-- menu: string (optional)\n-- options: table\n -- item: key as string\n -- menu: string (optional)\n -- arrow: boolean (optional)\n -- description: string (optional)\n -- metadata: string table or key, value table (optional)\n -- event: string (optional)\n -- serverEvent: string (optional)\n -- args: any (optional)\nlib.registerContext(context)\n")),(0,i.kt)("p",null,"You can register as many context menus in one ",(0,i.kt)("inlineCode",{parentName:"p"},"lib.registerContext")," function\nas you'd like."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"id")," - Unique menu identifier, will be used to open the menu.",(0,i.kt)("br",{parentName:"p"}),"\n",(0,i.kt)("inlineCode",{parentName:"p"},"title")," - Every menu must have a title.",(0,i.kt)("br",{parentName:"p"}),"\n",(0,i.kt)("inlineCode",{parentName:"p"},"menu")," - Menu identifier - if defined there will be a back arrow next to the menu title\nthat will take you to the menu you defined.",(0,i.kt)("br",{parentName:"p"}),"\n",(0,i.kt)("inlineCode",{parentName:"p"},"options")," - Contains all the clickable menu items.",(0,i.kt)("br",{parentName:"p"}),"\n",(0,i.kt)("inlineCode",{parentName:"p"},"item")," - Defined as a Line truncated