no longer use 'check_existing' to see if we need to have a save popup, instead use 'exec' operator on a saved file and

invoke on unsaved files.

correct missing memset --> CustomData_reset switch too.
This commit is contained in:
Campbell Barton
2012-10-31 17:03:31 +00:00
parent 5dfe20d87b
commit d705c52e65
6 changed files with 48 additions and 67 deletions

View File

@@ -1290,7 +1290,7 @@ class WM_OT_blenderplayer_start(Operator):
return {'CANCELLED'}
filepath = os.path.join(bpy.app.tempdir, "game.blend")
bpy.ops.wm.save_as_mainfile(filepath=filepath, check_existing=False, copy=True)
bpy.ops.wm.save_as_mainfile('EXEC_DEFAULT', filepath=filepath, copy=True)
subprocess.call([player_path, filepath])
return {'FINISHED'}

View File

@@ -112,8 +112,9 @@ class INFO_MT_file(Menu):
layout.separator()
layout.operator_context = 'INVOKE_AREA'
layout.operator("wm.save_mainfile", text="Save", icon='FILE_TICK').check_existing = False
layout.operator_context = 'EXEC_AREA' if context.blend_data.is_saved else 'INVOKE_AREA'
layout.operator("wm.save_mainfile", text="Save", icon='FILE_TICK')
layout.operator_context = 'INVOKE_AREA'
layout.operator("wm.save_as_mainfile", text="Save As...", icon='SAVE_AS')
layout.operator_context = 'INVOKE_AREA'