mirror of
https://github.com/NovaGM/ModuleBuilder.git
synced 2024-08-15 00:23:33 +00:00
Compare commits
2 commits
79db05e7dc
...
925b41459b
Author | SHA1 | Date | |
---|---|---|---|
925b41459b | |||
7762d0bd07 |
2 changed files with 17 additions and 3 deletions
|
@ -1,7 +1,9 @@
|
|||
const { copy } = goosemod.webpackModules.findByProps('SUPPORTS_COPY', 'copy'); // Use Webpack module for Web support (instead of DiscordNative)
|
||||
|
||||
export const writeText = (text) => { // Write text to clipboard
|
||||
return DiscordNative.clipboard.copy(text);
|
||||
return copy(text);
|
||||
};
|
||||
|
||||
export const readText = () => { // Read text from clipboard
|
||||
return DiscordNative.clipboard.read();
|
||||
return DiscordNative.clipboard.read(); // Web doesn't support clipboard reading (no Webpack for it like copy) - use DiscordNative
|
||||
};
|
|
@ -115,8 +115,20 @@ export default async (manifest, _content, repo) => {
|
|||
break;
|
||||
}
|
||||
|
||||
let abortNoVal = false;
|
||||
|
||||
while (v[1].startsWith('var(')) {
|
||||
v[1] = variables.find((y) => y[0] === v[1].slice(4, -1))[1];
|
||||
v[1] = variables.find((y) => y[0] === v[1].slice(4, -1))?.[1];
|
||||
|
||||
if (!v[1]) {
|
||||
abortNoVal = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (abortNoVal) {
|
||||
console.log('aborting color palette image, could not find var substitute', wanted);
|
||||
break;
|
||||
}
|
||||
|
||||
imagePalette.push([v[0], v[1]]);
|
||||
|
|
Loading…
Reference in a new issue