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:
parent
54de52e6c5
commit
6bcd6deb76
30
deps/buildcore/scripts/file-to-cpp.py
vendored
Executable file
30
deps/buildcore/scripts/file-to-cpp.py
vendored
Executable 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)
|
@ -10,6 +10,8 @@
|
||||
* Add draw line tool to TileSheet editor
|
||||
* Replace file picker combo boxes with a browse button and file picker, and
|
||||
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 add files to specific directories.
|
||||
* Add ability to delete files from the project explorer.
|
||||
|
@ -134,7 +134,6 @@ ox::Error run(
|
||||
return ox::Error{1, "Please provide path to project directory or OxFS file."};
|
||||
}
|
||||
auto const path = args[1];
|
||||
OX_REQUIRE_M(fs, keel::loadRomFs(path));
|
||||
OX_REQUIRE_M(tctx, turbine::init(std::move(fs), project));
|
||||
OX_REQUIRE_M(tctx, turbine::init(path, project));
|
||||
return runTileSheetSetTest(*tctx);
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ constexpr auto makeLoader(Context &ctx) {
|
||||
if (!beginsWith(assetId, "/")) {
|
||||
auto const p = ctx.uuidToPath.at(assetId);
|
||||
if (p.error) {
|
||||
oxErrf("Could not find asset: {}", assetId);
|
||||
oxErrf("Could not find asset: {}\n", assetId);
|
||||
return ox::Error{1, "Asset ID not found"};
|
||||
}
|
||||
assetId = *p.value;
|
||||
|
@ -156,7 +156,7 @@ void StudioUI::draw() noexcept {
|
||||
void StudioUI::drawMenu() noexcept {
|
||||
if (ImGui::BeginMainMenuBar()) {
|
||||
if (ImGui::BeginMenu("File")) {
|
||||
if (ImGui::MenuItem("New...", "Ctrl+N")) {
|
||||
if (ImGui::MenuItem("New...", "Ctrl+N", false, m_project)) {
|
||||
m_newMenu.open();
|
||||
}
|
||||
if (ImGui::MenuItem("New Project...", "Ctrl+Shift+N")) {
|
||||
@ -254,6 +254,7 @@ void StudioUI::drawTabs() noexcept {
|
||||
if (!open) {
|
||||
if (e->unsavedChanges()) {
|
||||
m_closeFileConfirm.open();
|
||||
++it;
|
||||
} else {
|
||||
e->close();
|
||||
if (m_activeEditor == (*it).get()) {
|
||||
|
@ -84,10 +84,11 @@ ox::FileSystem &Project::romFs() 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) {
|
||||
OX_RETURN_ERROR(m_fs.mkdir(path, true));
|
||||
dirAdded.emit(path);
|
||||
OX_RETURN_ERROR(m_fs.stat(path).moveTo(stat));
|
||||
}
|
||||
return stat.fileType == ox::FileType::Directory ?
|
||||
ox::Error{} : ox::Error{1, "path exists as normal file"};
|
||||
|
Loading…
x
Reference in New Issue
Block a user