Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open/save all formats #360

Closed

Conversation

madd-games
Copy link
Contributor

@madd-games madd-games commented Mar 12, 2024

This PR makes some changes to how open/save/import/export works:

  • When you import an image while it is currently empty (e.g. by invoking goxel with a file name as cmdline args), it sets image->path to use this as the 'currently open file'.
  • I changed 'save (as)' so that it saves the current file in the format that it was opened in, rather than only saving as .gox.
  • As a result, if you 'save as' with a different extension than .gox, it will save as the format you requested.

The general idea is that if you open a file in any format, you should be able to save, instead of having to select the same file for 'export' every time. I think this makes sense and is done by other editors such as Aseprite, MSPaint, used to be done by GIMP (I don't like that they removed this).

It was problematic for me when I had to edit a whole bunch of files in a different format, and instead of being able to hit Ctrl+S to save, I had to go to export and find the directory and file every time.

Let me know if you have any questions, I'm also happy to make changes to the code.

@guillaumechereau
Copy link
Owner

Thanks for the PR. I'd like to make it work exactly like gimp currently does: "save" and "save as" only save in the 'gox' format, but when we directly import an image, in the file menu we add an explicit entry: "overwrite the_file.vox".

@madd-games
Copy link
Contributor Author

This could work by having a separate export_path besides the path, and maybe also storing the export format. What would be displayed in the title bar if there is both a path and an export_path?

@guillaumechereau
Copy link
Owner

I think the behavior should be exactly the same as in Gimp, including the title bar.

I am not totally sure how the implementation should work, but there are already two paths stored currently (for export and save), but I don't remember the details of how it worked right now. Would need to double check but probably won't have time this week.

@guillaumechereau
Copy link
Owner

I just checked the branch. As as I mentioned I would rather have a new menu item "override xxxx" to export over, and keep 'save' and 'save as' only for gox files as it is now.

@madd-games
Copy link
Contributor Author

I will try to implement the separate 'overwrite' menu entry when I get some time. I might change this PR or I might simply abandon this one and make a new one when I do so.

@guillaumechereau
Copy link
Owner

guillaumechereau commented Mar 19, 2024 via email

@madd-games
Copy link
Contributor Author

I've opened a new PR to fix this issue becasue the changes in this branch aren't really necessary, so I'm abandoning this one.

@madd-games madd-games closed this Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants