From 934b2108cd9013be6b2999370b6ddcf233f09400 Mon Sep 17 00:00:00 2001 From: Wofsauge Date: Sat, 28 Nov 2020 21:46:35 +0100 Subject: [PATCH] Fixed font loading issue when in LuaDebug mode --- eid_api.lua | 1 - main.lua | 38 ++++++++++++++++++++++++++++++++------ 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/eid_api.lua b/eid_api.lua index fc368e1a..30f10fa3 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -263,7 +263,6 @@ function EID:getLegacyModDescription(Type, Variant, SubType) elseif tableName == "cards" and __eidCardDescriptions[SubType] then return {"","",__eidCardDescriptions[SubType]} elseif tableName == "pills" and __eidPillDescriptions[SubType-1] then - print(SubType) return {"","",__eidPillDescriptions[SubType-1]} elseif customDesc~=nil then return {"", customDesc[1], customDesc[2]} diff --git a/main.lua b/main.lua index f27cac8e..9863ef7f 100644 --- a/main.lua +++ b/main.lua @@ -4,6 +4,11 @@ EID.GameVersion = "ab+" EID.Languages = {"en_us", "en_us_detailed", "fr", "pt", "ru", "spa", "bul", "pl", "turkish"} 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") EID.Config = EID.DefaultConfig EID.Config.Version = "3.0" @@ -54,12 +59,33 @@ require("eid_api") EID.LastRenderCallColor = EID:getTextColor() local nullVector = Vector(0,0) ---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) + +local isluadebug, os = pcall(require,"os") +if isluadebug then + local modfolder ='external item descriptions_836319872' --release mod folder name + local userPath = os.tmpname() + userPath = string.gsub(userPath, "\\", "/") + local newPath = "" + if not string.find(userPath, "AppData") then + EID.modPath = linuxPath + else + for str in string.gmatch(userPath, "([^/]+)") do + if str ~="AppData" then + newPath = newPath..str.."/" + else + break + end + end + EID.modPath = newPath.."Documents/My Games/Binding of Isaac Afterbirth+ Mods/"..modfolder.."/" + 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 EID.modPath = string.gsub(EID.modPath, "\\", "/") EID.modPath = string.gsub(EID.modPath, ":/", ":\\")