Class: Yuki::ErrorWindow

Inherits:
Object show all
Defined in:
scripts/00100 Yuki__EXC.rb

Overview

Show an error window

Instance Method Summary collapse

Instance Method Details

#run(error_text, *data_to_add)

Open the error window and let the user aknowledge it

Parameters:

  • error_text (String)

    Text stored inside Error.log

  • data_to_add (Array<String>)

    data to add to the error log as pictures



143
144
145
146
147
148
149
150
151
# File 'scripts/00100 Yuki__EXC.rb', line 143

def run(error_text, *data_to_add)
  texts_to_show = cleanup_error_log(error_text)
  if defined?(ScriptLoader.load_tool)
    ScriptLoader.load_tool('SaveToPicture')
    images_to_show = data_to_add.map { |i| SaveToPicture.run(data: i) }
    images_to_show << SaveToPicture.run(data: error_text)
  end
  show_window_and_wait(texts_to_show, images_to_show || [])
end