mirror of
https://git.sanhost.net/sanasol/hytale-f2p
synced 2026-02-26 06:51:47 -03:00
v2.4.1: Replace raw wrapper script editor with structured config UI
Replace the raw textarea script editor with a structured form for Java wrapper configuration. Users now manage two lists (JVM flags to strip, args to inject with server/always condition) instead of editing bash/batch scripts directly. Scripts are generated at launch time from the structured config. Includes collapsible script preview for power users.
This commit is contained in:
42
main.js
42
main.js
@@ -1539,3 +1539,45 @@ ipcMain.handle('profile-update', async (event, id, updates) => {
|
||||
}
|
||||
});
|
||||
|
||||
// Java Wrapper Config IPC
|
||||
ipcMain.handle('load-wrapper-config', () => {
|
||||
const { loadWrapperConfig } = require('./backend/launcher');
|
||||
return loadWrapperConfig();
|
||||
});
|
||||
|
||||
ipcMain.handle('save-wrapper-config', (event, config) => {
|
||||
try {
|
||||
const { saveWrapperConfig } = require('./backend/launcher');
|
||||
saveWrapperConfig(config);
|
||||
return { success: true };
|
||||
} catch (error) {
|
||||
console.error('Error saving wrapper config:', error);
|
||||
return { success: false, error: error.message };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('reset-wrapper-config', () => {
|
||||
try {
|
||||
const { resetWrapperConfig } = require('./backend/launcher');
|
||||
const config = resetWrapperConfig();
|
||||
return { success: true, config };
|
||||
} catch (error) {
|
||||
console.error('Error resetting wrapper config:', error);
|
||||
return { success: false, error: error.message };
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('get-default-wrapper-config', () => {
|
||||
const { getDefaultWrapperConfig } = require('./backend/launcher');
|
||||
return getDefaultWrapperConfig();
|
||||
});
|
||||
|
||||
ipcMain.handle('preview-wrapper-script', (event, config, platform) => {
|
||||
const { generateWrapperScript } = require('./backend/launcher');
|
||||
return generateWrapperScript(config || require('./backend/launcher').loadWrapperConfig(), platform || process.platform, '/path/to/java');
|
||||
});
|
||||
|
||||
ipcMain.handle('get-current-platform', () => {
|
||||
return process.platform;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user