Skip to content

Commit

Permalink
Merge pull request #78 from Apllify/main
Browse files Browse the repository at this point in the history
Added option to use OpenGL when launching game
  • Loading branch information
maddie480 authored Feb 14, 2024
2 parents 2ae0112 + 91ce7cc commit 84566bd
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ function config.load()
default(data, "loennInstalledVersion", "")

default(data, "updateModsOnStartup", "none")
default(data, "useOpenGL", "disabled")

default(data, "extradata", {})
end
Expand Down
19 changes: 19 additions & 0 deletions src/scenes/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ local updateModsOnStartupOptions = {
{ text = "Disabled (Default)", data = "none" }
}

local useOpenGLOptions = {
{ text = "Enabled", data = "enabled" },
{ text = "Disabled (Default)", data = "disabled" }
}

local extradatas = {
{ text = "Noto Sans CJK (~50 MB)", info = "Chinese, Japanese, Korean font files.", path = "olympus-extra-cjk.zip", url = "https://0x0a.de/olympus-extra/olympus-extra-cjk.zip" }
}
Expand Down Expand Up @@ -297,6 +302,8 @@ local root = uie.column({
}):with(uiu.fillWidth)
}):with(uiu.fillWidth(8 + 1 / optioncount)):with(uiu.at(4 / optioncount, 0)),



}):with(uiu.fillWidth),

uie.group({}),
Expand Down Expand Up @@ -350,6 +357,18 @@ local root = uie.column({
}):with(uiu.fillWidth)
}):with(uiu.fillWidth(8 + 1 / optioncount)):with(uiu.at(3 / optioncount, 0)),

uie.column({
uie.label("Use OpenGL"),
uie.dropdown(useOpenGLOptions, function(self, value)
config.useOpenGL = value
config.save()
end):with({
placeholder = "???",
selectedData = config.useOpenGL
}):with(uiu.fillWidth)
}):with(uiu.fillWidth(8 + 1 / optioncount)):with(uiu.at(4 / optioncount, 0)),


}):with(uiu.fillWidth),

uie.group({}),
Expand Down
13 changes: 11 additions & 2 deletions src/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ end

local launching = {}


function utils.launch(path, vanilla, notify, force)
local key = string.format("%s | %s", path, vanilla and "vanilla" or "everest")
if launching[key] then
Expand All @@ -333,8 +334,10 @@ function utils.launch(path, vanilla, notify, force)
end

launching[key] = threader.routine(function()

local config = require("config")

if not path then
local config = require("config")
if config then
path = config.installs[config.install].path
end
Expand All @@ -348,7 +351,13 @@ function utils.launch(path, vanilla, notify, force)
local alert = require("alert")
notify = notify and require("notify") or alert

local launch = sharp.launch(path, vanilla and "--vanilla" or "", (force or not notify) and true or false)
local opengl = false
if config then
opengl = config.useOpenGL == "enabled"
end

local flags = (vanilla and "--vanilla " or "") .. (opengl and "--graphics OpenGL " or "")
local launch = sharp.launch(path, flags, (force or not notify) and true or false)
local container

if vanilla then
Expand Down

0 comments on commit 84566bd

Please sign in to comment.