From f931a229626619f485baf31e931847d6befc5532 Mon Sep 17 00:00:00 2001 From: Thomas Thomassen Date: Fri, 19 May 2017 10:05:02 +0200 Subject: [PATCH] Add a menu item to force a new model, discarding current changes. --- src/retro_up/main.rb | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/retro_up/main.rb b/src/retro_up/main.rb index c2082ca..3ad5e22 100644 --- a/src/retro_up/main.rb +++ b/src/retro_up/main.rb @@ -15,20 +15,29 @@ module TT::Plugins::RetroUp retro_menu.add_separator id = retro_menu.add_item('Audio') { self.toggle_retro_mode } - retro_menu.set_validation_proc(id) { self.validation_proc_retro_mode } + retro_menu.set_validation_proc(id) { self.validation_proc_retro_mode } id = retro_menu.add_item('Style') { self.toggle_retro_style_mode } - retro_menu.set_validation_proc(id) { self.validation_proc_retro_style_mode } + retro_menu.set_validation_proc(id) { self.validation_proc_retro_style_mode } + + retro_menu.add_separator + + id = retro_menu.add_item('Force New Model') { self.new_model_discard_changes } retro_menu.add_separator id = retro_menu.add_item('Debug') { self.toggle_debug_mode } - retro_menu.set_validation_proc(id) { self.validation_proc_debug_mode } + retro_menu.set_validation_proc(id) { self.validation_proc_debug_mode } file_loaded(__FILE__) end + def self.new_model_discard_changes + Sketchup.active_model.close(true) + end + + def self.activate_all self.retro_mode = true self.retro_style_mode = true