improved linux support
This commit is contained in:
1 parent
934b2108cd
commit
0188586fcd
2 files changed
+33
-25
No files matched your search
@@ -0,0 +1 @@
|
|||||||
|
EID.IsLinux = false
|
||||||
@@ -4,11 +4,6 @@ EID.GameVersion = "ab+"
|
|||||||
EID.Languages = {"en_us", "en_us_detailed", "fr", "pt", "ru", "spa", "bul", "pl", "turkish"}
|
EID.Languages = {"en_us", "en_us_detailed", "fr", "pt", "ru", "spa", "bul", "pl", "turkish"}
|
||||||
EID.descriptions = {} -- Table that holds all translation strings
|
EID.descriptions = {} -- Table that holds all translation strings
|
||||||
|
|
||||||
---------LINUX USERS ONLY--------
|
|
||||||
local linuxUsername= "%YourUsernameHere%"
|
|
||||||
local linuxPath = "/home/"..linuxUsername.."/.steam/steam/steamapps/workshop/content/250900/836319872/"
|
|
||||||
---------------------------------
|
|
||||||
|
|
||||||
require("eid_config")
|
require("eid_config")
|
||||||
EID.Config = EID.DefaultConfig
|
EID.Config = EID.DefaultConfig
|
||||||
EID.Config.Version = "3.0"
|
EID.Config.Version = "3.0"
|
||||||
@@ -55,20 +50,20 @@ end
|
|||||||
require("eid_data")
|
require("eid_data")
|
||||||
require("eid_api")
|
require("eid_api")
|
||||||
|
|
||||||
-------------- Load Font -------------
|
|
||||||
EID.LastRenderCallColor = EID:getTextColor()
|
EID.LastRenderCallColor = EID:getTextColor()
|
||||||
local nullVector = Vector(0,0)
|
local nullVector = Vector(0,0)
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
------------------------------- Load Font ---------------------------------
|
||||||
|
local isWindows, _ = pcall(require,"LinuxDetectionFile")
|
||||||
local isluadebug, os = pcall(require,"os")
|
local isluadebug, os = pcall(require,"os")
|
||||||
if isluadebug then
|
local modfolder ='external item descriptions_836319872' --release mod folder name
|
||||||
local modfolder ='external item descriptions_836319872' --release mod folder name
|
if isWindows then
|
||||||
local userPath = os.tmpname()
|
-- WINDOWS
|
||||||
userPath = string.gsub(userPath, "\\", "/")
|
if isluadebug then
|
||||||
local newPath = ""
|
local userPath = os.tmpname()
|
||||||
if not string.find(userPath, "AppData") then
|
userPath = string.gsub(userPath, "\\", "/")
|
||||||
EID.modPath = linuxPath
|
local newPath = ""
|
||||||
else
|
|
||||||
for str in string.gmatch(userPath, "([^/]+)") do
|
for str in string.gmatch(userPath, "([^/]+)") do
|
||||||
if str ~="AppData" then
|
if str ~="AppData" then
|
||||||
newPath = newPath..str.."/"
|
newPath = newPath..str.."/"
|
||||||
@@ -77,21 +72,33 @@ if isluadebug then
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
EID.modPath = newPath.."Documents/My Games/Binding of Isaac Afterbirth+ Mods/"..modfolder.."/"
|
EID.modPath = newPath.."Documents/My Games/Binding of Isaac Afterbirth+ Mods/"..modfolder.."/"
|
||||||
|
else
|
||||||
|
--use some very hacky trickery to get the path to this mod
|
||||||
|
local _, err = pcall(require, "")
|
||||||
|
local _, basePathStart = string.find(err, "no file '", 1)
|
||||||
|
local _, modPathStart = string.find(err, "no file '", basePathStart)
|
||||||
|
local modPathEnd, _ = string.find(err, ".lua'", modPathStart)
|
||||||
|
EID.modPath = string.sub(err, modPathStart + 1, modPathEnd - 1)
|
||||||
|
end
|
||||||
|
EID.modPath = string.gsub(EID.modPath, "\\", "/")
|
||||||
|
EID.modPath = string.gsub(EID.modPath, ":/", ":\\")
|
||||||
|
else
|
||||||
|
-- LINUX - Special thanks to jerb for providing these!
|
||||||
|
if isluadebug then
|
||||||
|
EID.modPath = os.getenv("HOME") .. "/.local/share/binding of isaac afterbirth+ mods/"..modfolder.."/"
|
||||||
|
else
|
||||||
|
-- only work if installed in the default location
|
||||||
|
EID.modPath = "../../../../../.local/share/binding of isaac afterbirth+ mods/"..modfolder.."/"
|
||||||
end
|
end
|
||||||
else --your code here
|
|
||||||
--use some very hacky trickery to get the path to this mod
|
|
||||||
local _, err = pcall(require, "")
|
|
||||||
local _, basePathStart = string.find(err, "no file '", 1)
|
|
||||||
local _, modPathStart = string.find(err, "no file '", basePathStart)
|
|
||||||
local modPathEnd, _ = string.find(err, ".lua'", modPathStart)
|
|
||||||
EID.modPath = string.sub(err, modPathStart + 1, modPathEnd - 1)
|
|
||||||
end
|
end
|
||||||
EID.modPath = string.gsub(EID.modPath, "\\", "/")
|
|
||||||
EID.modPath = string.gsub(EID.modPath, ":/", ":\\")
|
|
||||||
|
|
||||||
EID.font = Font() -- init font object
|
EID.font = Font() -- init font object
|
||||||
local fontFile = EID.Config["FontType"] or "default"
|
local fontFile = EID.Config["FontType"] or "default"
|
||||||
EID:loadFont(EID.modPath .. "resources/font/eid_"..fontFile..".fnt")
|
local success = EID:loadFont(EID.modPath .. "resources/font/eid_"..fontFile..".fnt")
|
||||||
|
if not success then
|
||||||
|
Isaac.ConsoleOutput("EID WAS NOT ABLE TO LOAD THE FONT!!!!!!!! Please contact the mod creator!")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
-------------------------Handle Sacrifice Room-----------------------------
|
-------------------------Handle Sacrifice Room-----------------------------
|
||||||
|
|||||||
Reference in new issue
Block a user