mirror of
https://github.com/dscalzi/HeliosLauncher.git
synced 2024-12-21 19:22:13 -08:00
Merge a314e51b1f
into 6aaeeff9a4
This commit is contained in:
commit
3346712a9a
@ -416,7 +416,7 @@ class ProcessBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//args.push('-Dlog4j.configurationFile=D:\\WesterosCraft\\game\\common\\assets\\log_configs\\client-1.12.xml')
|
//args.push('-Dlog4j.configurationFile=D:\\WesterosCraft\\game\\common\\assets\\log_configs\\client-1.12.xml')
|
||||||
|
|
||||||
// Java Arguments
|
// Java Arguments
|
||||||
if(process.platform === 'darwin'){
|
if(process.platform === 'darwin'){
|
||||||
args.push('-Xdock:name=HeliosLauncher')
|
args.push('-Xdock:name=HeliosLauncher')
|
||||||
@ -432,6 +432,26 @@ class ProcessBuilder {
|
|||||||
// Vanilla Arguments
|
// Vanilla Arguments
|
||||||
args = args.concat(this.vanillaManifest.arguments.game)
|
args = args.concat(this.vanillaManifest.arguments.game)
|
||||||
|
|
||||||
|
async function WriteFullscreenToOptions(filePath, lineToReplace, newLine) {
|
||||||
|
try {
|
||||||
|
const exists = await fs.pathExists(filePath);
|
||||||
|
|
||||||
|
if (exists) {
|
||||||
|
let fileContent = await fs.readFile(filePath, 'utf8');
|
||||||
|
if (fileContent.includes(lineToReplace)) {
|
||||||
|
fileContent = fileContent.replace(lineToReplace, newLine);
|
||||||
|
await fs.outputFile(filePath, fileContent);
|
||||||
|
} else {
|
||||||
|
await fs.outputFile(filePath, newLine);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
await fs.outputFile(filePath, newLine);
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
logger.info('Error while writing fullscreen to options.txt:', err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for(let i=0; i<args.length; i++){
|
for(let i=0; i<args.length; i++){
|
||||||
if(typeof args[i] === 'object' && args[i].rules != null){
|
if(typeof args[i] === 'object' && args[i].rules != null){
|
||||||
|
|
||||||
@ -453,11 +473,16 @@ class ProcessBuilder {
|
|||||||
// This should be fine for a while.
|
// This should be fine for a while.
|
||||||
if(rule.features.has_custom_resolution != null && rule.features.has_custom_resolution === true){
|
if(rule.features.has_custom_resolution != null && rule.features.has_custom_resolution === true){
|
||||||
if(ConfigManager.getFullscreen()){
|
if(ConfigManager.getFullscreen()){
|
||||||
|
logger.info("gamedir: ", this.gameDir)
|
||||||
|
WriteFullscreenToOptions(path.join(this.gameDir, "options.txt"), 'fullscreen:false', 'fullscreen:true')
|
||||||
args[i].value = [
|
args[i].value = [
|
||||||
'--fullscreen',
|
'--fullscreen',
|
||||||
'true'
|
'true'
|
||||||
]
|
]
|
||||||
|
} else {
|
||||||
|
WriteFullscreenToOptions(path.join(this.gameDir, "options.txt"), 'fullscreen:true', 'fullscreen:false');
|
||||||
}
|
}
|
||||||
|
|
||||||
checksum++
|
checksum++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -885,4 +910,4 @@ class ProcessBuilder {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = ProcessBuilder
|
module.exports = ProcessBuilder
|
||||||
|
Loading…
Reference in New Issue
Block a user