├── icons ├── mr-light │ ├── scalable │ │ ├── actions │ │ │ ├── dialog-ok.svg │ │ │ ├── dialog-ok-apply.svg │ │ │ ├── go-down.svg │ │ │ ├── go-up.svg │ │ │ ├── archive-insert.svg │ │ │ ├── application-exit.svg │ │ │ ├── document-open-folder.svg │ │ │ ├── list-remove.svg │ │ │ ├── archive-extract.svg │ │ │ ├── archive-remove.svg │ │ │ ├── media-playback-pause.svg │ │ │ ├── kmouth-phrase-new.svg │ │ │ ├── edit-redo.svg │ │ │ ├── list-add.svg │ │ │ ├── edit-undo.svg │ │ │ ├── document-edit.svg │ │ │ ├── document-close.svg │ │ │ ├── view-preview.svg │ │ │ ├── edit-copy.svg │ │ │ ├── document-export.svg │ │ │ ├── document-import.svg │ │ │ ├── edit-paste.svg │ │ │ ├── document-open-recent.svg │ │ │ ├── document-save.svg │ │ │ ├── new-audio-alarm.svg │ │ │ ├── dialog-cancel.svg │ │ │ ├── configure.svg │ │ │ ├── edit-find.svg │ │ │ ├── document-chunks-export.svg │ │ │ ├── member-1.svg │ │ │ ├── member-2.svg │ │ │ ├── member-3.svg │ │ │ ├── document-save-as.svg │ │ │ ├── edit-cut.svg │ │ │ └── question.svg │ │ └── mimetypes │ │ │ └── archive-generic.svg │ └── index.theme ├── common │ ├── ff7.png │ ├── greenblock.svg │ ├── whiteblock.svg │ ├── blueblock.svg │ ├── cyanblock.svg │ ├── greyblock.svg │ ├── purpleblock.svg │ ├── redblock.svg │ ├── yellowblock.svg │ ├── blinkblock.svg │ └── multicolorblock.svg ├── CMakeLists.txt └── mr-dark │ ├── index.theme │ └── scalable │ ├── actions │ ├── dialog-ok.svg │ ├── dialog-ok-apply.svg │ ├── go-down.svg │ ├── go-up.svg │ ├── archive-insert.svg │ ├── application-exit.svg │ ├── document-open-folder.svg │ ├── list-remove.svg │ ├── archive-extract.svg │ ├── archive-remove.svg │ ├── media-playback-pause.svg │ ├── kmouth-phrase-new.svg │ ├── edit-redo.svg │ ├── list-add.svg │ ├── edit-undo.svg │ ├── document-edit.svg │ ├── view-preview.svg │ ├── document-close.svg │ ├── edit-copy.svg │ ├── document-export.svg │ ├── document-import.svg │ ├── edit-paste.svg │ ├── document-open-recent.svg │ ├── document-save.svg │ ├── new-audio-alarm.svg │ ├── dialog-cancel.svg │ ├── configure.svg │ ├── edit-find.svg │ ├── document-chunks-export.svg │ ├── member-2.svg │ ├── member-1.svg │ ├── member-3.svg │ ├── document-save-as.svg │ ├── edit-cut.svg │ └── question.svg │ └── mimetypes │ └── archive-generic.svg ├── .gitmodules ├── src ├── qt │ ├── images │ │ ├── font.png │ │ ├── keys.png │ │ ├── main.png │ │ ├── model.png │ │ ├── cursor.png │ │ ├── location.png │ │ ├── numbers.png │ │ ├── reactor.png │ │ ├── background.png │ │ ├── logo-shinra.ico │ │ ├── logo-shinra.png │ │ ├── text-editor.png │ │ ├── field-arrow-red.png │ │ ├── texture-purple.png │ │ └── field-arrow-green.png │ ├── shaders │ │ ├── main.vert │ │ └── main.frag │ ├── Makou_Reactor.qrc │ ├── vars.cfg │ └── Makou_Reactor.rc ├── widgets │ ├── BackgroundPaletteEditor.h │ ├── AboutDialog.h │ ├── KeyEditorDialog.h │ ├── EmptyFieldWidget.h │ ├── AnimEditorDialog.h │ ├── MiscWidget.h │ ├── PreviewBGLabel.h │ ├── ExportChunksDialog.h │ ├── TextHighlighter.h │ ├── FontManager.h │ ├── ScriptList.h │ ├── PsfDialog.h │ ├── FormatSelectionWidget.h │ ├── EncounterWidget.h │ ├── EmptyFieldWidget.cpp │ ├── HelpWidget.h │ ├── ScriptEditorWidgets │ │ ├── ScriptEditorModelPage.h │ │ ├── ScriptEditorMoviePage.h │ │ └── ScriptEditorWalkmeshPage.h │ ├── PreviewBG.h │ ├── EncounterTableWidget.h │ ├── QColorPicker.h │ ├── ImportDialog.h │ ├── VertexWidget.h │ ├── OperationsManager.h │ ├── ArchivePreview.h │ ├── FontGrid.h │ ├── MassImportDialog.h │ ├── FontDisplay.h │ ├── ModelManagerPS.h │ ├── MassExportDialog.h │ ├── PreviewBGLabel.cpp │ └── KeyEditorDialog.cpp ├── core │ ├── field │ │ ├── FieldModelTextureRef.cpp │ │ ├── FieldModelTextureRefPC.cpp │ │ ├── FieldModelLoader.cpp │ │ ├── FieldModelTextureRef.h │ │ ├── FieldArchivePS.h │ │ ├── TutFilePC.h │ │ ├── HrcFile.h │ │ ├── FieldModelTextureRefPC.h │ │ ├── AFile.h │ │ ├── RsdFile.h │ │ ├── FieldIO.h │ │ ├── BackgroundTilesFile.h │ │ ├── MapList.h │ │ ├── FieldPart.h │ │ ├── TdbFile.h │ │ ├── BcxFile.cpp │ │ ├── FieldArchivePS.cpp │ │ ├── FieldPart.cpp │ │ ├── BackgroundFilePS.h │ │ ├── BcxFile.h │ │ ├── BackgroundTilesFile.cpp │ │ ├── CaFile.h │ │ ├── FieldPSDemo.h │ │ ├── FieldArchivePC.h │ │ ├── TutFilePC.cpp │ │ ├── EncounterFile.h │ │ ├── CharArchive.h │ │ ├── TutFileStandard.h │ │ └── FieldModelLoaderPS.h │ ├── SystemColor.h │ ├── Var.h │ ├── CsvFile.h │ ├── SystemColor.cpp │ ├── SystemColor.mm │ └── Clipboard.h ├── ArgumentsTools.h ├── ArgumentsPatch.h ├── ArgumentsExport.h ├── FieldModelThread.h ├── CLI.h └── ArgumentsTools.cpp ├── deploy ├── macosx │ └── Makou_Reactor.icns ├── linux │ └── io.github.myst6re.makoureactor.desktop ├── CMakeLists.txt └── deployqt.cmake ├── .vcpkg ├── versions │ ├── f- │ │ └── ff7tk.json │ └── baseline.json └── ports │ └── ff7tk │ ├── vcpkg.json │ └── portfile.cmake ├── vcpkg-configuration.json ├── update-source-list.sh ├── vcpkg.json ├── .github └── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md ├── .vscode ├── c_cpp_properties.json └── launch.json ├── .clang-format └── CMakePresets.json /icons/mr-light/scalable/actions/dialog-ok.svg: -------------------------------------------------------------------------------- 1 | dialog-ok-apply.svg -------------------------------------------------------------------------------- /icons/common/ff7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myst6re/makoureactor/HEAD/icons/common/ff7.png -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "vcpkg"] 2 | path = vcpkg 3 | url = https://github.com/microsoft/vcpkg.git 4 | -------------------------------------------------------------------------------- /src/qt/images/font.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myst6re/makoureactor/HEAD/src/qt/images/font.png -------------------------------------------------------------------------------- /src/qt/images/keys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myst6re/makoureactor/HEAD/src/qt/images/keys.png -------------------------------------------------------------------------------- /src/qt/images/main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myst6re/makoureactor/HEAD/src/qt/images/main.png -------------------------------------------------------------------------------- /src/qt/images/model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myst6re/makoureactor/HEAD/src/qt/images/model.png -------------------------------------------------------------------------------- /src/qt/images/cursor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myst6re/makoureactor/HEAD/src/qt/images/cursor.png -------------------------------------------------------------------------------- /src/qt/images/location.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myst6re/makoureactor/HEAD/src/qt/images/location.png -------------------------------------------------------------------------------- /src/qt/images/numbers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myst6re/makoureactor/HEAD/src/qt/images/numbers.png -------------------------------------------------------------------------------- /src/qt/images/reactor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myst6re/makoureactor/HEAD/src/qt/images/reactor.png -------------------------------------------------------------------------------- /src/qt/images/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myst6re/makoureactor/HEAD/src/qt/images/background.png -------------------------------------------------------------------------------- /src/qt/images/logo-shinra.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myst6re/makoureactor/HEAD/src/qt/images/logo-shinra.ico -------------------------------------------------------------------------------- /src/qt/images/logo-shinra.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myst6re/makoureactor/HEAD/src/qt/images/logo-shinra.png -------------------------------------------------------------------------------- /src/qt/images/text-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myst6re/makoureactor/HEAD/src/qt/images/text-editor.png -------------------------------------------------------------------------------- /deploy/macosx/Makou_Reactor.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myst6re/makoureactor/HEAD/deploy/macosx/Makou_Reactor.icns -------------------------------------------------------------------------------- /src/qt/images/field-arrow-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myst6re/makoureactor/HEAD/src/qt/images/field-arrow-red.png -------------------------------------------------------------------------------- /src/qt/images/texture-purple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myst6re/makoureactor/HEAD/src/qt/images/texture-purple.png -------------------------------------------------------------------------------- /src/qt/images/field-arrow-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/myst6re/makoureactor/HEAD/src/qt/images/field-arrow-green.png -------------------------------------------------------------------------------- /.vcpkg/versions/f-/ff7tk.json: -------------------------------------------------------------------------------- 1 | { 2 | "versions": [ 3 | { 4 | "version": "1.3.1", 5 | "path": "$/ports/ff7tk" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /.vcpkg/versions/baseline.json: -------------------------------------------------------------------------------- 1 | { 2 | "default": { 3 | "ff7tk": { 4 | "baseline": "1.3.1", 5 | "port-version": 0 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /vcpkg-configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "registries": [ 3 | { 4 | "kind": "filesystem", 5 | "path": ".vcpkg", 6 | "packages": [ 7 | "ff7tk" 8 | ] 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /icons/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #BUILD OUR ICON QRC FILE. 2 | find_package(Qt6 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS 3 | Core 4 | Svg 5 | ) 6 | add_library(MRICONS STATIC icons.qrc) 7 | target_link_libraries(MRICONS PUBLIC Qt::Svg) 8 | -------------------------------------------------------------------------------- /icons/mr-dark/index.theme: -------------------------------------------------------------------------------- 1 | [Icon Theme] 2 | Name=mr-dark 3 | DisplayDepth=32 4 | FollowsColorScheme=true 5 | Directories=scalable/actions,scalable/mimetypes 6 | 7 | [scalable/actions] 8 | Size=48 9 | Context=Actions 10 | Type=Scalable 11 | MinSize=16 12 | MaxSize=256 13 | 14 | [scalable/mimetypes] 15 | Size=48 16 | Context=MimeTypes 17 | Type=Scalable 18 | MinSize=16 19 | MaxSize=256 20 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/dialog-ok.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/mr-light/index.theme: -------------------------------------------------------------------------------- 1 | [Icon Theme] 2 | Name=mr-light 3 | DisplayDepth=32 4 | FollowsColorScheme=true 5 | Directories=scalable/actions,scalable/mimetypes 6 | 7 | [scalable/actions] 8 | Size=48 9 | Context=Actions 10 | Type=Scalable 11 | MinSize=16 12 | MaxSize=256 13 | 14 | [scalable/mimetypes] 15 | Size=48 16 | Context=MimeTypes 17 | Type=Scalable 18 | MinSize=16 19 | MaxSize=256 20 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/dialog-ok-apply.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/dialog-ok-apply.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/go-down.svg: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/go-up.svg: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/go-down.svg: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/go-up.svg: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/archive-insert.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/archive-insert.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/mimetypes/archive-generic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/application-exit.svg: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/application-exit.svg: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /icons/common/greenblock.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /icons/common/whiteblock.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/document-open-folder.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/document-open-folder.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /deploy/linux/io.github.myst6re.makoureactor.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Name=Makou Reactor 4 | GenericName=FF7 Field Script Editor 5 | GenericName[fr]=Éditeur d'écrans FF7 6 | Comment=Can edit field from Final Fantasy VII (PS & PC) 7 | Comment[fr]=Permet de modifier les écrans de Final Fantasy VII (PS et PC) 8 | Icon=io.github.myst6re.makoureactor 9 | Exec=Makou_Reactor 10 | Terminal=false 11 | Categories=Game; 12 | Keywords=PlayStation;Final Fantasy; 13 | StartupNotify=false 14 | -------------------------------------------------------------------------------- /icons/common/blueblock.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /icons/common/cyanblock.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /icons/common/greyblock.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /icons/common/purpleblock.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /icons/common/redblock.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /icons/common/yellowblock.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/list-remove.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/list-remove.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.vcpkg/ports/ff7tk/vcpkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ff7tk", 3 | "version": "1.3.1", 4 | "description": "Toolkit for making tools to edit Final Fantasy VII", 5 | "homepage": "https://github.com/sithlord48/ff7tk", 6 | "license": " LGPL-3.0", 7 | "supports": "(windows & !uwp), (linux, osx)", 8 | "dependencies": [ 9 | "zlib", 10 | { 11 | "name": "vcpkg-cmake", 12 | "host": true 13 | }, 14 | { 15 | "name": "vcpkg-cmake-config", 16 | "host": true 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/archive-extract.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/archive-extract.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/qt/shaders/main.vert: -------------------------------------------------------------------------------- 1 | #version 410 core 2 | 3 | in vec4 a_position; 4 | in vec4 a_color; 5 | in vec2 a_texcoord; 6 | 7 | out vec4 v_color; 8 | out vec2 v_texcoord; 9 | 10 | uniform mat4 modelMatrix; 11 | uniform mat4 projectionMatrix; 12 | uniform mat4 viewMatrix; 13 | uniform float pointSize; 14 | 15 | void main() 16 | { 17 | mat4 mat = projectionMatrix * viewMatrix * modelMatrix; 18 | 19 | gl_Position = mat * a_position; 20 | gl_PointSize = pointSize; 21 | v_color = a_color; 22 | v_texcoord = a_texcoord; 23 | } 24 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/archive-remove.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/media-playback-pause.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 11 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/archive-remove.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/qt/shaders/main.frag: -------------------------------------------------------------------------------- 1 | #version 410 core 2 | 3 | in vec4 v_color; 4 | in vec2 v_texcoord; 5 | 6 | out vec4 o_color; 7 | 8 | uniform sampler2D tex; 9 | 10 | void main() 11 | { 12 | vec4 _color = v_color; 13 | 14 | // Integrate texture color with the current vertex color 15 | if (v_texcoord.x > 0.0 || v_texcoord.y > 0.0) 16 | { 17 | vec4 _texColor = texture(tex, v_texcoord.xy); 18 | 19 | if (_texColor.a == 0.0) discard; 20 | 21 | _color *= _texColor; 22 | } 23 | 24 | o_color = _color; 25 | } 26 | -------------------------------------------------------------------------------- /update-source-list.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Updates the PROJECT_SOURCES variable in CMakeLists.txt 4 | 5 | CMAKELISTS="$(dirname "$0")"/CMakeLists.txt 6 | 7 | ( 8 | cat "$CMAKELISTS" | \ 9 | tr '\n' '\f' | \ 10 | sed -r 's|set\(PROJECT_SOURCES[^)]*\)|set(PROJECT_SOURCES'"$(printf '\f')$(find -s src -type f '(' -name '*.cpp' -o -name '*.h' ')' -exec echo ' "'{}'"' ';' | sed 's/|/\\|/' | tr '\n' '\f')"')|' | \ 11 | tr '\f' '\n' > "$CMAKELISTS".tmp && \ 12 | mv "$CMAKELISTS".tmp "$CMAKELISTS" 13 | ) || rm -f "$CMAKELISTS".tmp 14 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/media-playback-pause.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 11 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/kmouth-phrase-new.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/kmouth-phrase-new.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/edit-redo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/list-add.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/edit-redo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/list-add.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/edit-undo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/edit-undo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /vcpkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "makou-reactor", 3 | "version": "2.1.0", 4 | "builtin-baseline": "ce613c41372b23b1f51333815feb3edd87ef8a8b", 5 | "dependencies": [ 6 | "ff7tk", 7 | "vulkan-headers", 8 | "zlib" 9 | ], 10 | "overrides": [ 11 | { 12 | "name": "ff7tk", 13 | "version": "1.3.1", 14 | "port-version": 0 15 | }, 16 | { 17 | "name": "vulkan-headers", 18 | "version": "1.4.304.1", 19 | "port-version": 1 20 | }, 21 | { 22 | "name": "zlib", 23 | "version": "1.3.1", 24 | "port-version": 0 25 | } 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/document-edit.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 14 | 15 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/document-edit.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 14 | 15 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/view-preview.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/document-close.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/document-close.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/view-preview.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/edit-copy.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/edit-copy.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/document-export.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/document-import.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/document-export.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/document-import.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: myst6re 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/edit-paste.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/edit-paste.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Win32", 5 | "includePath": [ 6 | "${default}", 7 | "${workspaceFolder}/**" 8 | ], 9 | "defines": [ 10 | "_DEBUG", 11 | "UNICODE", 12 | "_UNICODE" 13 | ], 14 | "cStandard": "c11", 15 | "cppStandard": "c++17", 16 | "intelliSenseMode": "windows-msvc-x64", 17 | "browse": { 18 | "limitSymbolsToIncludedHeaders": true 19 | }, 20 | "configurationProvider": "ms-vscode.cmake-tools" 21 | } 22 | ], 23 | "version": 4 24 | } 25 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/mimetypes/archive-generic.svg: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/document-open-recent.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/document-open-recent.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/document-save.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 11 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/document-save.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 11 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/new-audio-alarm.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/new-audio-alarm.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/dialog-cancel.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/dialog-cancel.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/configure.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 17 | 18 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/configure.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 17 | 18 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/edit-find.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/edit-find.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/document-chunks-export.svg: -------------------------------------------------------------------------------- 1 | 2 | 9 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/document-chunks-export.svg: -------------------------------------------------------------------------------- 1 | 2 | 9 | -------------------------------------------------------------------------------- /src/qt/Makou_Reactor.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/reactor.png 4 | images/numbers.png 5 | images/logo-shinra.png 6 | images/font.png 7 | images/keys.png 8 | images/field-arrow-green.png 9 | images/field-arrow-red.png 10 | images/background.png 11 | images/location.png 12 | images/main.png 13 | images/model.png 14 | vars.cfg 15 | images/text-editor.png 16 | images/cursor.png 17 | shaders/main.vert 18 | shaders/main.frag 19 | images/texture-purple.png 20 | 21 | 22 | -------------------------------------------------------------------------------- /deploy/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Deploy translations 2 | if(APPLE) 3 | set(TRANSLATIONS_PATH ${PROJECT_NAME}.app/Contents/MacOS/translations) 4 | elseif(WIN32) 5 | set(TRANSLATIONS_PATH translations) 6 | else() 7 | set(TRANSLATIONS_PATH share/makoureactor/translations) 8 | endif() 9 | 10 | install(FILES ${QM_FILES} DESTINATION "${TRANSLATIONS_PATH}") 11 | 12 | # Deploy Qt using macdeployqt and windeployqt scripts 13 | if((APPLE AND GUI) OR WIN32) 14 | install(FILES ${ff7tk_QM_FILES} DESTINATION "${TRANSLATIONS_PATH}") 15 | install(CODE "set(_target_file_dir \"${QT_DEPLOY_TMP_DIR}\")") 16 | install(CODE "set(_target_bundle_name \"${PROJECT_NAME}.app\")") 17 | install(CODE "set(_qt_translations_dir \"${_qt_translations_dir}\")") 18 | install(CODE "set(_qt_bin_dir \"${_qt_bin_dir}\")") 19 | install(CODE "set(LANGS \"${LANGS}\")") 20 | install(SCRIPT deployqt.cmake) 21 | endif() 22 | -------------------------------------------------------------------------------- /src/widgets/BackgroundPaletteEditor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | class BackgroundFile; 8 | class Palette; 9 | 10 | class BackgroundPaletteEditor : public QWidget 11 | { 12 | Q_OBJECT 13 | public: 14 | explicit BackgroundPaletteEditor(QWidget *parent = nullptr); 15 | void setBackgroundFile(BackgroundFile *backgroundFile); 16 | void clear(); 17 | private slots: 18 | void setCurrentPalette(int palID); 19 | void choosePixelColor(const Cell &cell); 20 | void setTransparencyFlag(); 21 | void addPalette(); 22 | void removePalette(); 23 | signals: 24 | void modified(); 25 | 26 | private: 27 | QListWidgetItem *createItem(qsizetype i) const; 28 | Palette *currentPalette(); 29 | 30 | ListWidget *_listWidget; 31 | QCheckBox *_transparency; 32 | ImageGridWidget *_imageGrid; 33 | 34 | BackgroundFile *_backgroundFile; 35 | }; 36 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: myst6re 7 | 8 | --- 9 | 10 | **PLEASE NOTE:** Before create a new issue, please check if your bug exists with the last unstable version (https://github.com/myst6re/makoureactor/releases/tag/continuous). 11 | 12 | **Describe the bug** 13 | A clear and concise description of what the bug is. 14 | 15 | **To Reproduce** 16 | Steps to reproduce the behavior: 17 | 1. Go to '...' 18 | 2. Click on '....' 19 | 3. Scroll down to '....' 20 | 4. See error 21 | 22 | **Expected behavior** 23 | A clear and concise description of what you expected to happen. 24 | 25 | **Screenshots** 26 | If applicable, add screenshots to help explain your problem. 27 | 28 | **Desktop (please complete the following information):** 29 | - OS: [e.g. iOS] 30 | - Compiler [e.g gc] 31 | - Version [e.g. 0.20.80, git hash] 32 | - Qt Version used. 33 | 34 | **Additional context** 35 | Add any other context about the problem here. 36 | -------------------------------------------------------------------------------- /src/qt/vars.cfg: -------------------------------------------------------------------------------- 1 | 1|3|$AerisLovePoints 2 | 1|4|$TifaLovePoints 3 | 1|5|$YuffieLovePoints 4 | 1|6|$BarretLovePoints 5 | 1|20|$Hours 6 | 1|21|$Minutes 7 | 1|22|$Seconds 8 | 1|23|$Frames 9 | 1|64|$KeyItems 10 | 1|65|$KeyItems 11 | 1|66|$KeyItems 12 | 1|67|$KeyItems 13 | 1|68|$KeyItems 14 | 1|69|$KeyItems 15 | 1|70|$KeyItems 16 | 1|80|$AerisBattleLovePoints 17 | 1|81|$TifaBattleLovePoints 18 | 1|82|$YuffieBattleLovePoints 19 | 1|83|$BarretBattleLovePoints 20 | 1|85|$ChocoboType1Catched 21 | 1|86|$ChocoboType2Catched 22 | 1|87|$ChocoboType3Catched 23 | 1|88|$ChocoboType4Catched 24 | 1|124|$ChocoboOnMap 25 | 1|167|$VictoryFortCondor 26 | 1|182|$DefeatFortCondor 27 | 2|0|$GameMoment 28 | 2|24|$BattleCount 29 | 2|26|$BattleEscaped 30 | 2|180|$GoldFortCondor 31 | 3|9|$PartyLeader 32 | 3|88|$NumStablesBought 33 | 3|89|$NumStablesFilled 34 | 13|31|$ErrorAddMateria 35 | 13|84|$LastCloud 36 | 13|85|$LastBarret 37 | 13|86|$LastTifa 38 | 13|87|$LastRedXIII 39 | 13|88|$LastCid 40 | 13|89|$LastYuffi 41 | 13|90|$LastCaitSith 42 | 13|92|$LastVincent 43 | 15|0|$GaiinItemFlags 44 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/member-2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | 2 12 | 13 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/member-1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | 1 12 | 13 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/member-2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | 2 12 | 13 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/member-3.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | 3 12 | 13 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/member-1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | 1 12 | 13 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/member-3.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | 3 12 | 13 | -------------------------------------------------------------------------------- /.vcpkg/ports/ff7tk/portfile.cmake: -------------------------------------------------------------------------------- 1 | if(VCPKG_TARGET_IS_WINDOWS) 2 | set(VCPKG_C_FLAGS "-bigobj ${VCPKG_C_FLAGS}") 3 | set(VCPKG_CXX_FLAGS "-bigobj ${VCPKG_CXX_FLAGS}") 4 | endif() 5 | 6 | vcpkg_from_github( 7 | OUT_SOURCE_PATH SOURCE_PATH 8 | REPO sithlord48/ff7tk 9 | REF v1.3.1 10 | SHA512 4800bfaa50d5dc471b703b2c09f45da3478ba7dbc78625d55214069d3ec7acc898663934a0c5195e2170a98dfd3c32299198eee1e675936301cc72a528e289ed 11 | HEAD_REF master 12 | ) 13 | 14 | vcpkg_cmake_configure( 15 | SOURCE_PATH ${SOURCE_PATH} 16 | OPTIONS 17 | "-DPACKAGE=OFF" 18 | "-DTESTS=OFF" 19 | "-DCMAKE_PROJECT_INCLUDE=${CMAKE_CURRENT_LIST_DIR}/qt.cmake" 20 | ) 21 | 22 | vcpkg_cmake_install() 23 | vcpkg_copy_pdbs() 24 | vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT}) 25 | vcpkg_fixup_pkgconfig() 26 | 27 | file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/lib/cmake" "${CURRENT_PACKAGES_DIR}/lib/cmake" "${CURRENT_PACKAGES_DIR}/debug/share" "${CURRENT_PACKAGES_DIR}/share/licenses") 28 | file(INSTALL ${SOURCE_PATH}/COPYING.TXT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) 29 | -------------------------------------------------------------------------------- /src/core/field/FieldModelTextureRef.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #include "FieldModelTextureRef.h" 19 | 20 | FieldModelTextureRef::~FieldModelTextureRef() 21 | { 22 | } 23 | -------------------------------------------------------------------------------- /src/core/field/FieldModelTextureRefPC.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #include "FieldModelTextureRefPC.h" 19 | 20 | FieldModelTextureRefPC::~FieldModelTextureRefPC() 21 | { 22 | } 23 | -------------------------------------------------------------------------------- /icons/common/blinkblock.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/qt/Makou_Reactor.rc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | IDI_ICON1 ICON DISCARDABLE "images/logo-shinra.ico" 4 | 5 | VS_VERSION_INFO VERSIONINFO 6 | FILEVERSION MAKOU_REACTOR_VERSION_MAJOR,MAKOU_REACTOR_VERSION_MINOR,MAKOU_REACTOR_VERSION_PATCH,MAKOU_REACTOR_VERSION_TWEAK 7 | PRODUCTVERSION MAKOU_REACTOR_VERSION_MAJOR,MAKOU_REACTOR_VERSION_MINOR,MAKOU_REACTOR_VERSION_PATCH,MAKOU_REACTOR_VERSION_TWEAK 8 | FILEOS VOS_UNKNOWN 9 | FILETYPE VFT_APP 10 | FILESUBTYPE VFT2_UNKNOWN 11 | FILEFLAGSMASK 0x00000000 12 | FILEFLAGS 0x00000000 13 | BEGIN 14 | BLOCK "StringFileInfo" 15 | BEGIN 16 | BLOCK "040C04E4" 17 | BEGIN 18 | VALUE "CompanyName", MAKOU_REACTOR_COMPANY 19 | VALUE "FileDescription", MAKOU_REACTOR_DESCRIPTION 20 | VALUE "ProductName", MAKOU_REACTOR_NAME 21 | VALUE "FileVersion", MAKOU_REACTOR_VERSION 22 | VALUE "ProductVersion", MAKOU_REACTOR_VERSION 23 | END 24 | END 25 | BLOCK "VarFileInfo" 26 | BEGIN 27 | VALUE "Translation", 0x40C, 1252 28 | END 29 | END 30 | -------------------------------------------------------------------------------- /src/ArgumentsTools.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Copyright (C) 2009-2021 Arzel Jérôme 3 | ** 4 | ** This program is free software: you can redistribute it and/or modify 5 | ** it under the terms of the GNU General Public License as published by 6 | ** the Free Software Foundation, either version 3 of the License, or 7 | ** (at your option) any later version. 8 | ** 9 | ** This program is distributed in the hope that it will be useful, 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | ** GNU General Public License for more details. 13 | ** 14 | ** You should have received a copy of the GNU General Public License 15 | ** along with this program. If not, see . 16 | ****************************************************************************/ 17 | #pragma once 18 | 19 | #include 20 | #include "Arguments.h" 21 | 22 | class ArgumentsTools : public CommonArguments 23 | { 24 | public: 25 | ArgumentsTools(); 26 | QDir dir() const; 27 | private: 28 | void parse(); 29 | QString _directory; 30 | }; 31 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/document-save-as.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 11 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/document-save-as.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 11 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /src/widgets/AboutDialog.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | 22 | class AboutDialog : public QDialog 23 | { 24 | Q_OBJECT 25 | public: 26 | explicit AboutDialog(QWidget *parent = nullptr); 27 | 28 | signals: 29 | 30 | }; 31 | -------------------------------------------------------------------------------- /src/core/field/FieldModelLoader.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #include "FieldModelLoader.h" 19 | 20 | FieldModelLoader::FieldModelLoader(Field *field) : 21 | FieldPart(field) 22 | { 23 | } 24 | 25 | FieldModelLoader::~FieldModelLoader() 26 | { 27 | } 28 | -------------------------------------------------------------------------------- /src/core/field/FieldModelTextureRef.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | 22 | class FieldModelTextureRef 23 | { 24 | public: 25 | FieldModelTextureRef() {} 26 | virtual ~FieldModelTextureRef(); 27 | virtual quint64 textureIdentifier() const=0; 28 | }; 29 | -------------------------------------------------------------------------------- /src/widgets/KeyEditorDialog.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | 22 | class KeyEditorDialog : public QDialog 23 | { 24 | Q_OBJECT 25 | public: 26 | explicit KeyEditorDialog(quint16, QWidget *parent = nullptr); 27 | int keys() const; 28 | }; 29 | -------------------------------------------------------------------------------- /src/core/SystemColor.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | 22 | class SystemColor 23 | { 24 | public: 25 | static QColor red(); 26 | static QColor blue(); 27 | static QColor green(); 28 | static QColor orange(); 29 | static QColor purple(); 30 | static QColor grey(); 31 | }; 32 | 33 | -------------------------------------------------------------------------------- /src/widgets/EmptyFieldWidget.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | 22 | class EmptyFieldWidget : public QWidget 23 | { 24 | Q_OBJECT 25 | public: 26 | explicit EmptyFieldWidget(QWidget *parent = nullptr); 27 | 28 | signals: 29 | void createMapClicked(); 30 | void importMapClicked(); 31 | }; 32 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/edit-cut.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/edit-cut.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /deploy/deployqt.cmake: -------------------------------------------------------------------------------- 1 | if(APPLE) 2 | set(_target_file_dir "${_target_file_dir}/${_target_bundle_name}") 3 | 4 | set(DEPLOYQT_NAME mac) 5 | set(DEPLOYQT_ARGS) 6 | elseif(WIN32) 7 | set(DEPLOYQT_NAME win) 8 | list(JOIN LANGS "," QT_LANGS) 9 | set(DEPLOYQT_ARGS --no-quick-import -network -xml -qml --translations ${QT_LANGS}) 10 | endif() 11 | 12 | if(APPLE OR WIN32) 13 | find_program(DEPLOYQT_EXECUTABLE "${DEPLOYQT_NAME}deployqt" HINTS "${_qt_bin_dir}") 14 | execute_process( 15 | COMMAND "${DEPLOYQT_EXECUTABLE}" ${DEPLOYQT_ARGS} "${_target_file_dir}" 16 | RESULT_VARIABLE ret 17 | ) 18 | 19 | if(NOT ret EQUAL "0") 20 | message(FATAL_ERROR "${DEPLOYQT_EXECUTABLE} returns ${ret}") 21 | endif() 22 | endif() 23 | 24 | if(APPLE) 25 | # Translations are not installed by macdeployqt script 26 | list(TRANSFORM LANGS REPLACE ".+" "${_qt_translations_dir}/qt_\\0.qm" OUTPUT_VARIABLE QT_QM_FILES) 27 | file(COPY ${QT_QM_FILES} DESTINATION "${_target_file_dir}/Contents/MacOS/translations") 28 | elseif(WIN32) 29 | if (CMAKE_BUILD_TYPE STREQUAL "Debug") 30 | file(COPY ${_qt_bin_dir}/Qt6Core5Compatd.dll DESTINATION "${_target_file_dir}") 31 | else() 32 | file(COPY ${_qt_bin_dir}/Qt6Core5Compat.dll DESTINATION "${_target_file_dir}") 33 | endif() 34 | endif() 35 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "inputs": [ 7 | { 8 | "id": "cmakeCache.QT_PATH", 9 | "type": "command", 10 | "command": "cmake.cacheVariable", 11 | "args": { 12 | "name": "QT_PATH" 13 | } 14 | } 15 | ], 16 | "configurations": [ 17 | { 18 | "name": "(Windows) Launch", 19 | "type": "cppvsdbg", 20 | "request": "launch", 21 | "program": "${command:cmake.launchTargetPath}", 22 | "args": [], 23 | "stopAtEntry": false, 24 | "cwd": "${command:cmake.launchTargetDirectory}", 25 | "environment": [ 26 | { 27 | "name": "PATH", 28 | "value": "${input:cmakeCache.QT_PATH}/bin:${input:cmakeCache.QT_PATH}/lib:${command:cmake.launchTargetDirectory}:${env:PATH}" 29 | } 30 | ], 31 | "windows": { 32 | "environment": [ 33 | { 34 | "name": "PATH", 35 | "value": "${input:cmakeCache.QT_PATH}/bin;${input:cmakeCache.QT_PATH}/lib;${command:cmake.launchTargetDirectory};${env:PATH}" 36 | } 37 | ] 38 | }, 39 | "externalConsole": false 40 | } 41 | ] 42 | } 43 | -------------------------------------------------------------------------------- /src/core/field/FieldArchivePS.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include "FieldArchive.h" 21 | #include "FieldArchiveIOPS.h" 22 | 23 | class FieldArchivePS : public FieldArchive 24 | { 25 | public: 26 | FieldArchivePS(); 27 | FieldArchivePS(const QString &path, FieldArchiveIO::Type type); 28 | inline bool isPC() const override { return false; } 29 | 30 | FieldArchiveIOPS *io() const override; 31 | }; 32 | -------------------------------------------------------------------------------- /icons/mr-dark/scalable/actions/question.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /icons/mr-light/scalable/actions/question.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/widgets/AnimEditorDialog.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | #include "3d/FieldModel.h" 22 | 23 | class AnimEditorDialog : public QDialog 24 | { 25 | Q_OBJECT 26 | public: 27 | explicit AnimEditorDialog(int animID, QWidget *parent = nullptr); 28 | int chosenAnimation(); 29 | private slots: 30 | void changeModelAnimation(); 31 | private: 32 | FieldModel *fieldModel; 33 | QListWidget *aList; 34 | }; 35 | -------------------------------------------------------------------------------- /src/widgets/MiscWidget.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | 22 | class InfFile; 23 | class Field; 24 | 25 | class MiscWidget : public QDialog 26 | { 27 | Q_OBJECT 28 | public: 29 | explicit MiscWidget(InfFile *data, Field *field, QWidget *parent = nullptr); 30 | private: 31 | void fill(); 32 | InfFile *data; 33 | Field *field; 34 | QLineEdit *mapName, *mapAuthor; 35 | protected: 36 | void accept() override; 37 | }; 38 | -------------------------------------------------------------------------------- /src/core/field/TutFilePC.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | #include "TutFile.h" 22 | 23 | class TutFilePC : public TutFile 24 | { 25 | public: 26 | TutFilePC(); 27 | using TutFile::open; // open(QByteArray) 28 | bool open() override; 29 | QByteArray save() const override; 30 | inline int maxTutCount() const override { return 9; } 31 | protected: 32 | QList openPositions(const QByteArray &data) const override; 33 | }; 34 | -------------------------------------------------------------------------------- /src/ArgumentsPatch.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Copyright (C) 2009-2021 Arzel Jérôme 3 | ** 4 | ** This program is free software: you can redistribute it and/or modify 5 | ** it under the terms of the GNU General Public License as published by 6 | ** the Free Software Foundation, either version 3 of the License, or 7 | ** (at your option) any later version. 8 | ** 9 | ** This program is distributed in the hope that it will be useful, 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | ** GNU General Public License for more details. 13 | ** 14 | ** You should have received a copy of the GNU General Public License 15 | ** along with this program. If not, see . 16 | ****************************************************************************/ 17 | #pragma once 18 | 19 | #include 20 | #include "Arguments.h" 21 | 22 | class ArgumentsPatch : public CommonArguments 23 | { 24 | public: 25 | ArgumentsPatch(); 26 | QString targetFile() const; 27 | bool emptyUnusedTexts() const; 28 | bool removeDialogs() const; 29 | bool removeEncounters() const; 30 | bool autosizeTextWindows() const; 31 | bool cleanModelLoader() const; 32 | bool removeTilesSections() const; 33 | bool repairBackgrounds() const; 34 | private: 35 | void parse(); 36 | QString _target_file; 37 | }; 38 | -------------------------------------------------------------------------------- /src/widgets/PreviewBGLabel.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | 22 | class PreviewBGLabel : public QLabel 23 | { 24 | Q_OBJECT 25 | public: 26 | explicit PreviewBGLabel(QWidget *parent = nullptr); 27 | signals: 28 | void saveRequested(); 29 | private: 30 | bool _showSave; 31 | protected: 32 | void paintEvent(QPaintEvent *e) override; 33 | void enterEvent(QEnterEvent *e) override; 34 | void leaveEvent(QEvent *e) override; 35 | void mousePressEvent(QMouseEvent *e) override; 36 | }; 37 | -------------------------------------------------------------------------------- /src/widgets/ExportChunksDialog.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2024 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | #include "core/field/Field.h" 22 | 23 | class ExportChunksDialog : public QDialog 24 | { 25 | Q_OBJECT 26 | public: 27 | ExportChunksDialog(QWidget *parent = nullptr); 28 | Field::FieldSections parts() const; 29 | private: 30 | QCheckBox *scripts; 31 | QCheckBox *ca; 32 | QCheckBox *id; 33 | QCheckBox *tiles; 34 | QCheckBox *encounter; 35 | QCheckBox *inf; 36 | QCheckBox *model; 37 | QCheckBox *mim; 38 | QCheckBox *palette; 39 | }; 40 | -------------------------------------------------------------------------------- /src/widgets/TextHighlighter.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | 22 | class TextHighlighter : public QSyntaxHighlighter 23 | { 24 | public: 25 | explicit TextHighlighter(QTextDocument *parent = nullptr, bool tut = false); 26 | 27 | protected: 28 | void highlightBlock(const QString &text) override; 29 | 30 | private: 31 | struct HighlightingRule { 32 | QRegularExpression pattern; 33 | QColor color; 34 | }; 35 | QList highlightingRules; 36 | }; 37 | -------------------------------------------------------------------------------- /src/ArgumentsExport.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Copyright (C) 2009-2021 Arzel Jérôme 3 | ** 4 | ** This program is free software: you can redistribute it and/or modify 5 | ** it under the terms of the GNU General Public License as published by 6 | ** the Free Software Foundation, either version 3 of the License, or 7 | ** (at your option) any later version. 8 | ** 9 | ** This program is distributed in the hope that it will be useful, 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | ** GNU General Public License for more details. 13 | ** 14 | ** You should have received a copy of the GNU General Public License 15 | ** along with this program. If not, see . 16 | ****************************************************************************/ 17 | #pragma once 18 | 19 | #include 20 | #include "Arguments.h" 21 | #include 22 | 23 | class ArgumentsExport : public CommonArguments 24 | { 25 | public: 26 | ArgumentsExport(); 27 | QString mapFileFormat() const; 28 | QString backgroundFormat() const; 29 | QString soundFormat() const; 30 | QString textFormat() const; 31 | QString chunkFormat() const; 32 | PsfTags psfTags() const; 33 | bool force() const; 34 | inline QString destination() const { 35 | return _directory; 36 | } 37 | private: 38 | void parse(); 39 | QString _directory; 40 | }; 41 | -------------------------------------------------------------------------------- /src/core/Var.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | 22 | class Var 23 | { 24 | public: 25 | static bool load(); 26 | static bool save(const QMap &varNames); 27 | static QString name(quint8 bank, quint8 address); 28 | static inline const QMap &get() { 29 | return _varNames; 30 | } 31 | static void set(quint8 bank, quint8 address, const QString &name); 32 | static void del(quint8 bank, quint8 address); 33 | static bool exists(quint8 bank, quint8 address); 34 | 35 | private: 36 | static QMap _varNames; 37 | }; 38 | -------------------------------------------------------------------------------- /src/core/field/HrcFile.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | #include "FieldModelSkeleton.h" 22 | 23 | class HrcFile : public IO 24 | { 25 | public: 26 | explicit HrcFile(QIODevice *io); 27 | virtual ~HrcFile() override; 28 | 29 | bool read(FieldModelSkeleton &skeleton) const { 30 | QMultiMap rsdFiles; 31 | return read(skeleton, rsdFiles); 32 | } 33 | bool readHeader(int &boneCount) const; 34 | bool read(FieldModelSkeleton &skeleton, QMultiMap &rsdFiles) const; 35 | bool write(const FieldModelSkeleton &skeleton) const; 36 | }; 37 | -------------------------------------------------------------------------------- /src/core/field/FieldModelTextureRefPC.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | #include "FieldModelTextureRef.h" 22 | 23 | class FieldModelTextureRefPC : public FieldModelTextureRef 24 | { 25 | public: 26 | explicit FieldModelTextureRefPC(quint32 id) : _id(id) {} 27 | virtual ~FieldModelTextureRefPC() override; 28 | 29 | inline quint32 id() const { 30 | return _id; 31 | } 32 | 33 | inline void setId(quint32 id) { 34 | _id = id; 35 | } 36 | 37 | inline quint64 textureIdentifier() const override { 38 | return id(); 39 | } 40 | private: 41 | quint32 _id; 42 | }; 43 | -------------------------------------------------------------------------------- /src/widgets/FontManager.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | #include "FontWidget.h" 22 | 23 | class FontManager : public QDialog 24 | { 25 | Q_OBJECT 26 | public: 27 | explicit FontManager(QWidget *parent = nullptr); 28 | private slots: 29 | void setFont(int id); 30 | void addFont(); 31 | void removeFont(); 32 | private: 33 | void fillList1(); 34 | bool newNameDialog(QString &name, QString &nameId); 35 | QToolBar *toolbar1; 36 | QAction *plusAction, *minusAction; 37 | QListWidget *list1; 38 | FontWidget *fontWidget; 39 | }; 40 | -------------------------------------------------------------------------------- /src/widgets/ScriptList.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | #include "core/field/GrpScript.h" 22 | 23 | class ScriptList : public QListWidget 24 | { 25 | Q_OBJECT 26 | public: 27 | explicit ScriptList(QWidget *parent = nullptr); 28 | 29 | Script *currentScript(); 30 | int selectedID(); 31 | 32 | void fill(GrpScript *grpScript); 33 | void clear(); 34 | void localeRefresh(); 35 | void scroll(int, bool focus = true); 36 | 37 | private slots: 38 | void evidence(QListWidgetItem *current, QListWidgetItem *previous); 39 | 40 | private: 41 | GrpScript *_grpScript; 42 | }; 43 | -------------------------------------------------------------------------------- /src/core/field/AFile.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | #include "FieldModelAnimation.h" 22 | 23 | struct AHeader { 24 | quint32 version; 25 | quint32 framesCount; 26 | quint32 boneCount; 27 | quint8 rotationOrder[3]; 28 | quint8 unused; 29 | quint32 runtimeData[5]; 30 | }; 31 | 32 | class AFile : public IO 33 | { 34 | public: 35 | explicit AFile(QIODevice *device); 36 | virtual ~AFile() override; 37 | 38 | bool readHeader(AHeader &header) const; 39 | bool read(FieldModelAnimation &animation, int maxFrames = -1) const; 40 | bool write(const FieldModelAnimation &animation) const; 41 | }; 42 | -------------------------------------------------------------------------------- /src/core/field/RsdFile.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | #include 22 | 23 | class Rsd { 24 | friend class RsdFile; 25 | QString pName; 26 | QList texIds; 27 | public: 28 | inline const QString &pFile() const { 29 | return pName; 30 | } 31 | inline const QList &textureIds() const { 32 | return texIds; 33 | } 34 | }; 35 | 36 | class RsdFile : public IO 37 | { 38 | public: 39 | explicit RsdFile(QIODevice *io); 40 | virtual ~RsdFile() override; 41 | 42 | bool read(Rsd &rsd, QStringList &textureNames) const; 43 | bool write(const Rsd &rsd, const QStringList &textureNames) const; 44 | }; 45 | -------------------------------------------------------------------------------- /src/widgets/PsfDialog.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | #include 22 | 23 | class PsfDialog : public QDialog 24 | { 25 | Q_OBJECT 26 | public: 27 | explicit PsfDialog(const QString &title, QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 28 | PsfDialog(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()) : 29 | PsfDialog(QString(), parent, f) {} 30 | PsfTags tags() const; 31 | void setNoTitle(bool noTitle); 32 | private: 33 | QLineEdit *_psflib, *_title, *_artist, *_game, *_year, *_genre; 34 | QLineEdit *_copyright, *_author; 35 | QTextEdit *_comment; 36 | }; 37 | -------------------------------------------------------------------------------- /src/core/field/FieldIO.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | 22 | class Field; 23 | 24 | class FieldSaveIO : public QIODevice 25 | { 26 | Q_OBJECT 27 | public: 28 | FieldSaveIO(Field *field, QObject *parent = nullptr); 29 | virtual bool open(OpenMode mode) override; 30 | virtual void close() override; 31 | virtual qint64 size() const override; 32 | protected: 33 | virtual qint64 readData(char *data, qint64 maxSize) override; 34 | private: 35 | qint64 writeData(const char *, qint64) override { return -1; } 36 | bool setCache(); 37 | Field *_field; 38 | QByteArray _cache; 39 | }; 40 | -------------------------------------------------------------------------------- /src/widgets/FormatSelectionWidget.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | 22 | class FormatSelectionWidget : public QGroupBox 23 | { 24 | Q_OBJECT 25 | public: 26 | FormatSelectionWidget(const QString &text, const QStringList &formats, QWidget *parent = nullptr); 27 | const QString ¤tFormat() const; 28 | void setCurrentFormat(const QString &extension); 29 | void setFormats(const QStringList &formats); 30 | QStringList formats() const; 31 | private: 32 | static QString splitFormatString(const QString &format, QString &extension); 33 | QComboBox *format; 34 | QStringList extensions; 35 | }; 36 | -------------------------------------------------------------------------------- /src/core/CsvFile.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2025 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | 22 | class CsvFile 23 | { 24 | public: 25 | enum CsvEncoding { 26 | Utf8 27 | }; 28 | explicit CsvFile(QIODevice *io, const QChar &fieldSeparator = QChar(','), const QChar "eCharacter = QChar('"'), 29 | CsvEncoding encoding = Utf8); 30 | bool readLine(QStringList &line); 31 | bool writeLine(const QStringList &line); 32 | private: 33 | enum State { 34 | Start, 35 | End, 36 | NextField, 37 | FieldQuoted, 38 | FieldQuotedEscape, 39 | FieldUnquoted 40 | }; 41 | QIODevice *_io; 42 | QChar _fieldSeparator, _quoteCharacter; 43 | CsvEncoding _encoding; 44 | }; 45 | -------------------------------------------------------------------------------- /src/core/field/BackgroundTilesFile.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | #include "FieldPart.h" 22 | #include "BackgroundTiles.h" 23 | 24 | // This class is only used for repairing PC backgrounds 25 | class BackgroundTilesFile : public FieldPart 26 | { 27 | public: 28 | explicit BackgroundTilesFile(Field *field); 29 | virtual ~BackgroundTilesFile() override; 30 | 31 | bool open() override; 32 | bool open(const QByteArray &data) override; 33 | QByteArray save() const override; 34 | void clear() override; 35 | 36 | inline const BackgroundTiles &tiles() const { 37 | return _tiles; 38 | } 39 | 40 | private: 41 | BackgroundTiles _tiles; 42 | }; 43 | -------------------------------------------------------------------------------- /src/widgets/EncounterWidget.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | #include 22 | #include "core/field/EncounterFile.h" 23 | 24 | class EncounterWidget : public QDialog 25 | { 26 | Q_OBJECT 27 | public: 28 | explicit EncounterWidget(EncounterFile *data, QWidget *parent = nullptr); 29 | private: 30 | void fillGroup(EncounterTableWidget *group, const EncounterTable &encounterTable); 31 | EncounterTable saveGroup(EncounterTableWidget *group, EncounterTable encounterTable); 32 | EncounterFile *data; 33 | EncounterTableWidget *group1, *group2; 34 | protected: 35 | void accept() override; 36 | }; 37 | -------------------------------------------------------------------------------- /src/core/field/MapList.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | 22 | class MapList 23 | { 24 | public: 25 | MapList(); 26 | bool open(const QByteArray &data); 27 | bool save(QByteArray &data) const; 28 | void clear(); 29 | void addMap(const QString &name); 30 | bool renameMap(const QString &oldName, const QString &newName); 31 | bool softDeleteMap(const QString &name); 32 | inline const QStringList &mapNames() const { 33 | return _mapNames; 34 | } 35 | inline bool isModified() const { 36 | return _modified; 37 | } 38 | inline void setSaved() { 39 | _modified = false; 40 | } 41 | private: 42 | QStringList _mapNames; 43 | bool _modified; 44 | }; 45 | -------------------------------------------------------------------------------- /icons/common/multicolorblock.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/widgets/EmptyFieldWidget.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #include "EmptyFieldWidget.h" 19 | 20 | EmptyFieldWidget::EmptyFieldWidget(QWidget *parent) : QWidget(parent) 21 | { 22 | QPushButton *createNewMapButton = new QPushButton("Create new map"); 23 | QPushButton *importMapButton = new QPushButton("Import existing map..."); 24 | 25 | QVBoxLayout *layout = new QVBoxLayout(this); 26 | layout->addStretch(1); 27 | layout->addWidget(createNewMapButton); 28 | layout->addWidget(importMapButton); 29 | layout->addStretch(1); 30 | 31 | connect(createNewMapButton, &QPushButton::clicked, this, &EmptyFieldWidget::createMapClicked); 32 | connect(importMapButton, &QPushButton::clicked, this, &EmptyFieldWidget::importMapClicked); 33 | } 34 | -------------------------------------------------------------------------------- /src/widgets/HelpWidget.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Hyne Final Fantasy VIII Save Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | 22 | class HelpWidget : public QWidget 23 | { 24 | Q_OBJECT 25 | public: 26 | enum IconType { 27 | IconInfo, 28 | IconWarning 29 | }; 30 | 31 | HelpWidget(int iconExtent, const QString &text, IconType icon, QWidget *parent = nullptr); 32 | HelpWidget(int iconExtent, const QString &text, QWidget *parent = nullptr); 33 | HelpWidget(int iconExtent, IconType icon, QWidget *parent = nullptr); 34 | explicit HelpWidget(int iconExtent, QWidget *parent = nullptr); 35 | QString text() const; 36 | void setText(const QString &text); 37 | private: 38 | void createLayout(int iconExtent, const QString &text, IconType icon = IconInfo); 39 | QLabel *textLabel; 40 | }; 41 | -------------------------------------------------------------------------------- /src/widgets/ScriptEditorWidgets/ScriptEditorModelPage.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include "ScriptEditorView.h" 21 | #include "widgets/VertexWidget.h" 22 | #include "3d/FieldModel.h" 23 | 24 | class Field; 25 | 26 | class ScriptEditorModelPage : public ScriptEditorView 27 | { 28 | Q_OBJECT 29 | public: 30 | ScriptEditorModelPage(Field *field, const Section1File *scriptsAndTexts, const GrpScript &grpScript, const Script &script, int opcodeID, QWidget *parent = nullptr); 31 | Opcode buildOpcode() override; 32 | void setOpcode(const Opcode &opcode) override; 33 | private slots: 34 | void updatePreview(); 35 | private: 36 | void build() override; 37 | QComboBox *_models; 38 | FieldModel *_modelPreview; 39 | Field *_field; 40 | }; 41 | -------------------------------------------------------------------------------- /src/widgets/ScriptEditorWidgets/ScriptEditorMoviePage.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | #include "ScriptEditorView.h" 22 | 23 | class ScriptEditorMoviePage : public ScriptEditorView 24 | { 25 | Q_OBJECT 26 | public: 27 | ScriptEditorMoviePage(const Section1File *scriptsAndTexts, const GrpScript &grpScript, const Script &script, int opcodeID, QWidget *parent = nullptr); 28 | Opcode buildOpcode() override; 29 | void setOpcode(const Opcode &opcode) override; 30 | private slots: 31 | void setMovieListItemTexts(int discID); 32 | private: 33 | void build() override; 34 | void buildDiscList(); 35 | void buildMovieList(int discID); 36 | QComboBox *movieList, *discList; 37 | }; 38 | -------------------------------------------------------------------------------- /src/core/field/FieldPart.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | 22 | class Field; 23 | 24 | class FieldPart 25 | { 26 | public: 27 | explicit FieldPart(Field *field); 28 | virtual ~FieldPart(); 29 | 30 | virtual void initEmpty() {} 31 | virtual bool open()=0; 32 | virtual bool open(const QByteArray &data)=0; 33 | virtual QByteArray save() const=0; 34 | virtual bool canSave() const; 35 | virtual void close(); 36 | virtual void clear()=0; 37 | 38 | bool isOpen() const; 39 | void setOpen(bool open); 40 | virtual bool isModified() const; 41 | void setModified(bool modified); 42 | Field *field() const; 43 | private: 44 | bool modified, opened; 45 | Field *_field; 46 | }; 47 | -------------------------------------------------------------------------------- /src/core/field/TdbFile.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | #include 22 | 23 | struct TdbHeader { 24 | quint32 size; 25 | quint16 imageCount; 26 | quint16 paletteCount; 27 | quint32 imageOffset; 28 | quint32 paletteOffset; 29 | }; 30 | 31 | class TdbFile 32 | { 33 | public: 34 | enum TextureType { 35 | Eye=0, 36 | EyeClosed1, EyeClosed2, 37 | EyeOpened1, EyeOpened2, 38 | MouthClosed, MouthOpened, 39 | Empty 40 | }; 41 | 42 | TdbFile(); 43 | bool open(const QByteArray &data); 44 | QImage texture(quint8 faceID, TextureType type); 45 | private: 46 | static int faceIdToImageId(quint8 faceID, TextureType type); 47 | TdbHeader header; 48 | QByteArray data; 49 | }; 50 | -------------------------------------------------------------------------------- /src/widgets/ScriptEditorWidgets/ScriptEditorWalkmeshPage.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include "ScriptEditorView.h" 21 | #include "widgets/VertexWidget.h" 22 | #include "3d/WalkmeshWidget.h" 23 | 24 | class Field; 25 | 26 | class ScriptEditorWalkmeshPage : public ScriptEditorView 27 | { 28 | Q_OBJECT 29 | public: 30 | ScriptEditorWalkmeshPage(Field *field, const Section1File *scriptsAndTexts, const GrpScript &grpScript, const Script &script, int opcodeID, QWidget *parent = nullptr); 31 | Opcode buildOpcode() override; 32 | void setOpcode(const Opcode &opcode) override; 33 | private slots: 34 | void updatePreview(); 35 | private: 36 | void build() override; 37 | VertexWidget *_point1, *_point2; 38 | WalkmeshWidget *_previewWalkmesh; 39 | Field *_field; 40 | }; 41 | -------------------------------------------------------------------------------- /src/core/field/BcxFile.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Néo-Midgar Final Fantasy VII French Retranslation 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #include "BcxFile.h" 19 | 20 | BcxFile::BcxFile(QIODevice *io) : 21 | BsxFile(io) 22 | { 23 | } 24 | 25 | BcxFile::~BcxFile() 26 | { 27 | } 28 | 29 | bool BcxFile::read(FieldModelFilePS &model) 30 | { 31 | if (!readHeader()) { 32 | return false; 33 | } 34 | 35 | if (!seekModels()) { 36 | return false; 37 | } 38 | 39 | BcxModelHeader modelHeader; 40 | 41 | if (sizeof(BcxModelHeader) != device()->read((char *)&modelHeader, sizeof(BcxModelHeader))) { 42 | return false; 43 | } 44 | 45 | return readModel(modelHeader.numBones, 46 | modelHeader.numParts, 47 | modelHeader.numAnimations, 48 | &model); 49 | } 50 | 51 | bool BcxFile::write(const FieldModelFilePS &model) 52 | { 53 | Q_UNUSED(model) 54 | return false; 55 | } 56 | -------------------------------------------------------------------------------- /src/core/field/FieldArchivePS.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #include "FieldArchivePS.h" 19 | 20 | FieldArchivePS::FieldArchivePS() : 21 | FieldArchive() 22 | { 23 | } 24 | 25 | FieldArchivePS::FieldArchivePS(const QString &path, FieldArchiveIO::Type type) : 26 | FieldArchive() 27 | { 28 | switch (type) { 29 | case FieldArchiveIO::Dir: 30 | setIO(new FieldArchiveIOPSDir(path, this)); 31 | break; 32 | case FieldArchiveIO::Iso: 33 | setIO(new FieldArchiveIOPSIso(path, this)); 34 | break; 35 | case FieldArchiveIO::File: 36 | setIO(new FieldArchiveIOPSFile(path, this)); 37 | break; 38 | default: 39 | break; 40 | } 41 | } 42 | 43 | FieldArchiveIOPS *FieldArchivePS::io() const 44 | { 45 | return static_cast(FieldArchive::io()); 46 | } 47 | -------------------------------------------------------------------------------- /src/widgets/PreviewBG.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | 22 | class Field; 23 | 24 | class PreviewBG : public QLabel 25 | { 26 | Q_OBJECT 27 | public: 28 | explicit PreviewBG(QWidget *parent = nullptr); 29 | void fill(Field *field, bool reload = false); 30 | void clear(); 31 | inline QSize minimumSizeHint() const override { 32 | return QSize(100, 100); 33 | } 34 | inline QSize sizeHint() const override { 35 | return QSize(300, 225); 36 | } 37 | signals: 38 | void clicked(); 39 | public slots: 40 | void drawBackground(); 41 | private: 42 | static QPixmap errorPixmap(const QSize &size); 43 | Field *_field; 44 | QPixmap _background; 45 | QSize _backgroundSize; 46 | bool _error; 47 | protected: 48 | void mouseReleaseEvent(QMouseEvent *e) override; 49 | void resizeEvent(QResizeEvent *e) override; 50 | }; 51 | -------------------------------------------------------------------------------- /src/core/field/FieldPart.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #include "FieldPart.h" 19 | 20 | FieldPart::FieldPart(Field *field) : 21 | modified(false), opened(false), _field(field) 22 | { 23 | } 24 | 25 | FieldPart::~FieldPart() 26 | { 27 | } 28 | 29 | bool FieldPart::isOpen() const 30 | { 31 | return opened; 32 | } 33 | 34 | bool FieldPart::isModified() const 35 | { 36 | return modified; 37 | } 38 | 39 | void FieldPart::setModified(bool modified) 40 | { 41 | this->modified = modified; 42 | } 43 | 44 | void FieldPart::setOpen(bool open) 45 | { 46 | opened = open; 47 | } 48 | 49 | Field *FieldPart::field() const 50 | { 51 | return _field; 52 | } 53 | 54 | bool FieldPart::canSave() const 55 | { 56 | return true; 57 | } 58 | 59 | void FieldPart::close() 60 | { 61 | clear(); 62 | setOpen(false); 63 | } 64 | -------------------------------------------------------------------------------- /src/core/field/BackgroundFilePS.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include "BackgroundFile.h" 21 | #include "BackgroundTextures.h" 22 | 23 | class FieldPS; 24 | class FieldPC; 25 | class BackgroundFilePC; 26 | 27 | class BackgroundFilePS : public BackgroundFile 28 | { 29 | public: 30 | explicit BackgroundFilePS(FieldPS *field); 31 | BackgroundFilePS(const BackgroundFilePS &other); 32 | 33 | void initEmpty() override; 34 | bool open() override; 35 | bool open(const QByteArray &mimData, const QByteArray &tilesData); 36 | QByteArray save() const override; 37 | inline virtual BackgroundTexturesPS *textures() const override { 38 | return static_cast(BackgroundFile::textures()); 39 | } 40 | BackgroundFilePC toPC(FieldPC *field) const; 41 | private: 42 | using BackgroundFile::open; 43 | }; 44 | -------------------------------------------------------------------------------- /src/FieldModelThread.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | #include "core/field/Field.h" 22 | 23 | class FieldModelThread : public QThread 24 | { 25 | Q_OBJECT 26 | public: 27 | explicit FieldModelThread(QObject *parent = nullptr); 28 | virtual ~FieldModelThread() override; 29 | void setField(Field *field); 30 | void setModel(int modelId, int animationId = 0, bool animate = true); 31 | void setModels(const QList &modelIds, bool animate = true); 32 | void cancel(); 33 | signals: 34 | void modelLoaded(Field *field, FieldModelFile *model, int modelId, int animationId, bool isAnimated); 35 | protected: 36 | void run() override; 37 | private: 38 | bool _canceled; 39 | QMutex mutex; 40 | static QMutex *mutexField; 41 | Field *_field; 42 | QList _modelIds; 43 | int _animationId; 44 | bool _animate; 45 | }; 46 | -------------------------------------------------------------------------------- /src/widgets/EncounterTableWidget.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | 22 | class EncounterTableWidget : public QGroupBox 23 | { 24 | Q_OBJECT 25 | public: 26 | explicit EncounterTableWidget(const QString &title, QWidget *parent = nullptr); 27 | QList battleIdsValues(); 28 | QList battleProbasValues(); 29 | int rateValue(); 30 | void setBattleIdsValues(const QList &ids); 31 | void setBattleProbasValues(const QList &probas); 32 | void setRateValue(int value); 33 | public slots: 34 | void changePercent(); 35 | void changeProbaCount(); 36 | private: 37 | static void setProbaLabelColor(QLabel *label, qint16 points); 38 | QLabel *rateLabel, *probaLabel, *probaLabel2; 39 | QSlider *mainRate; 40 | QGroupBox *group; 41 | QList battleIds; 42 | QList battleProbas; 43 | }; 44 | -------------------------------------------------------------------------------- /src/widgets/QColorPicker.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class QColorShowLabel : public QFrame 6 | { 7 | Q_OBJECT 8 | public: 9 | QColorShowLabel(QWidget *parent = nullptr); 10 | inline const QColor &color() const { 11 | return col; 12 | } 13 | void setColor(QColor c); 14 | signals: 15 | void clicked(); 16 | protected: 17 | void paintEvent(QPaintEvent *event) override; 18 | void mousePressEvent(QMouseEvent *event) override; 19 | private: 20 | QColor col; 21 | }; 22 | 23 | class QColorLuminancePicker : public QWidget 24 | { 25 | Q_OBJECT 26 | public: 27 | QColorLuminancePicker(QWidget *parent = nullptr); 28 | ~QColorLuminancePicker(); 29 | public slots: 30 | void setCol(int h, int s, int v); 31 | void setCol(int h, int s); 32 | signals: 33 | void newHsv(int h, int s, int v); 34 | protected: 35 | void paintEvent(QPaintEvent *event); 36 | void mouseMoveEvent(QMouseEvent *event); 37 | void mousePressEvent(QMouseEvent *event); 38 | private: 39 | enum { foff = 3, coff = 4 }; // frame and contents offset 40 | int val; 41 | int hue; 42 | int sat; 43 | int y2val(int y); 44 | int val2y(int val); 45 | void setVal(int v); 46 | QPixmap *pix; 47 | }; 48 | 49 | class QColorPicker : public QFrame 50 | { 51 | Q_OBJECT 52 | public: 53 | QColorPicker(QWidget *parent = nullptr); 54 | ~QColorPicker(); 55 | public slots: 56 | void setCol(int h, int s); 57 | signals: 58 | void newCol(int h, int s); 59 | protected: 60 | QSize sizeHint() const; 61 | void paintEvent(QPaintEvent *event); 62 | void mouseMoveEvent(QMouseEvent *event); 63 | void mousePressEvent(QMouseEvent *event); 64 | void resizeEvent(QResizeEvent *event); 65 | private: 66 | int hue; 67 | int sat; 68 | QPoint colPt(); 69 | int huePt(const QPoint &pt); 70 | int satPt(const QPoint &pt); 71 | void setCol(const QPoint &pt); 72 | QPixmap pix; 73 | QList _colors; 74 | }; 75 | -------------------------------------------------------------------------------- /src/widgets/ImportDialog.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | #include "core/field/Field.h" 22 | 23 | class ImportDialog : public QDialog 24 | { 25 | Q_OBJECT 26 | public: 27 | explicit ImportDialog(bool sourceSameTypeAsTarget, bool isDat, const QString &path, QWidget *parent = nullptr); 28 | Field::FieldSections parts() const; 29 | bool isCompressed() const; 30 | QString bsxPath() const; 31 | QString mimPath() const; 32 | private slots: 33 | void setBsxPathByUser(); 34 | void setMimPathByUser(); 35 | private: 36 | QCheckBox *scripts; 37 | QCheckBox *akaos; 38 | QCheckBox *ca; 39 | QCheckBox *id; 40 | QCheckBox *encounter; 41 | QCheckBox *inf; 42 | QCheckBox *model; 43 | QCheckBox *mim; 44 | QWidget *pathWidgetMim, *pathWidgetBsx; 45 | QLineEdit *pathEditMim, *pathEditBsx; 46 | QCheckBox *notCompressed; 47 | }; 48 | -------------------------------------------------------------------------------- /src/core/field/BcxFile.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Néo-Midgar Final Fantasy VII French Retranslation 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | #include 22 | #include "BsxFile.h" 23 | 24 | struct BcxModelHeader { 25 | quint16 unknown; // always 0xff01 26 | quint8 numBones; 27 | quint8 numParts; 28 | quint8 numAnimations; 29 | quint8 blank1[17]; 30 | quint16 scale; 31 | quint16 offsetParts; // relative to the end of this structure 32 | quint16 offsetAnimations; // relative to the end of this structure 33 | quint32 offsetSkeleton; // offset to skeleton data, substract by 0x80000000 to obtain the right offset 34 | quint32 blank2; 35 | }; 36 | 37 | class BcxFile : public BsxFile 38 | { 39 | public: 40 | explicit BcxFile(QIODevice *io); 41 | virtual ~BcxFile() override; 42 | 43 | bool read(FieldModelFilePS &model); 44 | bool write(const FieldModelFilePS &model); 45 | private: 46 | using BsxFile::read; 47 | using BsxFile::write; 48 | }; 49 | -------------------------------------------------------------------------------- /src/core/SystemColor.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | 19 | #include "SystemColor.h" 20 | #include "Config.h" 21 | 22 | #ifndef Q_OS_MAC 23 | 24 | #define systemColor(dark, light) \ 25 | return Config::inDarkMode() ? dark : light; 26 | 27 | QColor SystemColor::red() 28 | { 29 | systemColor(qRgb(0xF0, 0x90, 0x90), qRgb(0xb0, 0x18, 0x18)) 30 | } 31 | 32 | QColor SystemColor::blue() 33 | { 34 | systemColor(qRgb(0x5E, 0xAF, 0xFF), qRgb(0x00, 0x57, 0xAF)) 35 | } 36 | 37 | QColor SystemColor::green() 38 | { 39 | systemColor(qRgb(0x00, 0xc6, 0x00), qRgb(0x00, 0x68, 0x00)) 40 | } 41 | 42 | QColor SystemColor::orange() 43 | { 44 | systemColor(qRgb(0xFF, 0x8D, 0x1A), qRgb(0x8C, 0x46, 0x00)) 45 | } 46 | 47 | QColor SystemColor::purple() 48 | { 49 | systemColor(qRgb(0xC9, 0x92, 0xFF), qRgb(0x66, 0x00, 0xCC)) 50 | } 51 | 52 | QColor SystemColor::grey() 53 | { 54 | systemColor(qRgb(0xCC, 0xCC, 0xCC), qRgb(0x59, 0x59, 0x59)) 55 | } 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /src/core/field/BackgroundTilesFile.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #include "BackgroundTilesFile.h" 19 | #include "BackgroundTilesIO.h" 20 | #include "Field.h" 21 | 22 | BackgroundTilesFile::BackgroundTilesFile(Field *field) : 23 | FieldPart(field) 24 | { 25 | } 26 | 27 | BackgroundTilesFile::~BackgroundTilesFile() 28 | { 29 | } 30 | 31 | bool BackgroundTilesFile::open() 32 | { 33 | return open(field()->sectionData(Field::Tiles)); 34 | } 35 | 36 | bool BackgroundTilesFile::open(const QByteArray &data) 37 | { 38 | QBuffer buffer; 39 | buffer.setData(data); 40 | 41 | if (BackgroundTilesIOPS(&buffer).read(_tiles)) { 42 | setOpen(true); 43 | 44 | return true; 45 | } 46 | 47 | return false; 48 | } 49 | 50 | QByteArray BackgroundTilesFile::save() const 51 | { 52 | QBuffer buffer; 53 | 54 | BackgroundTilesIOPS(&buffer).write(_tiles); 55 | 56 | return buffer.data(); 57 | } 58 | 59 | void BackgroundTilesFile::clear() 60 | { 61 | _tiles.clear(); 62 | } 63 | -------------------------------------------------------------------------------- /src/widgets/VertexWidget.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | #include "core/field/CaFile.h" 22 | 23 | class VertexWidget : public QWidget 24 | { 25 | Q_OBJECT 26 | public: 27 | explicit VertexWidget(QWidget *parent); 28 | VertexWidget(const QString &xLabel=QString(), 29 | const QString &yLabel=QString(), 30 | const QString &zLabel=QString(), 31 | QWidget *parent = nullptr); 32 | Vertex_s values() const; 33 | void setValues(const Vertex_s &v); 34 | bool isReadOnly() const; 35 | void setReadOnly(bool ro); 36 | private slots: 37 | void emitValuesChanged(); 38 | signals: 39 | void valuesChanged(const Vertex_s &v); 40 | private: 41 | void build(const QString &xLabel = QString(), 42 | const QString &yLabel = QString(), 43 | const QString &zLabel = QString()); 44 | QSpinBox *x, *y, *z; 45 | bool dontEmit; 46 | }; 47 | -------------------------------------------------------------------------------- /src/widgets/OperationsManager.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | 22 | class OperationsManager : public QDialog 23 | { 24 | Q_OBJECT 25 | public: 26 | enum Operation { 27 | CleanUnusedTexts = 0x01, 28 | RemoveTexts = 0x02, 29 | RemoveBattles = 0x04, 30 | CleanModelLoaderPC = 0x08, 31 | RemoveUnusedSectionPC = 0x10, 32 | RepairBackgroundsPC = 0x20, 33 | AutosizeTextWindows = 0x40, 34 | ResizeBackgrounds = 0x80 35 | }; 36 | Q_DECLARE_FLAGS(Operations, Operation) 37 | 38 | explicit OperationsManager(bool isPC, QWidget *parent = nullptr); 39 | Operations selectedOperations() const; 40 | private slots: 41 | void updateApplyButton(); 42 | private: 43 | void addOperation(Operation op, const QString &description); 44 | QMap _operations; 45 | QAbstractButton *applyButton; 46 | }; 47 | 48 | Q_DECLARE_OPERATORS_FOR_FLAGS(OperationsManager::Operations) 49 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | AccessModifierOffset: -4 2 | AlignAfterOpenBracket: Align 3 | AlignConsecutiveAssignments: false 4 | AlignConsecutiveDeclarations: false 5 | AlignEscapedNewlinesLeft: false 6 | AlignOperands: true 7 | AlignTrailingComments: false 8 | AllowAllParametersOfDeclarationOnNextLine: true 9 | AllowShortBlocksOnASingleLine: false 10 | AllowShortCaseLabelsOnASingleLine: false 11 | AllowShortFunctionsOnASingleLine: false 12 | AllowShortIfStatementsOnASingleLine: false 13 | AllowShortLoopsOnASingleLine: false 14 | AlwaysBreakAfterReturnType: None 15 | AlwaysBreakBeforeMultilineStrings: false 16 | AlwaysBreakTemplateDeclarations: false 17 | BinPackArguments: true 18 | BinPackParameters: true 19 | BreakBeforeBinaryOperators: NonAssignment 20 | BreakBeforeBraces: Linux 21 | BreakBeforeTernaryOperators: true 22 | BreakConstructorInitializersBeforeComma: false 23 | ColumnLimit: 80 24 | ConstructorInitializerAllOnOneLineOrOnePerLine: false 25 | ConstructorInitializerIndentWidth: 4 26 | ContinuationIndentWidth: 4 27 | Cpp11BracedListStyle: false 28 | DerivePointerAlignment: false 29 | DisableFormat: false 30 | ForEachMacros: ['foreach'] 31 | IncludeCategories: 32 | - Regex: '^<' 33 | Priority: 2 34 | - Regex: '.\*' 35 | Priority: 1 36 | IndentCaseLabels: false 37 | IndentWidth: 4 38 | IndentWrappedFunctionNames: false 39 | KeepEmptyLinesAtTheStartOfBlocks: false 40 | Language: Cpp 41 | MaxEmptyLinesToKeep: 1 42 | NamespaceIndentation: All 43 | PointerAlignment: Right 44 | ReflowComments: true 45 | SortIncludes: false 46 | SpaceAfterCStyleCast: false 47 | SpaceBeforeAssignmentOperators: true 48 | SpaceBeforeParens: ControlStatements 49 | SpaceInEmptyParentheses: false 50 | SpacesBeforeTrailingComments: 1 51 | SpacesInAngles: false 52 | SpacesInCStyleCastParentheses: false 53 | SpacesInContainerLiterals: false 54 | SpacesInParentheses: false 55 | SpacesInSquareBrackets: false 56 | Standard: Cpp11 57 | TabWidth: 4 58 | UseTab: ForIndentation 59 | -------------------------------------------------------------------------------- /src/CLI.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2021 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | #include 22 | 23 | class FieldArchive; 24 | 25 | struct CLIObserver : public ArchiveObserver 26 | { 27 | CLIObserver() {} 28 | inline void setFilename(const QString &filename) { 29 | _filename = filename; 30 | } 31 | inline bool observerWasCanceled() const { 32 | return false; 33 | } 34 | inline void setObserverMaximum(unsigned int max) { 35 | _maximum = max; 36 | } 37 | virtual void setObserverValue(int value); 38 | virtual bool observerRetry(const QString &message); 39 | private: 40 | void setPercent(quint8 percent); 41 | qint64 _maximum; 42 | quint8 _lastPercent; 43 | QString _filename; 44 | }; 45 | 46 | class CLI 47 | { 48 | public: 49 | static void exec(); 50 | private: 51 | static void commandExport(); 52 | static void commandPatch(); 53 | static void commandTools(); 54 | static FieldArchive *openFieldArchive(const QString &ext, const QString &path); 55 | static CLIObserver observer; 56 | }; 57 | -------------------------------------------------------------------------------- /src/core/field/CaFile.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | #include "FieldPart.h" 22 | 23 | struct Vertex_s { 24 | qint16 x, y, z; 25 | }; 26 | 27 | struct Camera { 28 | Vertex_s camera_axis[3]; 29 | qint16 camera_axis2z; // copy (padding) 30 | qint32 camera_position[3]; 31 | qint32 blank; 32 | quint16 camera_zoom; 33 | quint16 unknown; // seems to be undefined 34 | }; 35 | 36 | class CaFile : public FieldPart 37 | { 38 | public: 39 | explicit CaFile(Field *field); 40 | void initEmpty() override; 41 | bool open() override; 42 | bool open(const QByteArray &data) override; 43 | QByteArray save() const override; 44 | void clear() override; 45 | bool hasCamera() const; 46 | qsizetype cameraCount() const; 47 | const Camera &camera(int camID) const; 48 | void setCamera(int camID, const Camera &cam); 49 | void insertCamera(int camID, const Camera &cam); 50 | bool removeCamera(int camID); 51 | private: 52 | QList cameras; 53 | }; 54 | -------------------------------------------------------------------------------- /src/widgets/ArchivePreview.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Deling Final Fantasy VIII Field Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | #include "PreviewBGLabel.h" 22 | #include "3d/FieldModel.h" 23 | 24 | class ArchivePreview : public QStackedWidget 25 | { 26 | Q_OBJECT 27 | public: 28 | enum Pages { EmptyPage = 0, ImagePage, TextPage, ModelPage }; 29 | explicit ArchivePreview(QWidget *parent = nullptr); 30 | void clearPreview(); 31 | void imagePreview(const QPixmap &image, const QString &name = QString(), 32 | int palID = 0, int palCount = 0, int imageID = 0, 33 | int imageCount = 0); 34 | void textPreview(const QString &text); 35 | void modelPreview(FieldModelFile *fieldModel); 36 | signals: 37 | void currentImageChanged(int); 38 | void currentPaletteChanged(int); 39 | public slots: 40 | void saveImage(); 41 | private: 42 | QWidget *imageWidget(); 43 | QWidget *textWidget(); 44 | QWidget *modelWidget(); 45 | QScrollArea *scrollArea; 46 | QComboBox *imageSelect, *palSelect; 47 | PreviewBGLabel *_lbl; 48 | QString _name; 49 | }; 50 | -------------------------------------------------------------------------------- /src/widgets/FontGrid.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | #include "FontDisplay.h" 22 | 23 | class FontGrid : public FontDisplay 24 | { 25 | Q_OBJECT 26 | public: 27 | explicit FontGrid(int letterCountH, int letterCountV, QWidget *parent = nullptr); 28 | virtual ~FontGrid() override; 29 | QPoint getPos(int letter); 30 | signals: 31 | void letterClicked(int letter); 32 | public slots: 33 | void updateLetter(const QRect &rect); 34 | protected: 35 | virtual QSize sizeHint() const override; 36 | virtual QSize minimumSizeHint() const override; 37 | virtual void mousePressEvent(QMouseEvent * e) override; 38 | virtual void keyPressEvent(QKeyEvent *e) override; 39 | virtual void paintEvent(QPaintEvent *e) override; 40 | virtual void focusInEvent(QFocusEvent *) override; 41 | virtual void focusOutEvent(QFocusEvent *) override; 42 | private: 43 | int getLetter(const QPoint &pos); 44 | //QPixmap copyGrid; 45 | int _letterCountH, _letterCountV; 46 | }; 47 | -------------------------------------------------------------------------------- /src/core/field/FieldPSDemo.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | #include "FieldPS.h" 22 | 23 | class FieldPSDemo : public FieldPS 24 | { 25 | public: 26 | FieldPSDemo(const QString &name, FieldArchiveIO *io); 27 | explicit FieldPSDemo(const Field &field); 28 | 29 | protected: 30 | inline int headerSize() const override { return 0; } 31 | void openHeader(const QByteArray &fileData) override; 32 | FieldPart *createPart(FieldSection part) override; 33 | int sectionId(FieldSection part) const override; 34 | QString sectionFile(FieldSection part) const override; 35 | quint32 sectionPosition(int idPart) const override; 36 | inline int sectionCount() const override { return 0; } 37 | inline int paddingBetweenSections() const override { return 0; } 38 | inline int alignment() const override { return 0; } 39 | QList orderOfSections() const override; 40 | inline qint32 diffSectionPos() const override { return 0; } 41 | inline bool hasSectionHeader() const override { return false; } 42 | }; 43 | -------------------------------------------------------------------------------- /src/widgets/MassImportDialog.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | #include "core/field/FieldArchive.h" 22 | #include "FormatSelectionWidget.h" 23 | 24 | class MassImportDialog : public QDialog 25 | { 26 | Q_OBJECT 27 | public: 28 | enum ImportType { 29 | Fields, Akaos, Texts 30 | }; 31 | 32 | explicit MassImportDialog(QWidget *parent = nullptr); 33 | void fill(const FieldArchive *fieldArchive, int currentMapId); 34 | QList selectedFields() const; 35 | bool importModule(ImportType type) const; 36 | const QString &moduleFormat(ImportType type) const; 37 | QString directory() const; 38 | private slots: 39 | void chooseImportDirectory(); 40 | void selectCurrentField(); 41 | private: 42 | QListWidget *fieldList; 43 | QMap imports; 44 | QLineEdit *dirPath; 45 | QPushButton *changeDir; 46 | 47 | const FieldArchive *_fieldArchive; 48 | int _currentMapId; 49 | protected: 50 | void accept() override; 51 | }; 52 | -------------------------------------------------------------------------------- /src/widgets/FontDisplay.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | #include 22 | 23 | class FontDisplay : public QWidget 24 | { 25 | Q_OBJECT 26 | public: 27 | explicit FontDisplay(QWidget *parent = nullptr); 28 | virtual ~FontDisplay() override; 29 | WindowBinFile *windowBinFile() const; 30 | virtual void setWindowBinFile(WindowBinFile *windowBinFile); 31 | void clear(); 32 | quint8 currentTable() const; 33 | quint8 currentLetter() const; 34 | public slots: 35 | void setCurrentTable(quint8 currentTable); 36 | void setColor(WindowBinFile::FontColor color); 37 | virtual void setLetter(quint8 letter); 38 | protected: 39 | static QPoint getCellPos(const QPoint &pos, const QSize &cellSize); 40 | static int getCell(const QPoint &pos, const QSize &cellSize, int colCount); 41 | WindowBinFile *_windowBinFile; 42 | WindowBinFile::FontColor _color; 43 | quint8 _currentTable, _letter; 44 | private: 45 | static int getLetter(QPoint pos); 46 | static QPoint getPos(int letter); 47 | }; 48 | -------------------------------------------------------------------------------- /src/core/SystemColor.mm: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #include "SystemColor.h" 19 | 20 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 21 | #import 22 | 23 | #define nsToQColor(name) \ 24 | NSColor *color = [NSColor name]; \ 25 | NSColor *tmpColor = [color colorUsingColorSpaceName:NSCalibratedRGBColorSpace]; \ 26 | QColor ret; \ 27 | CGFloat red = 0, green = 0, blue = 0, alpha = 0; \ 28 | [tmpColor getRed:&red green:&green blue:&blue alpha:&alpha]; \ 29 | ret.setRgbF(float(red), float(green), float(blue), float(alpha)); \ 30 | return ret; 31 | 32 | QColor SystemColor::red() 33 | { 34 | nsToQColor(systemRedColor) 35 | } 36 | 37 | QColor SystemColor::blue() 38 | { 39 | nsToQColor(systemBlueColor) 40 | } 41 | 42 | QColor SystemColor::green() 43 | { 44 | nsToQColor(systemGreenColor) 45 | } 46 | 47 | QColor SystemColor::orange() 48 | { 49 | nsToQColor(systemOrangeColor) 50 | } 51 | 52 | QColor SystemColor::purple() 53 | { 54 | nsToQColor(systemPurpleColor) 55 | } 56 | 57 | QColor SystemColor::grey() 58 | { 59 | nsToQColor(systemGrayColor) 60 | } 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /src/core/field/FieldArchivePC.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include "FieldArchive.h" 21 | #include "TutFilePC.h" 22 | #include "FieldArchiveIOPC.h" 23 | #include "FieldPC.h" 24 | 25 | class FieldArchivePC : public FieldArchive 26 | { 27 | public: 28 | FieldArchivePC(); 29 | FieldArchivePC(const QString &path, FieldArchiveIO::Type type); 30 | virtual ~FieldArchivePC() override; 31 | inline bool isPC() const override { return true; } 32 | 33 | void clear() override; 34 | 35 | const FieldPC *field(int id) const; 36 | FieldPC *field(int id, bool open = true, bool dontOptimize = false); 37 | 38 | TutFilePC *tut(const QString &name); 39 | const QMap &tuts() const; 40 | void addTut(const QString &name); 41 | 42 | void setSaved() override; 43 | 44 | FieldArchiveIOPC *io() const override; 45 | 46 | void cleanModelLoader(); 47 | void removeUnusedSections(); 48 | void repairBackgroundsPC(); 49 | void resizeBackgrounds(const QSize &size); 50 | private: 51 | QMap _tuts; 52 | }; 53 | -------------------------------------------------------------------------------- /src/ArgumentsTools.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Copyright (C) 2009-2021 Arzel Jérôme 3 | ** 4 | ** This program is free software: you can redistribute it and/or modify 5 | ** it under the terms of the GNU General Public License as published by 6 | ** the Free Software Foundation, either version 3 of the License, or 7 | ** (at your option) any later version. 8 | ** 9 | ** This program is distributed in the hope that it will be useful, 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | ** GNU General Public License for more details. 13 | ** 14 | ** You should have received a copy of the GNU General Public License 15 | ** along with this program. If not, see . 16 | ****************************************************************************/ 17 | #include "ArgumentsTools.h" 18 | 19 | ArgumentsTools::ArgumentsTools() : CommonArguments() 20 | { 21 | _parser.addPositionalArgument("directory", QCoreApplication::translate("ArgumentsTools", "Input/Output directory.")); 22 | 23 | parse(); 24 | } 25 | 26 | QDir ArgumentsTools::dir() const 27 | { 28 | return QDir(_directory); 29 | } 30 | 31 | void ArgumentsTools::parse() 32 | { 33 | _parser.process(*qApp); 34 | 35 | if (_parser.positionalArguments().size() > 3) { 36 | qWarning() << qPrintable( 37 | QCoreApplication::translate("Arguments", "Error: too much parameters")); 38 | exit(1); 39 | } 40 | 41 | QStringList paths = wilcardParse(); 42 | if (paths.size() == 2) { 43 | // Input/Output directory 44 | if (QDir(paths.last()).exists()) { 45 | _directory = paths.takeLast(); 46 | } else { 47 | qWarning() << qPrintable( 48 | QCoreApplication::translate("Arguments", "Error: directory does not exist:")) 49 | << qPrintable(paths.last()); 50 | exit(1); 51 | } 52 | 53 | if (!paths.isEmpty()) { 54 | _path = paths.first(); 55 | } 56 | } 57 | mapNamesFromFiles(); 58 | } 59 | -------------------------------------------------------------------------------- /src/widgets/ModelManagerPS.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | #include "core/field/FieldPS.h" 22 | #include 23 | #include "ModelManager.h" 24 | 25 | class ModelManagerPS : public ModelManager 26 | { 27 | Q_OBJECT 28 | public: 29 | ModelManagerPS(QWidget *parent = nullptr); 30 | private slots: 31 | void exportAnim(); 32 | protected: 33 | QList modelNames() const override; 34 | QList animItems(int modelID) const override; 35 | FieldModelFile *modelData(QTreeWidgetItem *item) override; 36 | FieldModelLoaderPS *modelLoader() const override; 37 | FieldPS *field() const override; 38 | const QList &lightColors(int modelID) const override; 39 | void setLightColor(int modelID, int id, const FieldModelColorDir &color) override; 40 | QRgb globalColor(int modelID) const override; 41 | void setGlobalColor(int modelID, QRgb color) override; 42 | quint16 modelScale(int modelID) const override; 43 | void setModelScale(int modelID, quint16 scale) override; 44 | }; 45 | -------------------------------------------------------------------------------- /src/core/Clipboard.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | 22 | #define VERSION_FF7_FIELD_SCRIPT_OPCODES 1 23 | #define MIME_FF7_FIELD_SCRIPT_OPCODES "application/x-makoureactor-ff7-field-script-opcodes" 24 | #define VERSION_FF7_FIELD_SCRIPT_GROUPS 1 25 | #define MIME_FF7_FIELD_SCRIPT_GROUPS "application/x-makoureactor-ff7-field-script-groups" 26 | 27 | class Opcode; 28 | class GrpScript; 29 | class QClipboard; 30 | 31 | class Clipboard 32 | { 33 | public: 34 | static Clipboard *instance(); 35 | bool hasFf7FieldScriptOpcodes() const; 36 | QList ff7FieldScriptOpcodes() const; 37 | void setFF7FieldScriptOpcodes(const QList &opcodes); 38 | bool hasFf7FieldScriptGroups() const; 39 | QList ff7FieldScriptGroups() const; 40 | void setFF7FieldScriptGroups(const QList &groups); 41 | private: 42 | Clipboard() {} 43 | static bool hasData(const QString &mimeType); 44 | static QByteArray data(const QString &mimeType); 45 | static void setData(const QString &mimeType, const QByteArray &data); 46 | 47 | static Clipboard *_instance; 48 | 49 | }; 50 | -------------------------------------------------------------------------------- /src/core/field/TutFilePC.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #include "TutFilePC.h" 19 | 20 | TutFilePC::TutFilePC() : 21 | TutFile(nullptr) 22 | { 23 | } 24 | 25 | bool TutFilePC::open() 26 | { 27 | return false; 28 | } 29 | 30 | QList TutFilePC::openPositions(const QByteArray &data) const 31 | { 32 | const char *constData = data.constData(); 33 | QList positions; 34 | quint32 dataSize = quint32(data.size()); 35 | 36 | quint16 posTut; 37 | for (int i = 0; i < 9; ++i) { 38 | memcpy(&posTut, constData + i*2, 2); 39 | if (posTut < 18) { 40 | posTut = 18; 41 | } 42 | positions.append(posTut); 43 | } 44 | 45 | positions.append(dataSize); 46 | 47 | return positions; 48 | } 49 | 50 | QByteArray TutFilePC::save() const 51 | { 52 | quint32 pos; 53 | QByteArray toc, ret; 54 | 55 | for (int i = 0; i < 9; ++i) { 56 | if (i < size()) { 57 | pos = 18 + ret.size(); 58 | ret.append(data(i)); 59 | } else { 60 | pos = 0xffff; 61 | } 62 | toc.append((char *)&pos, 2); 63 | } 64 | 65 | return toc.append(ret); 66 | } 67 | -------------------------------------------------------------------------------- /src/widgets/MassExportDialog.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | #include "core/field/FieldArchive.h" 22 | #include "FormatSelectionWidget.h" 23 | 24 | class MassExportDialog : public QDialog 25 | { 26 | Q_OBJECT 27 | public: 28 | explicit MassExportDialog(QWidget *parent = nullptr); 29 | void fill(const FieldArchive *fieldArchive, int currentMapId); 30 | QList selectedFields() const; 31 | bool exportModule(FieldArchive::ExportType type) const; 32 | const QString &moduleFormat(FieldArchive::ExportType type) const; 33 | QString directory() const; 34 | bool overwrite() const; 35 | private slots: 36 | void chooseExportDirectory(); 37 | void selectCurrentField(); 38 | private: 39 | QListWidget *fieldList; 40 | QMap exports; 41 | QLineEdit *dirPath; 42 | QPushButton *changeDir; 43 | QCheckBox *overwriteIfExists; 44 | QPushButton *exportButton; 45 | 46 | const FieldArchive *_fieldArchive; 47 | int _currentMapId; 48 | protected: 49 | void accept() override; 50 | }; 51 | -------------------------------------------------------------------------------- /src/widgets/PreviewBGLabel.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #include "PreviewBGLabel.h" 19 | 20 | PreviewBGLabel::PreviewBGLabel(QWidget *parent) 21 | : QLabel(parent), _showSave(false) 22 | { 23 | } 24 | 25 | void PreviewBGLabel::paintEvent(QPaintEvent *e) 26 | { 27 | QLabel::paintEvent(e); 28 | 29 | if (isEnabled() && _showSave) { 30 | QPainter painter(this); 31 | painter.drawPixmap(0, 0, QIcon::fromTheme(QStringLiteral("document-save")).pixmap(32)); 32 | painter.end(); 33 | } 34 | } 35 | 36 | void PreviewBGLabel::enterEvent(QEnterEvent *e) 37 | { 38 | QLabel::enterEvent(e); 39 | 40 | _showSave = true; 41 | update(0, 0, 32, 32); 42 | } 43 | 44 | void PreviewBGLabel::leaveEvent(QEvent *e) 45 | { 46 | QLabel::leaveEvent(e); 47 | 48 | _showSave = false; 49 | update(0, 0, 32, 32); 50 | } 51 | 52 | void PreviewBGLabel::mousePressEvent(QMouseEvent *e) 53 | { 54 | QLabel::mousePressEvent(e); 55 | QPointF pos = e->position(); 56 | 57 | if (e->button() == Qt::LeftButton && 58 | pos.x() >= 0.0 && pos.x() < 32.0 && 59 | pos.y() >= 0.0 && pos.y() < 32.0) { 60 | emit saveRequested(); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/core/field/EncounterFile.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | #include "FieldPart.h" 22 | 23 | #define PROBABILITY(x) (x >> 10) 24 | #define BATTLE_ID(x) (x & 0x03FF) 25 | 26 | struct EncounterTable { 27 | quint8 enabled; 28 | quint8 rate; 29 | quint16 enc_standard[6]; // probability(6) | battle_id(10) 30 | quint16 enc_special[4]; // probability(6) | battle_id(10) 31 | quint16 _pad; 32 | }; 33 | 34 | class EncounterFile : public FieldPart 35 | { 36 | public: 37 | enum Table { 38 | Table1 = 0, Table2 = 1 39 | }; 40 | 41 | explicit EncounterFile(Field *field); 42 | void initEmpty() override; 43 | bool open() override; 44 | bool open(const QByteArray &data) override; 45 | QByteArray save() const override; 46 | void clear() override; 47 | const EncounterTable &encounterTable(Table tableID) const; 48 | void setEncounterTable(Table tableID, const EncounterTable &table); 49 | bool isBattleEnabled(Table tableID) const; 50 | void setBattleEnabled(Table tableID, bool enabled); 51 | private: 52 | EncounterTable tables[2]; 53 | }; 54 | -------------------------------------------------------------------------------- /src/core/field/CharArchive.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | 22 | class CharArchive 23 | { 24 | public: 25 | CharArchive(); 26 | explicit CharArchive(Lgp *io); 27 | explicit CharArchive(const QString &filename); 28 | virtual ~CharArchive(); 29 | 30 | static CharArchive *instance(); 31 | 32 | inline bool isOpen() const { 33 | return _io->isOpen(); 34 | } 35 | inline bool open() { 36 | return _io->open(); 37 | } 38 | void close(); 39 | inline QString filename() const { 40 | return _io->fileName(); 41 | } 42 | inline void setFilename(const QString &filename) { 43 | _io->setFileName(filename); 44 | } 45 | QStringList hrcFiles(int boneCount = -1, int partCount = -1); 46 | QStringList aFiles(int boneCount = -1, int frameCount = -1); 47 | QIODevice *fileIO(const QString &filename); 48 | 49 | private: 50 | bool openAnimBoneCount(); 51 | bool openHrcBoneAndPartCount(); 52 | Lgp *_io; 53 | QMultiHash _animBoneAndFrameCount; 54 | QMultiHash _animBoneCount; 55 | QMultiHash _hrcBoneAndPartCount; 56 | bool _delete; 57 | static CharArchive *_instance; 58 | }; 59 | -------------------------------------------------------------------------------- /src/core/field/TutFileStandard.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | #include "TutFile.h" 22 | 23 | class Field; 24 | 25 | class TutFileStandard : public TutFile 26 | { 27 | public: 28 | explicit TutFileStandard(Field *field); 29 | explicit TutFileStandard(const QList &tutos); 30 | using TutFile::open; // open(QByteArray) 31 | bool open() override; 32 | QByteArray save(QByteArray &toc, quint32 firstPos) const; 33 | QByteArray save() const override; 34 | inline int maxTutCount() const override { return 255; } 35 | bool hasTut() const; 36 | bool isTut(qsizetype tutID) const override; 37 | bool isAkao(qsizetype tutID) const; 38 | bool isBroken(int tutID) const override; 39 | bool canBeRepaired(int tutID) const override; 40 | bool repair(int tutID) override; 41 | int akaoID(int tutID) const; 42 | void setAkaoID(int tutID, quint16 akaoID); 43 | QString parseScripts(int tutID, bool *warnings = nullptr) const override; 44 | protected: 45 | QList openPositions(const QByteArray &data) const override; 46 | QByteArray save2(QByteArray &toc, quint32 firstPos) const; 47 | }; 48 | -------------------------------------------------------------------------------- /src/core/field/FieldModelLoaderPS.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #pragma once 19 | 20 | #include 21 | #include "FieldModelLoader.h" 22 | #include "FieldModelLoaderPC.h" 23 | #include "BsxFile.h" 24 | 25 | class CharArchive; 26 | 27 | struct FieldModelLoaderStruct { 28 | quint8 faceID, bonesCount, partsCount, animationCount; 29 | quint8 unknown1, unknown2, unknown3, modelID; 30 | }; 31 | 32 | class FieldModelLoaderPS : public FieldModelLoader 33 | { 34 | public: 35 | explicit FieldModelLoaderPS(Field *field); 36 | void clear() override; 37 | bool open() override; 38 | bool open(const QByteArray &data) override; 39 | QByteArray save() const override; 40 | qsizetype modelCount() const override; 41 | qsizetype animCount(int modelID) const override; 42 | quint16 unknown(int modelID) const override; 43 | void setUnknown(int modelID, quint16 unknown) override; 44 | const FieldModelLoaderStruct &model(int modelID) const; 45 | void setModel(int modelID, const FieldModelLoaderStruct &modelLoader); 46 | FieldModelLoaderPC toPC(BsxFile *bsx, CharArchive *charArchive, bool *ok) const; 47 | private: 48 | QList _modelLoaders; 49 | }; 50 | -------------------------------------------------------------------------------- /CMakePresets.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 6, 3 | "cmakeMinimumRequired": { 4 | "major": 3, 5 | "minor": 25, 6 | "patch": 0 7 | }, 8 | "configurePresets": [ 9 | { 10 | "name": "base", 11 | "hidden": true, 12 | "environment": { 13 | "NUGET_CLI_LANGUAGE": "en-us", 14 | "VCPKG_ROOT": "${sourceDir}/vcpkg", 15 | "VCPKG_BINARY_SOURCES": "clear;nuget,github,readwrite;default,readwrite" 16 | }, 17 | "binaryDir": "${sourceDir}/.build", 18 | "installDir": "${sourceDir}/.install", 19 | "toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" 20 | }, 21 | { 22 | "name": "Release", 23 | "inherits": "base", 24 | "cacheVariables": { 25 | "CMAKE_BUILD_TYPE": "Release" 26 | } 27 | }, 28 | { 29 | "name": "RelWithDebInfo", 30 | "inherits": "base", 31 | "cacheVariables": { 32 | "CMAKE_BUILD_TYPE": "RelWithDebInfo" 33 | } 34 | }, 35 | { 36 | "name": "Debug", 37 | "inherits": "base", 38 | "cacheVariables": { 39 | "CMAKE_BUILD_TYPE": "Debug" 40 | } 41 | }, 42 | { 43 | "name": "MinSizeRel", 44 | "inherits": "base", 45 | "cacheVariables": { 46 | "CMAKE_BUILD_TYPE": "MinSizeRel" 47 | } 48 | } 49 | ], 50 | "buildPresets": [ 51 | { 52 | "name": "Release", 53 | "displayName": "Default", 54 | "configurePreset": "Release", 55 | "configuration": "Release" 56 | }, 57 | { 58 | "name": "RelWithDebInfo", 59 | "displayName": "Default", 60 | "configurePreset": "RelWithDebInfo", 61 | "configuration": "RelWithDebInfo" 62 | }, 63 | { 64 | "name": "Debug", 65 | "displayName": "Default", 66 | "configurePreset": "Debug", 67 | "configuration": "Debug" 68 | }, 69 | { 70 | "name": "MinSizeRel", 71 | "displayName": "Default", 72 | "configurePreset": "MinSizeRel", 73 | "configuration": "MinSizeRel" 74 | } 75 | ], 76 | "vendor": { 77 | "microsoft.com/VisualStudioSettings/CMake/1.0": { 78 | "hostOS": "Windows", 79 | "intelliSenseMode": "windows-msvc-x64" 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/widgets/KeyEditorDialog.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Makou Reactor Final Fantasy VII Field Script Editor 3 | ** Copyright (C) 2009-2022 Arzel Jérôme 4 | ** 5 | ** This program is free software: you can redistribute it and/or modify 6 | ** it under the terms of the GNU General Public License as published by 7 | ** the Free Software Foundation, either version 3 of the License, or 8 | ** (at your option) any later version. 9 | ** 10 | ** This program is distributed in the hope that it will be useful, 11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ** GNU General Public License for more details. 14 | ** 15 | ** You should have received a copy of the GNU General Public License 16 | ** along with this program. If not, see . 17 | ****************************************************************************/ 18 | #include "KeyEditorDialog.h" 19 | #include "Data.h" 20 | 21 | KeyEditorDialog::KeyEditorDialog(quint16 value, QWidget *parent) 22 | : QDialog(parent, Qt::Dialog | Qt::WindowCloseButtonHint) 23 | { 24 | setWindowTitle(tr("Keys")); 25 | QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this); 26 | QVBoxLayout *layout = new QVBoxLayout(this); 27 | 28 | for (int i = 0; i < Data::key_names.size(); ++i) { 29 | QCheckBox *checkBox = new QCheckBox(Data::key_names.at(i), this); 30 | checkBox->setCheckState(((value >> i) & 1) ? Qt::Checked : Qt::Unchecked); 31 | layout->addWidget(checkBox); 32 | } 33 | layout->addWidget(buttonBox); 34 | 35 | connect(buttonBox, &QDialogButtonBox::accepted, this, &KeyEditorDialog::accept); 36 | connect(buttonBox, &QDialogButtonBox::rejected, this, &KeyEditorDialog::reject); 37 | } 38 | 39 | int KeyEditorDialog::keys() const 40 | { 41 | QList all = this->findChildren(); 42 | quint16 result = 0; 43 | 44 | for (int i=0; icheckState() == Qt::Checked) 47 | { 48 | result |= 1 << i; 49 | } 50 | } 51 | return result; 52 | } 53 | --------------------------------------------------------------------------------