Fixed bad encoding of plugin scripts causing accented characters to display incorrectly, plugins are listed in the console when loaded, fixed error when resizing an animation will delete the frame you're currently on, fixed changes to animations persisting despite not saving them in the Animation Editor

This commit is contained in:
Maruno17
2021-05-07 20:01:49 +01:00
parent 23996a4781
commit 5618607afa
3 changed files with 10 additions and 4 deletions

View File

@@ -644,7 +644,6 @@ module PluginManager
# Check if plugins need compiling
#-----------------------------------------------------------------------------
def self.compilePlugins(order, plugins)
echoln ""
echo 'Compiling plugin scripts...'
scripts = []
# go through the entire order one by one
@@ -680,6 +679,7 @@ module PluginManager
self.compilePlugins(order, plugins) if self.needCompiling?(order, plugins)
# load plugins
scripts = load_data("Data/PluginScripts.rxdata")
echoed_plugins = []
for plugin in scripts
# get the required data
name, meta, script = plugin
@@ -688,7 +688,7 @@ module PluginManager
# go through each script and interpret
for scr in script
# turn code into plaintext
code = Zlib::Inflate.inflate(scr[1])
code = Zlib::Inflate.inflate(scr[1]).force_encoding(Encoding::UTF_8)
# get rid of tabs
code.gsub!("\t", " ")
# construct filename
@@ -697,12 +697,15 @@ module PluginManager
# try to run the code
begin
eval(code, TOPLEVEL_BINDING, fname)
echoln "Loaded plugin: #{name}" if !echoed_plugins.include?(name)
echoed_plugins.push(name)
rescue Exception # format error message to display
self.pluginErrorMsg(name, sname)
Kernel.exit! true
end
end
end
echoln "" if !echoed_plugins.empty?
end
#-----------------------------------------------------------------------------
end