-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f8042e2
Showing
8 changed files
with
199 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
call npm run dist-32bit | ||
pause | ||
Echo "Command Finished Successfully!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"name": "Sploder", | ||
"version": "1.0.0", | ||
"author": "Saptarshi", | ||
"description": "Sploder Launcher", | ||
"license": "MIT", | ||
"scripts": { | ||
"dev": "electron-webpack dev", | ||
"compile": "electron-webpack", | ||
"dist": "yarn compile && electron-builder", | ||
"dist-32bit": "yarn compile && electron-builder --ia32", | ||
"dist:dir": "yarn dist --dir -c.compression=store -c.mac.identity=null" | ||
}, | ||
"dependencies": { | ||
"source-map-support": "^0.5.16" | ||
}, | ||
"devDependencies": { | ||
"electron": "^8.2.0", | ||
"electron-builder": "^22.4.1", | ||
"electron-devtools-installer": "^3.2.0", | ||
"electron-webpack": "^2.8.2", | ||
"webpack": "~4.42.1" | ||
}, | ||
"build": { | ||
"appId": "com.sploder", | ||
"productName": "Sploder", | ||
"nsis": { | ||
"allowElevation": "true", | ||
"oneClick": "false", | ||
"perMachine": "true", | ||
"allowToChangeInstallationDirectory": "true", | ||
"deleteAppDataOnUninstall": "true", | ||
"runAfterFinish": "true" | ||
}, | ||
"extraResources": [ | ||
"./plugins/**" | ||
] | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
const { app, BrowserWindow } = require("electron"); | ||
const path = require("path"); | ||
const fs = require("fs"); | ||
const { Menu } = require('electron') | ||
const isMac = process.platform === 'darwin' | ||
const template = [ | ||
// { role: 'appMenu' } | ||
...(isMac ? [{ | ||
label: app.name, | ||
submenu: [ | ||
{ role: 'about' }, | ||
{ type: 'separator' }, | ||
{ role: 'services' }, | ||
{ type: 'separator' }, | ||
{ role: 'hide' }, | ||
{ role: 'hideOthers' }, | ||
{ role: 'unhide' }, | ||
{ type: 'separator' }, | ||
{ role: 'quit' } | ||
] | ||
}] : []), | ||
// { role: 'fileMenu' } | ||
{ | ||
label: 'File', | ||
submenu: [ | ||
isMac ? { role: 'close' } : { role: 'quit' } | ||
] | ||
}, | ||
// { role: 'editMenu' } | ||
{ | ||
label: 'Edit', | ||
submenu: [ | ||
{ role: 'undo' }, | ||
{ role: 'redo' }, | ||
{ type: 'separator' }, | ||
{ role: 'cut' }, | ||
{ role: 'copy' }, | ||
{ role: 'paste' }, | ||
...(isMac ? [ | ||
{ role: 'pasteAndMatchStyle' }, | ||
{ role: 'delete' }, | ||
{ role: 'selectAll' }, | ||
{ type: 'separator' }, | ||
{ | ||
label: 'Speech', | ||
submenu: [ | ||
{ role: 'startSpeaking' }, | ||
{ role: 'stopSpeaking' } | ||
] | ||
} | ||
] : [ | ||
{ role: 'delete' }, | ||
{ type: 'separator' }, | ||
{ role: 'selectAll' } | ||
]) | ||
] | ||
}, | ||
// { role: 'viewMenu' } | ||
{ | ||
label: 'View', | ||
submenu: [ | ||
{ role: 'reload' }, | ||
{ role: 'forceReload' }, | ||
{ role: 'toggleDevTools' }, | ||
{ type: 'separator' }, | ||
{ role: 'resetZoom' }, | ||
{ role: 'zoomIn' }, | ||
{ role: 'zoomOut' }, | ||
{ type: 'separator' }, | ||
{ role: 'togglefullscreen' } | ||
] | ||
}, | ||
] | ||
const menu = Menu.buildFromTemplate(template) | ||
|
||
let win; | ||
let pluginName; | ||
|
||
switch (process.platform) { | ||
case "win32": | ||
pluginName = process.arch == 'x64' ? 'x64/pepflashplayer.dll' : 'x32/pepflashplayer32.dll'; | ||
break; | ||
case 'linux': | ||
pluginName = 'libpepflashplayer.so' | ||
break; | ||
default: | ||
pluginName = 'x64/pepflashplayer.dll'; | ||
break; | ||
} | ||
|
||
app.commandLine.appendSwitch( | ||
"ppapi-flash-path", | ||
path.join(__dirname + pluginName) | ||
); | ||
app.commandLine.appendSwitch("ppapi-flash-version", "32.0.0.371"); | ||
|
||
|
||
function createWindow() { | ||
Menu.setApplicationMenu(menu) | ||
win = new BrowserWindow({ | ||
webPreferences: { | ||
nodeIntegration: false, | ||
contextIsolation: false, | ||
plugins: true, | ||
}, | ||
}); | ||
|
||
|
||
win.maximize(); | ||
win.loadURL("https://sploder.us.to/play.php");} | ||
|
||
app.whenReady().then(() => { | ||
createWindow(); | ||
|
||
app.on("activate", function () { | ||
if (BrowserWindow.getAllWindows().length === 0) createWindow(); | ||
}); | ||
}); | ||
|
||
app.on("window-all-closed", function () { | ||
if (process.platform !== "darwin") app.quit(); | ||
}); | ||
|
||
|
||
const clientId = '915116210570539058'; | ||
const rpc = new DiscordRPC.Client({ transport: 'ipc' }); | ||
const startTimestamp = new Date(); | ||
|
||
async function setActivity() { | ||
if (!rpc || !win) { | ||
return; | ||
} | ||
const boops = await win.webContents.executeJavaScript('window.boops'); | ||
|
||
// You'll need to have snek_large and snek_small assets uploaded to | ||
// https://discord.com/developers/applications/<application_id>/rich-presence/assets | ||
rpc.setActivity({ | ||
details: `${boops}`, | ||
startTimestamp, | ||
largeImageKey: 'icon', | ||
largeImageText: `${boops}` | ||
}); | ||
} | ||
|
||
rpc.on('ready', () => { | ||
setActivity(); | ||
|
||
// activity can only be set every 15 seconds | ||
setInterval(() => { | ||
setActivity(); | ||
}, 15e3); | ||
}); | ||
|
||
rpc.login({ clientId }).catch(console.error); | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.