vd-plugins/RichPresence/index.js

2 lines
7.4 KiB
JavaScript
Raw Normal View History

(function(c,s,d,n,b,i,C,p,h,S){"use strict";function w(t,l){if(!(t instanceof l))throw new TypeError("Cannot call a class as a function")}function y(t,l){for(var e=0;e<l.length;e++){var a=l[e];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function L(t,l,e){return l&&y(t.prototype,l),e&&y(t,e),t}function P(t,l,e){return l in t?Object.defineProperty(t,l,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[l]=e,t}const{FormSection:o,FormInput:r,FormRow:g,FormSwitch:A,FormText:E}=i.Forms,N=d.findByStoreName("UserStore"),x=d.findByProps("showUserProfile"),R=n.stylesheet.createThemedStyleSheet({subText:{fontSize:14,marginLeft:16,marginRight:16,color:p.semanticColors.TEXT_MUTED},textLink:{color:p.semanticColors.TEXT_LINK}});function k(t){let{selection:l}=t;const e=C.useProxy(b.storage.selections[l]);return n.React.createElement(h.ScrollView,{style:{flex:1},contentContainerStyle:{paddingBottom:38}},n.React.createElement(i.Button,{style:{margin:16},color:"brand",size:i.Button.Sizes.MEDIUM,look:i.Button.Looks.FILLED,onPress:async function(){x.showUserProfile({userId:N.getCurrentUser().id})},text:"Preview your profile"}),n.React.createElement(o,{title:"Basic",titleStyleType:"no_border"},n.React.createElement(r,{required:!0,autoFocus:!0,title:"Application Name",value:e.name,placeholder:"Discord",onChange:function(a){return e.name=a}}),n.React.createElement(r,{required:!0,title:"Application ID",value:e.application_id,placeholder:"1054951789318909972",onChange:function(a){return e.application_id=a},keyboardType:"numeric"}),n.React.createElement(r,{title:"Type",value:e.type,placeholder:"0",onChange:function(a){return e.type=a},keyboardType:"numeric"}),n.React.createElement(r,{title:"Details",value:e.details,placeholder:"Competitive",onChange:function(a){return e.details=a}}),n.React.createElement(r,{title:"State",value:e.state,placeholder:"Playing Solo",onChange:function(a){return e.state=a}})),n.React.createElement(o,{title:"Images"},n.React.createElement(r,{title:"Large Image Asset Key or URL",value:e.assets.large_image,placeholder:"large_image_here",onChange:function(a){return e.assets.large_image=a}}),n.React.createElement(r,{title:"Large Image Text",value:e.assets.large_text,placeholder:"Playing on Joe's lobby",disabled:!e.assets.large_image,onChange:function(a){return e.assets.large_text=a}}),n.React.createElement(r,{title:"Small Image Asset Key or URL",value:e.assets.small_image,placeholder:"small_image_here",onChange:function(a){return e.assets.small_image=a}}),n.React.createElement(r,{title:"Small Image Text",value:e.assets.small_text,placeholder:"Solo",disabled:!e.assets.small_image,onChange:function(a){return e.assets.small_text=a}})),n.React.createElement(E,{style:R.subText},"Image assets key can be either a Discord app asset's name or a URL to an image."),n.React.createElement(o,{title:"Timestamps"},n.React.createElement(g,{label:"Enable timestamps",subLabel:"Set whether to show timestamps or not",trailing:n.React.createElement(A,{value:e.timestamps._enabled,onValueChange:function(a){return e.timestamps._enabled=a}})}),n.React.createElement(r,{title:"Start Timestamp (milliseconds)",value:e.timestamps.start,placeholder:"1234567890",disabled:!e.timestamps._enabled,onChange:function(a){return e.timestamps.start=a},keyboardType:"numeric"}),n.React.createElement(r,{title:"End Timestamp (milliseconds)",value:e.timestamps.end,placeholder:"1234567890",disabled:!e.timestamps._enabled,onChange:function(a){return e.timestamps.end=a},keyboardType:"numeric"}),n.React.createElement(g,{label:"Use current time as start timestamp",subLabel:"This will override the start timestamp you set above",disabled:!e.timestamps._enabled,onPress:function(){return e.timestamps.start=String(Date.now())},trailing:g.Arrow})),n.React.createElement(E,{style:R.subText},"Leaving start timestamp blank will use the time the Discord started."),n.React.createElement(o,{title:"Buttons"},n.React.createElement(r,{title:"First Button Text",value:e.buttons[0].label,placeholder:"random link #1",onChange