Skip to content

Commit

Permalink
A few more win32 compat fixes
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <[email protected]>
  • Loading branch information
falkTX committed Sep 25, 2023
1 parent eb25e56 commit efeb3b8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion html/js/modgui.js
Original file line number Diff line number Diff line change
Expand Up @@ -2660,7 +2660,7 @@ JqueryClass('customSelectPath', baseWidget, {
if (!self.data('enabled')) {
return self.customSelectPath('prevent', e)
}
var value = opt.attr('mod-parameter-value').replace('\\','\\\\')
var value = opt.attr('mod-parameter-value').replace(/\\/g,'\\\\')
self.customSelectPath('setValue', value, false)
})
})
Expand Down
15 changes: 12 additions & 3 deletions modtools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
from ctypes import *
from mod import get_unique_name
from sys import platform

# ------------------------------------------------------------------------------------------------------------
# Convert a ctypes c_char_p into a python string
Expand Down Expand Up @@ -144,13 +145,21 @@ def unionToDict(struct):

# ------------------------------------------------------------------------------------------------------------

tryPath1 = os.path.join(os.path.dirname(__file__), "libmod_utils.so")
tryPath2 = os.path.join(os.path.dirname(__file__), "..", "utils", "libmod_utils.so")
if platform == 'win32':
ext = "dll"
else:
ext = "so"

tryPath1 = os.path.join(os.path.dirname(__file__), "libmod_utils." + ext)
tryPath2 = os.path.join(os.path.dirname(__file__), "..", "lib", "libmod_utils." + ext)
tryPath3 = os.path.join(os.path.dirname(__file__), "..", "utils", "libmod_utils." + ext)

if os.path.exists(tryPath1):
utils = cdll.LoadLibrary(tryPath1)
else:
elif os.path.exists(tryPath2):
utils = cdll.LoadLibrary(tryPath2)
else:
utils = cdll.LoadLibrary(tryPath3)

# PluginLicenseType
kPluginLicenseNonCommercial = 0
Expand Down

0 comments on commit efeb3b8

Please sign in to comment.