Squashed 'deps/nostalgia/' changes from 646ab128..ab11b885

ab11b885 [keel] Add missing new line to log message
36fc25fb [studio] Fix closing tab with unsaved changes
4803cca3 [nostalgia/player] Cleanup
6bd74611 [nostalgia] Update release notes
c3f9cf9a [studio] Fix New Project opening project, disable New if no project open

git-subtree-dir: deps/nostalgia
git-subtree-split: ab11b885e680ee8f0be7ee06f2253ab7ddb726be
This commit is contained in:
Gary Talent 2025-03-27 00:22:14 -05:00
parent 54de52e6c5
commit 6bcd6deb76
6 changed files with 38 additions and 5 deletions

30
deps/buildcore/scripts/file-to-cpp.py vendored Executable file
View File

@ -0,0 +1,30 @@
#! /usr/bin/env python3
#
# Copyright 2016 - 2025 gary@drinkingtea.net
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
import argparse
import sys
def main() -> int:
parser = argparse.ArgumentParser()
parser.add_argument('--file', help='path to file')
parser.add_argument('--out-cpp', help='path to output cpp file')
parser.add_argument('--out-hpp', help='path to output hpp file')
parser.add_argument('--namespace', help='path to output hpp file')
args = parser.parse_args()
return 0
if __name__ == '__main__':
try:
err = main()
sys.exit(err)
except KeyboardInterrupt:
sys.exit(1)

View File

@ -10,6 +10,8 @@
* Add draw line tool to TileSheet editor * Add draw line tool to TileSheet editor
* Replace file picker combo boxes with a browse button and file picker, and * Replace file picker combo boxes with a browse button and file picker, and
support for dragging files from the project explorer. support for dragging files from the project explorer.
* Add ability to jump to a color in a Palette by double clicking on the
color from the TileSheet editor
* Add ability to create directories. * Add ability to create directories.
* Add ability to add files to specific directories. * Add ability to add files to specific directories.
* Add ability to delete files from the project explorer. * Add ability to delete files from the project explorer.

View File

@ -134,7 +134,6 @@ ox::Error run(
return ox::Error{1, "Please provide path to project directory or OxFS file."}; return ox::Error{1, "Please provide path to project directory or OxFS file."};
} }
auto const path = args[1]; auto const path = args[1];
OX_REQUIRE_M(fs, keel::loadRomFs(path)); OX_REQUIRE_M(tctx, turbine::init(path, project));
OX_REQUIRE_M(tctx, turbine::init(std::move(fs), project));
return runTileSheetSetTest(*tctx); return runTileSheetSetTest(*tctx);
} }

View File

@ -68,7 +68,7 @@ constexpr auto makeLoader(Context &ctx) {
if (!beginsWith(assetId, "/")) { if (!beginsWith(assetId, "/")) {
auto const p = ctx.uuidToPath.at(assetId); auto const p = ctx.uuidToPath.at(assetId);
if (p.error) { if (p.error) {
oxErrf("Could not find asset: {}", assetId); oxErrf("Could not find asset: {}\n", assetId);
return ox::Error{1, "Asset ID not found"}; return ox::Error{1, "Asset ID not found"};
} }
assetId = *p.value; assetId = *p.value;

View File

@ -156,7 +156,7 @@ void StudioUI::draw() noexcept {
void StudioUI::drawMenu() noexcept { void StudioUI::drawMenu() noexcept {
if (ImGui::BeginMainMenuBar()) { if (ImGui::BeginMainMenuBar()) {
if (ImGui::BeginMenu("File")) { if (ImGui::BeginMenu("File")) {
if (ImGui::MenuItem("New...", "Ctrl+N")) { if (ImGui::MenuItem("New...", "Ctrl+N", false, m_project)) {
m_newMenu.open(); m_newMenu.open();
} }
if (ImGui::MenuItem("New Project...", "Ctrl+Shift+N")) { if (ImGui::MenuItem("New Project...", "Ctrl+Shift+N")) {
@ -254,6 +254,7 @@ void StudioUI::drawTabs() noexcept {
if (!open) { if (!open) {
if (e->unsavedChanges()) { if (e->unsavedChanges()) {
m_closeFileConfirm.open(); m_closeFileConfirm.open();
++it;
} else { } else {
e->close(); e->close();
if (m_activeEditor == (*it).get()) { if (m_activeEditor == (*it).get()) {

View File

@ -84,10 +84,11 @@ ox::FileSystem &Project::romFs() noexcept {
} }
ox::Error Project::mkdir(ox::StringViewCR path) const noexcept { ox::Error Project::mkdir(ox::StringViewCR path) const noexcept {
auto const [stat, err] = m_fs.stat(path); auto [stat, err] = m_fs.stat(path);
if (err) { if (err) {
OX_RETURN_ERROR(m_fs.mkdir(path, true)); OX_RETURN_ERROR(m_fs.mkdir(path, true));
dirAdded.emit(path); dirAdded.emit(path);
OX_RETURN_ERROR(m_fs.stat(path).moveTo(stat));
} }
return stat.fileType == ox::FileType::Directory ? return stat.fileType == ox::FileType::Directory ?
ox::Error{} : ox::Error{1, "path exists as normal file"}; ox::Error{} : ox::Error{1, "path exists as normal file"};