Merge branch 'dev' of https://github.com/huderlem/porymap into windowsize

This commit is contained in:
GriffinR
2025-05-04 22:46:19 -04:00
300 changed files with 19409 additions and 11365 deletions

View File

@@ -9,32 +9,26 @@ on:
tags:
- '*'
pull_request:
branches:
- master
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build-qt5-linux:
build-linux:
strategy:
matrix:
qtversion: [5.14.2, 6.8.2]
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
with:
path: ../Qt
key: ${{ runner.os }}-QtCache
- uses: actions/checkout@v4
- name: Install Qt
uses: jurplel/install-qt-action@v2
uses: jurplel/install-qt-action@v4
with:
version: '5.14.2'
modules: 'qtwidgets qtqml qtcharts'
cached: ${{ steps.cache-qt.outputs.cache-hit }}
version: ${{ matrix.qtversion }}
modules: 'qtcharts'
cache: 'true'
- name: Configure
run: qmake porymap.pro
@@ -43,24 +37,22 @@ jobs:
run: make
build-macos:
runs-on: macos-latest
strategy:
matrix:
os: [macos-latest, macos-13]
runs-on: ${{ matrix.os }}
env:
BUILD_NAME: porymap-${{ matrix.os }}-${{ github.ref_name }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
with:
path: ../Qt
key: ${{ runner.os }}-QtCache
- uses: actions/checkout@v4
- name: Install Qt
uses: jurplel/install-qt-action@v3
uses: jurplel/install-qt-action@v4
with:
version: '6.7.*'
version: '6.8.2'
modules: 'qtcharts'
cached: ${{ steps.cache-qt.outputs.cache-hit }}
cache: 'true'
- name: Configure
run: qmake -config release porymap.pro
@@ -75,19 +67,19 @@ jobs:
- name: Prep Release Directory
if: startsWith(github.ref, 'refs/tags/')
run: |
mkdir porymap-macOS-${{ github.ref_name }}
cp porymap.dmg porymap-macOS-${{ github.ref_name }}/porymap.dmg
cp RELEASE-README.txt porymap-macOS-${{ github.ref_name }}/README.txt
mkdir $BUILD_NAME
cp porymap.dmg $BUILD_NAME/porymap.dmg
cp RELEASE-README.txt $BUILD_NAME/README.txt
- name: Bundle Release Directory
if: startsWith(github.ref, 'refs/tags/')
run: zip -r porymap-macOS-${{ github.ref_name }}.zip porymap-macOS-${{ github.ref_name }}
run: zip -r $BUILD_NAME.zip $BUILD_NAME
- name: Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: porymap-macOS-${{ github.ref_name }}.zip
files: $BUILD_NAME.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -95,7 +87,7 @@ jobs:
runs-on: windows-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: dsaltares/fetch-gh-release-asset@master
if: steps.cache-static-qt.outputs.cache-hit != 'true'
@@ -153,7 +145,7 @@ jobs:
run: powershell.exe -Command "Compress-Archive -Path porymap-windows-${{ github.ref_name }} -DestinationPath porymap-windows-${{ github.ref_name }}.zip"
- name: Create Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: porymap-windows-${{ github.ref_name }}.zip

View File

@@ -8,50 +8,121 @@ The **"Breaking Changes"** listed below are changes that have been made in the d
## [Unreleased]
### Added
- Redesigned the Connections tab, adding a number of new features including the option to open or display diving maps and a list UI for easier edit access.
- Redesigned the map list, adding new features including opening/editing layouts with no associated map, editing the names of map groups, rearranging maps and map groups, and hiding empty folders.
- Add a drop-down for changing the layout of the currently opened map.
- Add an option to duplicate maps/layouts.
- Redesigned the Connections tab, adding new features including the option to open or display diving maps and a list UI for easier edit access.
- Add a `Close Project` option
- Add charts to the `Wild Pokémon` tab that show species and level distributions.
- Add a search button to the `Wild Pokémon` tab that shows the encounter data for a species across all maps.
- Add charts to the `Wild Pokémon` tab that show species and level distributions for the current map.
- Add options for customizing the map grid under `View -> Grid Settings`.
- Add an option to display Event sprites while editing the map.
- Add an option to display a dividing line between tilesets in the Tileset Editor.
- Add an input field to the Tileset Editor for editing the full metatile attributes value directly, including unused bits.
- An alert will be displayed when attempting to open a seemingly invalid project.
- Add support for defining project values with `enum` where `#define` was expected.
- Add support for referring to object events and warps with named IDs, rather than referring to them with their index number.
- Add a setting to specify the tile values to use for the unused metatile layer.
- Add a setting to specify the maximum number of events in a group. A warning will be shown if too many events are added.
- Add a setting to customize the size and position of the player view distance.
- Add `onLayoutOpened` to the scripting API.
- Add a splash loading screen for project openings.
### Changed
- `Change Dimensions` now has an interactive resizing rectangle.
- Redesigned the new map dialog, including better error checking and a collapsible section for header data.
- New maps/layouts are no longer saved automatically, and can be fully discarded by closing without saving.
- Map groups and ``MAPSEC`` names specified when creating a new map will be added automatically if they don't already exist.
- Custom fields in JSON files that Porymap writes are no longer discarded.
- Edits to map connections now have Undo/Redo and can be viewed in exported timelapses.
- Changes to the "Mirror to Connecting Maps" setting will now be saved between sessions.
- A notice will be displayed when attempting to open the "Dynamic" map, rather than nothing happening.
- The base game version is now auto-detected if the project name contains only one of "emerald", "firered/leafgreen", or "ruby/sapphire".
- The max encounter rate is now read from the project, rather than assuming the default value from RSE.
- It's now possible to cancel quitting if there are unsaved changes in sub-windows.
- The triple-layer metatiles setting can now be set automatically using a project constant.
- `Export Map Stitch Image` now shows a preview of the full image, not just the current map.
- `Export Map Stitch Image` and `Export Map Timelapse Image` now show a preview of the full image/gif, not just the current map.
- `Custom Attributes` tables now display numbers using spin boxes. The `type` column was removed, because `value`'s type is now obvious.
- Unrecognized map names in Event or Connections data will no longer be overwritten.
- It's now possible to click on an event's sprite even if a different event's rectangle is overlapping it. The old selection behavior is available via a new setting.
- Reduced diff noise when saving maps.
- Map names and ``MAP_NAME`` constants are no longer required to match.
- Porymap will no longer overwrite ``include/constants/map_groups.h`` or ``include/constants/layouts.h``.
- Primary/secondary metatile images are now kept on separate rows, rather than blending together if the primary size is not divisible by 8.
- The prompt to reload the project when a file has changed will now only appear when Porymap is the active application.
- `Script` dropdowns now autocomplete only with scripts from the current map, rather than every script in the project. The old behavior is available via a new setting.
- `Script` dropdowns now update automatically if the current map's scripts file is edited.
- The options for `Encounter Type` and `Terrain Type` in the Tileset Editor are not hardcoded anymore, they're now read from the project.
- The `symbol_wild_encounters` setting was replaced; this value is now read from the project.
- The max encounter rate is now read from the project, rather than assuming the default value from RSE.
- `MAP_OFFSET_W` and `MAP_OFFSET_H` (used to limit the maximum map size) are now read from the project.
- The rendered area of the map border is now limited to the maximum player view distance (prior to this it included two extra rows on the top and bottom).
- An error message will now be shown when Porymap is unable to save changes (e.g. if Porymap doesn't have write permissions for your project).
- A project may now be opened even if it has no maps or map groups. A minimum of one map layout is required.
- The file extensions that are expected for `.png` and `.pal` data files and the extensions outputted when creating a new tileset can now be customized.
- Miscellaneous performance improvements, especially for opening projects.
### Fixed
- Fix `Add Region Map...` not updating the region map settings file.
- Fix some crashes on invalid region map tilesets.
- Improve error reporting for invalid region map editor settings.
- Fix the region map editor's palette resetting between region maps.
- Fix the region map editor's h-flip and v-flip settings being swapped.
- Fix config files being written before the project is opened successfully.
- Fix the map and other project info still displaying if a new project fails to open.
- Fix unsaved changes being ignored when quitting (such as with Cmd+Q on macOS).
- Fix selections with multiple Events not always clearing when making a new selection.
- Fix selections with multiple events not always clearing when making a new selection.
- Fix the new event button not updating correctly when selecting object events.
- Fix duplicated `Hidden Item` events not copying the `Requires Itemfinder` field.
- Fix event sprites disappearing in certain areas outside the map boundaries.
- Fix deselecting an event still allowing you to drag the event around.
- Fix events rendering on top of the ruler at very high y values.
- Fix new map names not appearing in event dropdowns that have already been populated.
- Fix `About porymap` opening a new window each time it's activated.
- Fix the `Edit History` window not raising to the front when reactivated.
- New maps are now always inserted in map dropdowns at the correct position, rather than at the bottom of the list until the project is reloaded.
- Fix species on the wild pokémon tab retaining icons from previously-opened projects.
- Fix invalid species names clearing from wild pokémon data when revisited.
- Fix editing wild pokémon data not marking the map as edited.
- Fix editing wild pokémon data not marking the map as unsaved.
- Fix editing an event's `Custom Attributes` not marking the map as unsaved.
- Fix changes to map connections not marking connected maps as unsaved.
- Fix numerous issues related to connecting a map to itself.
- Fix incorrect map connections getting selected when opening a map by double-clicking a map connection.
- Fix a visual issue when quickly dragging map connections around.
- Fix map connections rendering incorrectly if their direction name was unknown.
- Fix map connections rendering incorrectly if their dimensions were smaller than the border draw distance.
- Fix metatile/collision selection images skewing off-center after opening a map from the Connections tab.
- Fix the map list filter retaining text between project open/close.
- Fix the map list mishandling value gaps when sorting by Area.
- Fix a freeze on startup if project values are defined with mismatched parentheses.
- Fix stitched map images sometimes rendering garbage
- Fix the `Reset` button on `Export Map Timelapse Image` not resetting the Timelapse settings.
- Fix events in exported map stitch images being occluded by neighboring maps.
- Fix the map connections in exported map images coming from the map currently open in the editor, rather than the map shown in the export window.
- Fix crash when exporting a map stitch image if a map fails to load.
- Fix possible crash when exporting a timelapse that has events edit history.
- Fix exported timelapses excluding pasted events and certain map size changes.
- Fix exporting a timelapse sometimes altering the state of the current map's edit history.
- Stop sliders in the Palette Editor from creating a bunch of edit history when used.
- Fix scrolling on some containers locking up when the mouse stops over a spin box or combo box.
- Fix the selection index for some combo boxes differing from their displayed text.
- Fix some file dialogs returning to an incorrect window when closed.
- Fix bug where reloading a layout would overwrite all unsaved changes.
- Fix bug where layout json and blockdata could be saved separately leading to inconsistent data.
- Fix crash when saving tilesets with fewer palettes than the maximum.
- Fix projects not opening on Windows if the project filepath contains certain characters.
- Fix custom project filepaths not converting Windows file separators.
- Fix exported tile images containing garbage pixels after the end of the tiles.
- Fix fully transparent pixels rendering with the incorrect color.
- Fix the values for some config fields shuffling their order every save.
- Fix `key`s in `Custom Attributes` disappearing if given an empty name or the name of an existing field.
- Fix some problems with tileset detection when importing maps from AdvanceMap.
- Fix certain input fields allowing invalid identifiers, like names starting with numbers.
- Fix crash in the Shortcuts Editor when applying changes after closing certain windows.
- Fix the Shortcuts Editor clearing shortcuts after selecting them.
- Fix `Display Metatile Usage Counts` sometimes changing the counts after repeated use.
- The Metatile / Tile usage counts in the Tileset Editor now update to reflect changes.
- Fix regression that stopped the map zoom from centering on the cursor.
- Fix `Open Map Scripts` not working on maps with a `shared_scripts_map` field.
## [5.4.1] - 2024-03-21
### Fixed

View File

@@ -456,7 +456,7 @@ in order to add a new map to the folder.</p>
<dt>Name</dt>
<dd>The name of the new map. This cannot be changed in porymap.</dd>
<dt>Group</dt>
<dd>Which map group the new map will beling to. This cannot be changed in porymap.</dd>
<dd>Which map group the new map will belong to. This cannot be changed in porymap.</dd>
<dt>Map Width</dt>
<dd>The width (in metatiles) of the map. This can be changed in porymap.</dd>
<dt>Map Height</dt>
@@ -538,4 +538,4 @@ in order to add a new map to the folder.</p>
</body>
</html>
</html>

View File

@@ -31,7 +31,7 @@ Name
The name of the new map. This cannot be changed in porymap.
Group
Which map group the new map will beling to. This cannot be changed in porymap.
Which map group the new map will belong to. This cannot be changed in porymap.
Map Width
The width (in metatiles) of the map. This can be changed in porymap.

View File

@@ -36,22 +36,20 @@ The filepath that Porymap expects for each file can be overridden on the ``Files
data/tilesets/metatiles.inc, yes, yes, ``tilesets_metatiles_asm``, only if ``tilesets_headers`` can't be found
data/tilesets/[primary|secondary]/\*, yes, yes, ``data_tilesets_folders``, default tileset data location
src/data/wild_encounters.json, yes, yes, ``json_wild_encounters``, optional (only required to use Wild Pokémon tab)
src/data/heal_locations.json, yes, yes, ``json_heal_locations``,
src/data/object_events/object_event_graphics_info_pointers.h, yes, no, ``data_obj_event_gfx_pointers``,
src/data/object_events/object_event_graphics_info.h, yes, no, ``data_obj_event_gfx_info``,
src/data/object_events/object_event_pic_tables.h, yes, no, ``data_obj_event_pic_tables``,
src/data/object_events/object_event_graphics.h, yes, no, ``data_obj_event_gfx``,
src/data/graphics/pokemon.h, yes, no, ``data_pokemon_gfx``, for pokemon sprite icons
src/data/heal_locations.h, yes, yes, ``data_heal_locations``,
src/data/region_map/region_map_sections.json, yes, yes, ``json_region_map_entries``,
src/data/region_map/porymap_config.json, yes, yes, ``json_region_porymap_cfg``,
include/constants/global.h, yes, no, ``constants_global``, reads ``define_obj_event_count``
include/constants/map_groups.h, no, yes, ``constants_map_groups``,
include/constants/items.h, yes, no, ``constants_items``, for Hidden Item events
include/constants/flags.h, yes, no, ``constants_flags``, for Object and Hidden Item events
include/constants/vars.h, yes, no, ``constants_vars``, for Trigger events
include/constants/weather.h, yes, no, ``constants_weather``, for map weather and Weather Triggers
include/constants/songs.h, yes, no, ``constants_songs``, for map music
include/constants/heal_locations.h, yes, yes, ``constants_heal_locations``,
include/constants/pokemon.h, yes, no, ``constants_pokemon``, reads ``define_min_level`` and ``define_max_level``
include/constants/map_types.h, yes, no, ``constants_map_types``,
include/constants/trainer_types.h, yes, no, ``constants_trainer_types``, for Object events
@@ -59,7 +57,6 @@ The filepath that Porymap expects for each file can be overridden on the ``Files
include/constants/event_object_movement.h, yes, no, ``constants_obj_event_movement``,
include/constants/event_objects.h, yes, no, ``constants_obj_events``,
include/constants/event_bg.h, yes, no, ``constants_event_bg``,
include/constants/region_map_sections.h, yes, no, ``constants_region_map_sections``,
include/constants/metatile_labels.h, yes, yes, ``constants_metatile_labels``,
include/constants/metatile_behaviors.h, yes, no, ``constants_metatile_behaviors``,
include/constants/species.h, yes, no, ``constants_metatile_behaviors``, for the Wild Pokémon tab
@@ -86,14 +83,9 @@ In addition to these files, there are some specific symbol and macro names that
``symbol_facing_directions``, ``gInitialMovementTypeFacingDirections``, to set sprite frame for Object Events based on movement type
``symbol_obj_event_gfx_pointers``, ``gObjectEventGraphicsInfoPointers``, to map Object Event graphics IDs to graphics data
``symbol_pokemon_icon_table``, ``gMonIconTable``, to map species constants to icon images
``symbol_wild_encounters``, ``gWildMonHeaders``, output as the ``label`` property for the top-level wild ecounters JSON object
``symbol_heal_locations_type``, ``struct HealLocation``, the type for the Heal Locations table
``symbol_heal_locations``, ``sHealLocations``, the default Heal Locations table name when ``Respawn Map/NPC`` is disabled
``symbol_spawn_points``, ``sSpawnPoints``, the default Heal Locations table name when ``Respawn Map/NPC`` is enabled
``symbol_spawn_maps``, ``u16 sWhiteoutRespawnHealCenterMapIdxs``, the type and table name for Heal Location ``Respawn Map`` values
``symbol_spawn_npcs``, ``u8 sWhiteoutRespawnHealerNpcIds``, the type and table name for Heal Location ``Respawn NPC`` values
``symbol_attribute_table``, ``sMetatileAttrMasks``, optionally read to get settings on ``Tilesets`` tab
``symbol_tilesets_prefix``, ``gTileset_``, for new tileset names and to extract base tileset names
``symbol_dynamic_map_name``, ``Dynamic``, reserved map name to display for ``define_map_dynamic``
``define_obj_event_count``, ``OBJECT_EVENT_TEMPLATES_COUNT``, to limit total Object Events
``define_min_level``, ``MIN_LEVEL``, minimum wild encounters level
``define_max_level``, ``MAX_LEVEL``, maximum wild encounters level
@@ -105,6 +97,8 @@ In addition to these files, there are some specific symbol and macro names that
``define_pals_total``, ``NUM_PALS_TOTAL``,
``define_tiles_per_metatile``, ``NUM_TILES_PER_METATILE``, to determine if triple-layer metatiles are in use. Values other than 8 or 12 are ignored
``define_map_size``, ``MAX_MAP_DATA_SIZE``, to limit map dimensions
``define_map_offset_width``, ``MAP_OFFSET_W``, to limit map dimensions
``define_map_offset_height``, ``MAP_OFFSET_H``, to limit map dimensions
``define_mask_metatile``, ``MAPGRID_METATILE_ID_MASK``, optionally read to get settings on ``Maps`` tab
``define_mask_collision``, ``MAPGRID_COLLISION_MASK``, optionally read to get settings on ``Maps`` tab
``define_mask_elevation``, ``MAPGRID_ELEVATION_MASK``, optionally read to get settings on ``Maps`` tab
@@ -115,15 +109,15 @@ In addition to these files, there are some specific symbol and macro names that
``define_attribute_terrain``, ``METATILE_ATTRIBUTE_TERRAIN``, name used to extract setting from ``symbol_attribute_table``
``define_attribute_encounter``, ``METATILE_ATTRIBUTE_ENCOUNTER_TYPE``, name used to extract setting from ``symbol_attribute_table``
``define_metatile_label_prefix``, ``METATILE_``, expected prefix for metatile label macro names
``define_heal_locations_prefix``, ``HEAL_LOCATION_``, output as prefix for Heal Location IDs if ``Respawn Map/NPC`` is disabled
``define_spawn_prefix``, ``SPAWN_``, output as prefix for Heal Location IDs if ``Respawn Map/NPC`` is enabled
``define_heal_locations_prefix``, ``HEAL_LOCATION_``, default prefix for heal location macro names
``define_layout_prefix``, ``LAYOUT_``, default prefix for layout macro names
``define_map_prefix``, ``MAP_``, expected prefix for map macro names
``define_map_dynamic``, ``DYNAMIC``, macro name after prefix for Dynamic maps
``define_map_empty``, ``UNDEFINED``, macro name after prefix for empty maps
``define_map_section_prefix``, ``MAPSEC_``, expected prefix for location macro names
``define_map_section_empty``, ``NONE``, macro name after prefix for empty region map sections
``define_map_section_count``, ``COUNT``, macro name after prefix for total number of region map sections
``define_species_prefix``, ``SPECIES_``, expected prefix for species macro names
``define_species_empty``, ``NONE``, macro name after prefix for the default species
``regex_behaviors``, ``\bMB_``, regex to find metatile behavior macro names
``regex_obj_event_gfx``, ``\bOBJ_EVENT_GFX_``, regex to find Object Event graphics ID macro names
``regex_items``, ``\bITEM_(?!(B_)?USE_)``, regex to find item macro names
@@ -138,3 +132,7 @@ In addition to these files, there are some specific symbol and macro names that
``regex_sign_facing_directions``, ``\bBG_EVENT_PLAYER_FACING_``, regex to find sign facing direction macro names
``regex_trainer_types``, ``\bTRAINER_TYPE_``, regex to find trainer type macro names
``regex_music``, ``\b(SE|MUS)_``, regex to find music macro names
``regex_gbapal``, ``\.gbapal(\.[\w]+)?$``, regex to get the expected file extension for ``.pal`` data files
``regex_bpp``, ``\.[\d]+bpp(\.[\w]+)?$``, regex to get the expected file extension for ``.png`` data files
``pals_output_extension``, ``.gbapal``, the file extension to output for a new tileset's palette data files
``tiles_output_extension``, ``.4bpp.lz``, the file extension to output for a new tileset's tiles image data file

View File

@@ -158,6 +158,13 @@ Callbacks
:param mapName: the name of the opened map
:type mapName: string
.. js:function:: onLayoutOpened(layoutName)
Called when a layout is opened, either by selecting a new map/layout in the map list or swapping the layout for the current map.
:param layoutName: the name of the opened layout
:type layoutName: string
.. js:function:: onBlockChanged(x, y, prevBlock, newBlock)
Called when a block is changed on the map. For example, this is called when a user paints a new tile or changes the collision property of a block.
@@ -197,7 +204,7 @@ Callbacks
Called when the mouse exits the map.
.. js:function:: onMapResized(oldWidth, oldHeight, newWidth, newHeight)
.. js:function:: onMapResized(oldWidth, oldHeight, delta)
Called when the dimensions of the map are changed.
@@ -205,10 +212,8 @@ Callbacks
:type oldWidth: number
:param oldHeight: the height of the map before the change
:type oldHeight: number
:param newWidth: the width of the map after the change
:type newWidth: number
:param newHeight: the height of the map after the change
:type newHeight: number
:param delta: the amount the map size changed in each direction. The object's shape is ``{left, right, top, bottom}``
:type prevBlock: delta
.. js:function:: onBorderResized(oldWidth, oldHeight, newWidth, newHeight)
@@ -1995,7 +2000,28 @@ All utility functions are callable via the global ``utility`` object.
Gets the list of map names.
:returns: the list of map names
:returns: the list of map names (e.g. `PetalburgCity`)
:rtype: array
.. js:function:: utility.getMapConstants()
Gets the list of map IDs (e.g. `MAP_PETALBURG_CITY`)
:returns: the list of map IDs
:rtype: array
.. js:function:: utility.getLayoutNames()
Gets the list of layout names.
:returns: the list of layout names (e.g. `PetalburgCity_Layout`)
:rtype: array
.. js:function:: utility.getLayoutConstants()
Gets the list of layout IDs (e.g. `LAYOUT_PETALBURG_CITY`)
:returns: the list of layout IDs
:rtype: array
.. js:function:: utility.getTilesetNames()

View File

@@ -1,117 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AboutPorymap</class>
<widget class="QMainWindow" name="AboutPorymap">
<widget class="QDialog" name="AboutPorymap">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>582</width>
<height>438</height>
<width>388</width>
<height>121</height>
</rect>
</property>
<property name="windowTitle">
<string>About Porymap</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label_Title">
<property name="font">
<font>
<family>Arial</family>
<pointsize>22</pointsize>
<weight>75</weight>
<bold>true</bold>
<underline>false</underline>
<kerning>true</kerning>
</font>
</property>
<property name="text">
<string>Porymap</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_Version">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>12</pointsize>
</font>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_Description">
<property name="font">
<font>
<family>Arial</family>
</font>
</property>
<property name="text">
<string>Map editor for pokeemerald, pokefirered and pokeruby.</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_Manual">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Official Documentation: &lt;a href=&quot;https://huderlem.github.io/porymap/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0069d9;&quot;&gt;https://huderlem.github.io/porymap/&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QTextBrowser" name="textBrowser">
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>582</width>
<height>22</height>
</rect>
</property>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label_Title">
<property name="font">
<font>
<family>Arial</family>
<pointsize>22</pointsize>
<bold>true</bold>
<underline>false</underline>
<kerning>true</kerning>
</font>
</property>
<property name="text">
<string>Porymap</string>
</property>
<property name="textFormat">
<enum>Qt::TextFormat::RichText</enum>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_Version">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>12</pointsize>
</font>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::TextInteractionFlag::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_Description">
<property name="font">
<font>
<family>Arial</family>
</font>
</property>
<property name="text">
<string>Map editor for pokeemerald, pokefirered and pokeruby.</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_Manual">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Official Documentation: &lt;a href=&quot;https://huderlem.github.io/porymap/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0069d9;&quot;&gt;https://huderlem.github.io/porymap/&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>

View File

@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>178</width>
<width>188</width>
<height>157</height>
</rect>
</property>
@@ -20,7 +20,7 @@
<string notr="true">.ConnectionsListItem { border-width: 1px; }</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
<enum>QFrame::Shape::StyledPanel</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
@@ -65,7 +65,7 @@
<item row="3" column="2">
<widget class="QToolButton" name="button_Delete">
<property name="toolTip">
<string>Remove this connection.</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Remove this connection.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>...</string>
@@ -79,28 +79,28 @@
<item row="1" column="1" colspan="2">
<widget class="NoScrollComboBox" name="comboBox_Direction">
<property name="toolTip">
<string>Where the connected map should be positioned relative to the current map.</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Where the connected map should be positioned relative to the current map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="NoScrollComboBox" name="comboBox_Map">
<property name="toolTip">
<string>The name of the map to connect to the current map.</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The name of the map to connect to the current map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="NoScrollSpinBox" name="spinBox_Offset">
<property name="toolTip">
<string>The number of spaces to move the connected map perpendicular to its connected direction.</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The number of spaces to move the connected map perpendicular to its connected direction.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QToolButton" name="button_OpenMap">
<property name="toolTip">
<string>Open the connected map.</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Open the connected map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>...</string>

View File

@@ -0,0 +1,172 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CustomAttributesDialog</class>
<widget class="QDialog" name="CustomAttributesDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>410</width>
<height>192</height>
</rect>
</property>
<property name="windowTitle">
<string>Add New Custom Attribute</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QFrame" name="centralwidget">
<layout class="QFormLayout" name="formLayout">
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_Name">
<property name="text">
<string>Name</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_Name">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The key name for the new JSON field&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_Type">
<property name="text">
<string>Type</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="NoScrollComboBox" name="comboBox_Type">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The data type for the new JSON field&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_Value">
<property name="text">
<string>Value</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QStackedWidget" name="stackedWidget_Value">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The value for the new JSON field&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<widget class="QWidget" name="page_String">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLineEdit" name="lineEdit_Value"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="page_Number">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QSpinBox" name="spinBox_Value"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="page_Boolean">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QCheckBox" name="checkBox_Value">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="label_NameError">
<property name="visible">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0)</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>NoScrollComboBox</class>
<extends>QComboBox</extends>
<header>noscrollcombobox.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CustomAttributesFrame</class>
<widget class="QFrame" name="CustomAttributesFrame">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Custom Attributes</string>
</property>
</widget>
</item>
<item>
<widget class="QFrame" name="frame_Buttons">
<property name="frameShape">
<enum>QFrame::Shape::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Shadow::Plain</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="button_Add">
<property name="text">
<string>Add</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="button_Delete">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Delete</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="CustomAttributesTable" name="tableWidget"/>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>CustomAttributesTable</class>
<extends>QTableWidget</extends>
<header>customattributestable.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>540</width>
<width>582</width>
<height>355</height>
</rect>
</property>
@@ -33,25 +33,34 @@
<item>
<widget class="QFrame" name="window">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
<enum>QFrame::Shape::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
<enum>QFrame::Shadow::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QFrame" name="header">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
<enum>QFrame::Shape::StyledPanel</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item>
<widget class="QPushButton" name="button_CreateNewScript">
<property name="toolTip">
<string>Create a new Porymap script file with a default template</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Create a new Porymap script file with a default template&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Create New Script...</string>
@@ -65,7 +74,7 @@
<item>
<widget class="QPushButton" name="button_LoadScript">
<property name="toolTip">
<string>Add an existing script file to the list below</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Add an existing script file to the list below&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Load Script...</string>
@@ -79,7 +88,7 @@
<item>
<widget class="QPushButton" name="button_RefreshScripts">
<property name="toolTip">
<string>Refresh all loaded scripts to account for any recent edits</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Refresh all loaded scripts to account for any recent edits&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Refresh Scripts</string>
@@ -91,9 +100,9 @@
</widget>
</item>
<item>
<spacer name="horizontalSpacer_header">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -103,35 +112,33 @@
</property>
</spacer>
</item>
<item>
<spacer name="horizontalSpacer_header">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="button_Help">
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../resources/images.qrc">
<normaloff>:/icons/help.ico</normaloff>:/icons/help.ico</iconset>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QLabel" name="label_Manual">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;https://huderlem.github.io/porymap/manual/scripting-capabilities.html&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0069d9;&quot;&gt;Help&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_ListHeader">
<property name="text">
@@ -142,32 +149,32 @@
<item>
<widget class="QListWidget" name="list">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
<set>QAbstractItemView::EditTrigger::NoEditTriggers</set>
</property>
<property name="showDropIndicator" stdset="0">
<bool>false</bool>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::DragOnly</enum>
<enum>QAbstractItemView::DragDropMode::DragOnly</enum>
</property>
<property name="defaultDropAction">
<enum>Qt::IgnoreAction</enum>
<enum>Qt::DropAction::IgnoreAction</enum>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
<enum>QAbstractItemView::SelectionMode::ExtendedSelection</enum>
</property>
<property name="textElideMode">
<enum>Qt::ElideLeft</enum>
<enum>Qt::TextElideMode::ElideLeft</enum>
</property>
<property name="movement">
<enum>QListView::Free</enum>
<enum>QListView::Movement::Free</enum>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
</property>
</widget>
</item>

View File

@@ -1,319 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>EventPropertiesFrame</class>
<widget class="QFrame" name="EventPropertiesFrame">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>284</width>
<height>146</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>284</width>
<height>90</height>
</size>
</property>
<property name="windowTitle">
<string>Frame</string>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<property name="lineWidth">
<number>1</number>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QWidget" name="widget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_spritePixmap">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<property name="text">
<string/>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="indent">
<number>-1</number>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QSpinBox" name="spinBox_index">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>The index of the event currently being inspected.</string>
</property>
<property name="maximum">
<number>255</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_name">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Id</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QHBoxLayout" name="x">
<item>
<widget class="QLabel" name="label_x">
<property name="text">
<string>X</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="NoScrollSpinBox" name="spinBox_x">
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The X coordinate of this object.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="minimum">
<number>-32768</number>
</property>
<property name="maximum">
<number>32767</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="y">
<item>
<widget class="QLabel" name="label_y">
<property name="text">
<string>Y</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="NoScrollSpinBox" name="spinBox_y">
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The Y coordinate of this object.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="minimum">
<number>-32768</number>
</property>
<property name="maximum">
<number>32767</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="z">
<item>
<widget class="QLabel" name="label_z">
<property name="text">
<string>Z</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="NoScrollSpinBox" name="spinBox_z">
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The elevation of this object.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="maximum">
<number>15</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="sprite" native="true">
<layout class="QFormLayout" name="formLayout_sprite">
<property name="rowWrapPolicy">
<enum>QFormLayout::WrapLongRows</enum>
</property>
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_sprite">
<property name="text">
<string>Sprite</string>
</property>
<property name="buddy">
<cstring>comboBox_sprite</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="NoScrollComboBox" name="comboBox_sprite">
<property name="enabled">
<bool>true</bool>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The sprite graphics to use for this object.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
<property name="currentText">
<string/>
</property>
<property name="maxVisibleItems">
<number>25</number>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContentsOnFirstShow</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>NoScrollComboBox</class>
<extends>QComboBox</extends>
<header>noscrollcombobox.h</header>
</customwidget>
<customwidget>
<class>NoScrollSpinBox</class>
<extends>QSpinBox</extends>
<header>noscrollspinbox.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>spinBox_x</tabstop>
<tabstop>spinBox_y</tabstop>
<tabstop>spinBox_z</tabstop>
<tabstop>comboBox_sprite</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>

157
forms/loadingscreen.ui Normal file
View File

@@ -0,0 +1,157 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>LoadingScreen</class>
<widget class="QWidget" name="LoadingScreen">
<property name="windowModality">
<enum>Qt::WindowModality::ApplicationModal</enum>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>366</width>
<height>255</height>
</rect>
</property>
<property name="cursor">
<cursorShape>BusyCursor</cursorShape>
</property>
<property name="contextMenuPolicy">
<enum>Qt::ContextMenuPolicy::NoContextMenu</enum>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="labelPorymap">
<property name="font">
<font>
<pointsize>20</pointsize>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>porymap</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelVersion">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>Version X.x.x</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QFrame" name="frame_2">
<property name="frameShape">
<enum>QFrame::Shape::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Shadow::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="labelPixmap">
<property name="minimumSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="text">
<string>IMAGE</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::Shape::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Shadow::Plain</enum>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="1">
<widget class="QLabel" name="labelText">
<property name="text">
<string>Loading....</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

File diff suppressed because it is too large Load Diff

252
forms/mapheaderform.ui Normal file
View File

@@ -0,0 +1,252 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MapHeaderForm</class>
<widget class="QWidget" name="MapHeaderForm">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>407</width>
<height>380</height>
</rect>
</property>
<property name="focusPolicy">
<enum>Qt::FocusPolicy::ClickFocus</enum>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::FieldGrowthPolicy::FieldsStayAtSizeHint</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_Song">
<property name="text">
<string>Song</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="NoScrollComboBox" name="comboBox_Song">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The default background music for this map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
<property name="insertPolicy">
<enum>QComboBox::InsertPolicy::NoInsert</enum>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_Location">
<property name="text">
<string>Location</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="NoScrollComboBox" name="comboBox_Location">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The section of the region map which the map is grouped under. This also determines the name of the map that is displayed when the player enters it.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
<property name="insertPolicy">
<enum>QComboBox::InsertPolicy::NoInsert</enum>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_RequiresFlash">
<property name="text">
<string>Requires Flash</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="checkBox_RequiresFlash">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If checked, the player will need to use Flash to see fully on this map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_Weather">
<property name="text">
<string>Weather</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="NoScrollComboBox" name="comboBox_Weather">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The default weather on this map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
<property name="insertPolicy">
<enum>QComboBox::InsertPolicy::NoInsert</enum>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_Type">
<property name="text">
<string>Type</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="NoScrollComboBox" name="comboBox_Type">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The map type is a general attribute, which is used for many different things. For example, underground type maps will have a special transition effect when the player enters/exits the map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
<property name="insertPolicy">
<enum>QComboBox::InsertPolicy::NoInsert</enum>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_BattleScene">
<property name="text">
<string>Battle Scene</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="NoScrollComboBox" name="comboBox_BattleScene">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;This field is used to help determine what graphics to use in the background of battles on this map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
<property name="insertPolicy">
<enum>QComboBox::InsertPolicy::NoInsert</enum>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_ShowLocationName">
<property name="text">
<string>Show Location Name</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QCheckBox" name="checkBox_ShowLocationName">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If checked, a map name popup will appear when the player enters this map. The name that appears on this popup depends on the Location field.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_AllowRunning">
<property name="text">
<string>Allow Running</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QCheckBox" name="checkBox_AllowRunning">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If checked, the player will be allowed to run on this map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_AllowBiking">
<property name="text">
<string>Allow Biking</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QCheckBox" name="checkBox_AllowBiking">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If checked, the player will be allowed to get on their bike on this map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_AllowEscaping">
<property name="text">
<string>Allow Dig &amp; Escape Rope</string>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QCheckBox" name="checkBox_AllowEscaping">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If checked, the player will be allowed to use Dig or Escape Rope on this map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="label_FloorNumber">
<property name="text">
<string>Floor Number</string>
</property>
</widget>
</item>
<item row="11" column="1">
<widget class="NoScrollSpinBox" name="spinBox_FloorNumber">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Floor number to be used for maps with elevators.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_LocationName">
<property name="text">
<string>Location Name</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEdit_LocationName">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The name that will be displayed in-game for this Location. This name will be shared with any other map that has the same Location.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>NoScrollComboBox</class>
<extends>QComboBox</extends>
<header>noscrollcombobox.h</header>
</customwidget>
<customwidget>
<class>NoScrollSpinBox</class>
<extends>QSpinBox</extends>
<header>noscrollspinbox.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>817</width>
<height>535</height>
<height>556</height>
</rect>
</property>
<property name="windowTitle">
@@ -25,11 +25,14 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::FocusPolicy::ClickFocus</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_Options">
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<widget class="QLabel" name="label_MapSelection">
<property name="text">
<string>Map</string>
</property>
@@ -37,6 +40,9 @@
</item>
<item row="0" column="1">
<widget class="NoScrollComboBox" name="comboBox_MapSelection">
<property name="insertPolicy">
<enum>QComboBox::InsertPolicy::NoInsert</enum>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::SizeAdjustPolicy::AdjustToContents</enum>
</property>
@@ -163,7 +169,7 @@
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="checkBox_Elevation">
<widget class="QCheckBox" name="checkBox_Collision">
<property name="text">
<string>Collision</string>
</property>
@@ -188,7 +194,10 @@
</property>
<layout class="QGridLayout" name="gridLayout_7">
<item row="2" column="1">
<widget class="QSpinBox" name="spinBox_TimelapseDelay">
<widget class="NoScrollSpinBox" name="spinBox_TimelapseDelay">
<property name="focusPolicy">
<enum>Qt::FocusPolicy::StrongFocus</enum>
</property>
<property name="specialValueText">
<string/>
</property>
@@ -214,7 +223,10 @@
</widget>
</item>
<item row="3" column="1">
<widget class="QSpinBox" name="spinBox_FrameSkip">
<widget class="NoScrollSpinBox" name="spinBox_FrameSkip">
<property name="focusPolicy">
<enum>Qt::FocusPolicy::StrongFocus</enum>
</property>
<property name="suffix">
<string/>
</property>
@@ -250,9 +262,22 @@
</spacer>
</item>
<item>
<widget class="QCheckBox" name="checkBox_ActualSize">
<widget class="QCheckBox" name="checkBox_DisablePreviewUpdates">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If checked, the image in the preview window will not be recreated when the settings are changed.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Preview actual size</string>
<string>Disable preview updates</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_DisablePreviewScaling">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If checked, the image shown in the preview window will not scale to fit into the available space. The aspect ratio of the image will never change.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Disable preview scaling</string>
</property>
</widget>
</item>
@@ -263,6 +288,9 @@
<property name="text">
<string>Reset</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
<item>
@@ -283,6 +311,9 @@
<property name="text">
<string>Cancel</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
<item>
@@ -290,6 +321,9 @@
<property name="text">
<string>Save</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
@@ -323,16 +357,22 @@
</property>
<item row="0" column="0">
<widget class="QScrollArea" name="scrollArea_Preview">
<property name="sizeAdjustPolicy">
<enum>QAbstractScrollArea::SizeAdjustPolicy::AdjustToContents</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>469</width>
<height>464</height>
<height>485</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
@@ -398,6 +438,11 @@
<extends>QComboBox</extends>
<header>noscrollcombobox.h</header>
</customwidget>
<customwidget>
<class>NoScrollSpinBox</class>
<extends>QSpinBox</extends>
<header>noscrollspinbox.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>

175
forms/maplisttoolbar.ui Normal file
View File

@@ -0,0 +1,175 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MapListToolBar</class>
<widget class="QFrame" name="MapListToolBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>274</width>
<height>32</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>3</number>
</property>
<property name="topMargin">
<number>3</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item>
<widget class="QToolButton" name="button_AddFolder">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Add a new folder to the list.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../resources/images.qrc">
<normaloff>:/icons/folder_add.ico</normaloff>:/icons/folder_add.ico</iconset>
</property>
<property name="popupMode">
<enum>QToolButton::ToolButtonPopupMode::InstantPopup</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="button_ToggleEmptyFolders">
<property name="text">
<string>Hide empty folders in the list.</string>
</property>
<property name="icon">
<iconset resource="../resources/images.qrc">
<normaloff>:/icons/folder_eye_open.ico</normaloff>
<normalon>:/icons/folder_eye_closed.ico</normalon>:/icons/folder_eye_open.ico</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="popupMode">
<enum>QToolButton::ToolButtonPopupMode::InstantPopup</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="button_ExpandAll">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Expand all folders in the list.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../resources/images.qrc">
<normaloff>:/icons/expand_all.ico</normaloff>:/icons/expand_all.ico</iconset>
</property>
<property name="popupMode">
<enum>QToolButton::ToolButtonPopupMode::InstantPopup</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="button_CollapseAll">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Collapse all folders in the list.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../resources/images.qrc">
<normaloff>:/icons/collapse_all.ico</normaloff>:/icons/collapse_all.ico</iconset>
</property>
<property name="popupMode">
<enum>QToolButton::ToolButtonPopupMode::InstantPopup</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="button_ToggleEdit">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If enabled, folders may be renamed and items in the list may be rearranged.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../resources/images.qrc">
<normaloff>:/icons/lock_edit.ico</normaloff>
<normalon>:/icons/unlock_edit.ico</normalon>:/icons/lock_edit.ico</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="popupMode">
<enum>QToolButton::ToolButtonPopupMode::InstantPopup</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Policy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>12</width>
<height>19</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_filterBox">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string/>
</property>
<property name="placeholderText">
<string>Filter...</string>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="../resources/images.qrc"/>
</resources>
<connections/>
</ui>

89
forms/newdefinedialog.ui Normal file
View File

@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>NewDefineDialog</class>
<widget class="QDialog" name="NewDefineDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>252</width>
<height>124</height>
</rect>
</property>
<property name="modal">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QFrame" name="form">
<layout class="QFormLayout" name="formLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_Name">
<property name="text">
<string>Name</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_Name">
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_NameError">
<property name="visible">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0)</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEdit_Value"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_Value">
<property name="text">
<string>Value</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
</property>
<property name="centerButtons">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

174
forms/newlayoutdialog.ui Normal file
View File

@@ -0,0 +1,174 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>NewLayoutDialog</class>
<widget class="QDialog" name="NewLayoutDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>264</width>
<height>173</height>
</rect>
</property>
<property name="windowTitle">
<string>New Layout Options</string>
</property>
<property name="sizeGripEnabled">
<bool>true</bool>
</property>
<property name="modal">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="frameShape">
<enum>QFrame::Shape::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Shadow::Plain</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>240</width>
<height>109</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="verticalSpacing">
<number>10</number>
</property>
<item row="1" column="1">
<widget class="QLabel" name="label_NameError">
<property name="visible">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0)</string>
</property>
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="NewLayoutForm" name="newLayoutForm" native="true"/>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEdit_LayoutID">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The constant that will be used to refer to this layout. It cannot be the same as any other existing layout.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="placeholderText">
<string>LAYOUT_MY_NEW_LAYOUT</string>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_Name">
<property name="text">
<string>Layout Name</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_LayoutID">
<property name="text">
<string>Layout ID</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_Name">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The name of the new layout. The name cannot be the same as any other existing layout.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="placeholderText">
<string>MyNewLayout</string>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_LayoutIDError">
<property name="visible">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0)</string>
</property>
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="8" column="0" colspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<widget class="QLabel" name="label_GenericError">
<property name="visible">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0)</string>
</property>
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok|QDialogButtonBox::StandardButton::Reset</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>NewLayoutForm</class>
<extends>QWidget</extends>
<header>newlayoutform.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

244
forms/newlayoutform.ui Normal file
View File

@@ -0,0 +1,244 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>NewLayoutForm</class>
<widget class="QWidget" name="NewLayoutForm">
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QGroupBox" name="groupBox_MapDimensions">
<property name="title">
<string>Map Dimensions</string>
</property>
<layout class="QFormLayout" name="formLayout_7">
<item row="0" column="0">
<widget class="QLabel" name="label_MapWidth">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Width</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="NoScrollSpinBox" name="spinBox_MapWidth">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Width (in metatiles) of the new map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="minimum">
<number>1</number>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_MapHeight">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Height</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="NoScrollSpinBox" name="spinBox_MapHeight">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Height (in metatiles) of the new map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="minimum">
<number>1</number>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QLabel" name="label_MapDimensionsError">
<property name="visible">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0)</string>
</property>
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_BorderDimensions">
<property name="title">
<string>Border Dimensions</string>
</property>
<layout class="QFormLayout" name="formLayout_6">
<item row="0" column="0">
<widget class="QLabel" name="label_BorderWidth">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Width</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="NoScrollSpinBox" name="spinBox_BorderWidth">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Width (in metatiles) of the new map's border.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="minimum">
<number>1</number>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="NoScrollSpinBox" name="spinBox_BorderHeight">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Height (in metatiles) of the new map's border.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="minimum">
<number>1</number>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_BorderHeight">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Height</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_Tilesets">
<property name="title">
<string>Tilesets</string>
</property>
<layout class="QFormLayout" name="formLayout_5">
<item row="0" column="0">
<widget class="QLabel" name="label_PrimaryTileset">
<property name="text">
<string>Primary</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="NoScrollComboBox" name="comboBox_PrimaryTileset">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The primary tileset for the new map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
<property name="insertPolicy">
<enum>QComboBox::InsertPolicy::NoInsert</enum>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="label_PrimaryTilesetError">
<property name="visible">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0)</string>
</property>
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_SecondaryTileset">
<property name="text">
<string>Secondary</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="NoScrollComboBox" name="comboBox_SecondaryTileset">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The secondary tileset for the new map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
<property name="insertPolicy">
<enum>QComboBox::InsertPolicy::NoInsert</enum>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QLabel" name="label_SecondaryTilesetError">
<property name="visible">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0)</string>
</property>
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>NoScrollComboBox</class>
<extends>QComboBox</extends>
<header>noscrollcombobox.h</header>
</customwidget>
<customwidget>
<class>NoScrollSpinBox</class>
<extends>QSpinBox</extends>
<header>noscrollspinbox.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>NewLocationDialog</class>
<widget class="QDialog" name="NewLocationDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>252</width>
<height>124</height>
</rect>
</property>
<property name="modal">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QFrame" name="form">
<layout class="QFormLayout" name="formLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_IdName">
<property name="text">
<string>Location ID</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_IdName">
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_IdNameError">
<property name="visible">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0)</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEdit_DisplayName"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_DisplayName">
<property name="text">
<string>Location Name</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
</property>
<property name="centerButtons">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@@ -17,10 +17,10 @@
<item>
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
<enum>QFrame::Shape::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
<enum>QFrame::Shadow::Plain</enum>
</property>
<layout class="QFormLayout" name="formLayout_2">
<property name="leftMargin">
@@ -45,7 +45,7 @@
<item row="0" column="1">
<widget class="NoScrollComboBox" name="comboBox_Map">
<property name="toolTip">
<string>The name of the map to connect to the current map.</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The name of the map to connect to the current map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
@@ -59,7 +59,7 @@
<item row="1" column="1">
<widget class="NoScrollComboBox" name="comboBox_Direction">
<property name="toolTip">
<string>Where the connected map should be positioned relative to the current map.</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Where the connected map should be positioned relative to the current map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
@@ -82,10 +82,10 @@
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
</property>
</widget>
</item>

253
forms/newmapdialog.ui Normal file
View File

@@ -0,0 +1,253 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>NewMapDialog</class>
<widget class="QDialog" name="NewMapDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>559</width>
<height>614</height>
</rect>
</property>
<property name="windowTitle">
<string>New Map Options</string>
</property>
<property name="sizeGripEnabled">
<bool>true</bool>
</property>
<property name="modal">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="frameShape">
<enum>QFrame::Shape::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Shadow::Plain</enum>
</property>
<property name="sizeAdjustPolicy">
<enum>QAbstractScrollArea::SizeAdjustPolicy::AdjustToContents</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>535</width>
<height>550</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="verticalSpacing">
<number>10</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_Name">
<property name="text">
<string>Map Name</string>
</property>
</widget>
</item>
<item row="11" column="0" colspan="2">
<widget class="QWidget" name="widget_HeaderData" native="true">
<layout class="QVBoxLayout" name="layout_HeaderData">
<property name="sizeConstraint">
<enum>QLayout::SizeConstraint::SetMinAndMaxSize</enum>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
</layout>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_GroupError">
<property name="visible">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0)</string>
</property>
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_NameError">
<property name="visible">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0)</string>
</property>
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_LayoutID">
<property name="text">
<string>Layout ID</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_Group">
<property name="text">
<string>Map Group</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="NoScrollComboBox" name="comboBox_LayoutID">
<property name="editable">
<bool>true</bool>
</property>
<property name="insertPolicy">
<enum>QComboBox::InsertPolicy::NoInsert</enum>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QCheckBox" name="checkBox_CanFlyTo">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If checked, a Heal Location will be added to this map automatically.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QLabel" name="label_LayoutIDError">
<property name="visible">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0)</string>
</property>
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="7" column="0" colspan="2">
<widget class="NewLayoutForm" name="newLayoutForm" native="true"/>
</item>
<item row="2" column="1">
<widget class="NoScrollComboBox" name="comboBox_Group">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The name of the group this map will be added to.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
<property name="insertPolicy">
<enum>QComboBox::InsertPolicy::NoInsert</enum>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_CanFlyTo">
<property name="text">
<string>Can Fly To</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_Name">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The name of the new map. The name cannot be the same as any other existing map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="placeholderText">
<string>MyNewMap</string>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="12" column="0" colspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<widget class="QLabel" name="label_GenericError">
<property name="visible">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0)</string>
</property>
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok|QDialogButtonBox::StandardButton::Reset</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>NewLayoutForm</class>
<extends>QWidget</extends>
<header>newlayoutform.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>NoScrollComboBox</class>
<extends>QComboBox</extends>
<header>noscrollcombobox.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>NewMapGroupDialog</class>
<widget class="QDialog" name="NewMapGroupDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>252</width>
<height>87</height>
</rect>
</property>
<property name="modal">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QFrame" name="form">
<layout class="QFormLayout" name="formLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_Name">
<property name="text">
<string>Map Group Name</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_Name">
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_NameError">
<property name="visible">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0)</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
</property>
<property name="centerButtons">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@@ -1,414 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>NewMapPopup</class>
<widget class="QMainWindow" name="NewMapPopup">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>410</width>
<height>621</height>
</rect>
</property>
<property name="windowTitle">
<string>New Map Options</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1">
<widget class="QFrame" name="frame_NewMap_Options">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QFormLayout" name="formLayout_2">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<property name="verticalSpacing">
<number>12</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_newMap_Name">
<property name="text">
<string>Name</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_NewMap_Name">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The name of the new map. If the name is invalid (red), it will be replaced with the default name of a new map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_NewMap_Group">
<property name="text">
<string>Group</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="NoScrollComboBox" name="comboBox_NewMap_Group">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;New map group.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_NewMap_Width">
<property name="text">
<string>Map Width</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="spinBox_NewMap_Width">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Width (in blocks) of the new map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="maximum">
<number>200</number>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_NewMap_Height">
<property name="text">
<string>Map Height</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QSpinBox" name="spinBox_NewMap_Height">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Height (in blocks) of the new map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="maximum">
<number>200</number>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_NewMap_BorderWidth">
<property name="text">
<string>Border Width</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QSpinBox" name="spinBox_NewMap_BorderWidth">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Width (in blocks) of the new map's border.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="maximum">
<number>255</number>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_NewMap_BorderHeight">
<property name="text">
<string>Border Height</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QSpinBox" name="spinBox_NewMap_BorderHeight">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Height (in blocks) of the new map's border.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="maximum">
<number>255</number>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_NewMap_Primary_Tileset">
<property name="text">
<string>Primary Tileset</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="NoScrollComboBox" name="comboBox_NewMap_Primary_Tileset">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The primary tileset for the new map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_NewMap_Secondary_Tileset">
<property name="text">
<string>Secondary Tileset</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="NoScrollComboBox" name="comboBox_NewMap_Secondary_Tileset">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The secondary tileset for the new map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_NewMap_Type">
<property name="text">
<string>Type</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="NoScrollComboBox" name="comboBox_NewMap_Type">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The map type is a general attribute, which is used for many different things. For example. it determines whether biking or running is allowed.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_NewMap_Location">
<property name="text">
<string>Location</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="NoScrollComboBox" name="comboBox_NewMap_Location">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The section of the region map which the map is grouped under. This also determines the name of the map that is displayed when the player enters it.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_Song">
<property name="text">
<string>Song</string>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="NoScrollComboBox" name="comboBox_NewMap_Song">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The default background music for this map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="label_NewMap_Flyable">
<property name="text">
<string>Can Fly To</string>
</property>
</widget>
</item>
<item row="11" column="1">
<widget class="QCheckBox" name="checkBox_NewMap_Flyable">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Whether to add a heal location to the new map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="12" column="0">
<widget class="QLabel" name="label_NewMap_Show_Location">
<property name="text">
<string>Show Location Name</string>
</property>
</widget>
</item>
<item row="12" column="1">
<widget class="QCheckBox" name="checkBox_NewMap_Show_Location">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Whether or not to display the location name when the player enters the map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="13" column="0">
<widget class="QLabel" name="label_NewMap_Allow_Running">
<property name="text">
<string>Allow Running</string>
</property>
</widget>
</item>
<item row="13" column="1">
<widget class="QCheckBox" name="checkBox_NewMap_Allow_Running">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Allows the player to use Running Shoes&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="14" column="0">
<widget class="QLabel" name="label_NewMap_Allow_Biking">
<property name="text">
<string>Allow Biking</string>
</property>
</widget>
</item>
<item row="14" column="1">
<widget class="QCheckBox" name="checkBox_NewMap_Allow_Biking">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Allows the player to use a Bike&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="15" column="0">
<widget class="QLabel" name="label_NewMap_Allow_Escape_Rope">
<property name="text">
<string>Allow Dig &amp; Escape Rope</string>
</property>
</widget>
</item>
<item row="15" column="1">
<widget class="QCheckBox" name="checkBox_NewMap_Allow_Escape_Rope">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Allows the player to use Dig or Escape Rope&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="16" column="0">
<widget class="QLabel" name="label_NewMap_Floor_Number">
<property name="text">
<string>Floor Number</string>
</property>
</widget>
</item>
<item row="16" column="1">
<widget class="QSpinBox" name="spinBox_NewMap_Floor_Number">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Floor number to be used for maps with elevators.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="maximum">
<number>127</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="1">
<widget class="QPushButton" name="pushButton_NewMap_Accept">
<property name="text">
<string>Accept</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QFrame" name="frame_NewMap_Warning">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="visible">
<bool>false</bool>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QToolButton" name="toolButton_NewMap_DimensionWarning">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>!</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_NewMap_WarningMessage">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0)</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>410</width>
<height>21</height>
</rect>
</property>
</widget>
<widget class="QStatusBar" name="statusbar"/>
</widget>
<customwidgets>
<customwidget>
<class>NoScrollComboBox</class>
<extends>QComboBox</extends>
<header>noscrollcombobox.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@@ -6,238 +6,151 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>216</height>
<width>450</width>
<height>209</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Add new Tileset</string>
</property>
<widget class="QWidget" name="gridWidget" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>216</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>10</number>
</property>
<property name="topMargin">
<number>10</number>
</property>
<property name="rightMargin">
<number>10</number>
</property>
<property name="bottomMargin">
<number>10</number>
</property>
<property name="verticalSpacing">
<number>6</number>
</property>
<item row="4" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
<property name="modal">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QFrame" name="form">
<layout class="QFormLayout" name="formLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
<property name="topMargin">
<number>0</number>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QFrame" name="frame">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<property name="rightMargin">
<number>0</number>
</property>
<property name="minimumSize">
<size>
<width>380</width>
<height>161</height>
</size>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<widget class="QWidget" name="formLayoutWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>380</width>
<height>155</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout">
<property name="horizontalSpacing">
<number>6</number>
<item row="0" column="0">
<widget class="QLabel" name="label_Name">
<property name="text">
<string>Name</string>
</property>
<property name="leftMargin">
<number>10</number>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_Name">
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
<property name="topMargin">
<number>10</number>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_NameError">
<property name="visible">
<bool>false</bool>
</property>
<property name="rightMargin">
<number>10</number>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0)</string>
</property>
<item row="0" column="0">
<widget class="QLabel" name="nameLabel">
<property name="text">
<string>Name</string>
</property>
</widget>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_Type">
<property name="text">
<string>Type</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="NoScrollComboBox" name="comboBox_Type">
<property name="editable">
<bool>false</bool>
</property>
<item>
<property name="text">
<string>Primary</string>
</property>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="nameLineEdit">
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
<item>
<property name="text">
<string>Secondary</string>
</property>
</item>
<item row="1" column="0">
<widget class="QLabel" name="typeLabel">
<property name="text">
<string>Type</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="typeComboBox">
<item>
<property name="text">
<string>Primary</string>
</property>
</item>
<item>
<property name="text">
<string>Secondary</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="pathLabel">
<property name="text">
<string>Path</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="pathLineEdit">
<property name="enabled">
<bool>false</bool>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="symbolNameLabel">
<property name="text">
<string>Symbol Name</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="symbolNameLineEdit">
<property name="enabled">
<bool>false</bool>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="fillLabel">
<property name="text">
<string>Checkerboard Fill</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="fillCheckBox">
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item row="5" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
<property name="centerButtons">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_CheckerboardFill">
<property name="text">
<string>Checkerboard Fill</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="checkBox_CheckerboardFill">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If enabled, the metatiles in the new tileset will be filled alternately with tile 1 or tile 2. If not enabled, all the metatiles will be filled with tile 0.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QLabel" name="label_GenericError">
<property name="visible">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0)</string>
</property>
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
</property>
<property name="centerButtons">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>NoScrollComboBox</class>
<extends>QComboBox</extends>
<header>noscrollcombobox.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>NewTilesetDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>NewTilesetDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>

View File

@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>522</width>
<height>493</height>
<width>530</width>
<height>432</height>
</rect>
</property>
<property name="windowTitle">
@@ -19,205 +19,302 @@
<number>9</number>
</property>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Miscellaneous</string>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="checkBox_MonitorProjectFiles">
<property name="toolTip">
<string>If checked, a prompt to reload your project will appear if relevant project files are edited</string>
</property>
<property name="text">
<string>Monitor project files</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_OpenRecentProject">
<property name="toolTip">
<string>If checked, Porymap will automatically open your most recently opened project on startup</string>
</property>
<property name="text">
<string>Open recent project on launch</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_CheckForUpdates">
<property name="toolTip">
<string>If checked, Porymap will automatically alert you on startup if a new release is available</string>
</property>
<property name="text">
<string>Automatically check for updates</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_Themes">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Application Theme</string>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_TextEditor">
<property name="title">
<string>Preferred Text Editor</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="2" column="0">
<widget class="QScrollArea" name="scrollArea_TextEditor">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_TextEditor">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>492</width>
<height>327</height>
</rect>
<widget class="QWidget" name="tab_General">
<attribute name="title">
<string>General</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_5">
<property name="leftMargin">
<number>12</number>
</property>
<property name="rightMargin">
<number>12</number>
</property>
<property name="bottomMargin">
<number>12</number>
</property>
<item>
<widget class="QCheckBox" name="checkBox_MonitorProjectFiles">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If checked, a prompt to reload your project will appear if relevant project files are edited&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="sizeConstraint">
<enum>QLayout::SetMinimumSize</enum>
</property>
<item row="6" column="0" colspan="2">
<widget class="QLabel" name="label_TextEditorGotoLineHelp">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;When this command is set a button will appear next to the &lt;span style=&quot; font-weight:600; font-style:italic;&quot;&gt;Script&lt;/span&gt; combo-box in the &lt;span style=&quot; font-weight:600; font-style:italic;&quot;&gt;Events&lt;/span&gt; tab which executes this command.&lt;span style=&quot; font-weight:600;&quot;&gt; %F&lt;/span&gt; will be substituted with the file path of the script and &lt;span style=&quot; font-weight:600;&quot;&gt;%L&lt;/span&gt; will be substituted with the line number of the script in that file. &lt;span style=&quot; font-weight:600;&quot;&gt;%F &lt;/span&gt;&lt;span style=&quot; font-style:italic;&quot;&gt;must&lt;/span&gt; be given if &lt;span style=&quot; font-weight:600;&quot;&gt;%L&lt;/span&gt; is given. If &lt;span style=&quot; font-weight:600;&quot;&gt;%F&lt;/span&gt; is &lt;span style=&quot; font-style:italic;&quot;&gt;not&lt;/span&gt; given then the script's file path will be added to the end of the command. If the script can't be found then the current map's scripts file is opened.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_TextEditorGotoLine">
<property name="text">
<string>Goto Line Command</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_TextEditorOpenFolder">
<property name="text">
<string>Monitor project files</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_OpenRecentProject">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If checked, Porymap will automatically open your most recently opened project on startup&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Open recent project on launch</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_CheckForUpdates">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If checked, Porymap will automatically alert you on startup if a new release is available&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Automatically check for updates</string>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_Themes">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Application Theme</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_Events">
<attribute name="title">
<string>Events</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="leftMargin">
<number>12</number>
</property>
<property name="rightMargin">
<number>12</number>
</property>
<property name="bottomMargin">
<number>12</number>
</property>
<item>
<widget class="QCheckBox" name="checkBox_DisableEventWarning">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If checked, no warning will be shown when deleting an event that has an associated #define that may also be deleted.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Disable warning when deleting events with IDs</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_AutocompleteAllScripts">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If checked, the list of suggestions when typing in an Event's Script field will include all global script labels in the project. Enabling this setting will make Porymap's startup slower.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Autocomplete Script labels using all possible scripts</string>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_EventSelectionMode">
<property name="title">
<string>Selection Mode</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_EventSelectionMode">
<item>
<widget class="QRadioButton" name="radioButton_OnSprite">
<property name="toolTip">
<string>The shell command for your preferred text editor (possibly an absolute path if the program doesn't exist in your PATH).</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If enabled, an event can be selected by clicking directly on the opaque pixels of its sprite. This may be preferable when events are overlapping.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="placeholderText">
<string>e.g. code %D</string>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="label_TextEditorOpenFolderHelp">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;This is the command that is executed when clicking &lt;span style=&quot; font-weight:600; font-style:italic;&quot;&gt;Open Project in Text Editor&lt;/span&gt; in the &lt;span style=&quot; font-weight:600; font-style:italic;&quot;&gt;Tools&lt;/span&gt; menu. &lt;span style=&quot; font-weight:600;&quot;&gt;%D&lt;/span&gt; will be substituted with the project's root directory. If &lt;span style=&quot; font-weight:600;&quot;&gt;%D&lt;/span&gt; is &lt;span style=&quot; font-style:italic;&quot;&gt;not&lt;/span&gt; specified then the project directory will be added to the end of the command.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
<string>Select by clicking on sprite</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_TextEditorOpenFolder">
<property name="text">
<string>Open Directory Command</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="lineEdit_TextEditorGotoLine">
<item>
<widget class="QRadioButton" name="radioButton_WithinRect">
<property name="toolTip">
<string>The shell command for your preferred text editor to open a file to a specific line number (possibly an absolute path if the program doesn't exist in your PATH).</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If enabled, an event can be selected by clicking anywhere within its sprite dimensions. This may be preferable for events with small or mostly transparent sprites.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="placeholderText">
<string>e.g. code --goto %F:%L</string>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
<property name="text">
<string>Select by clicking within bounding rectangle</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>15</height>
</size>
</property>
</spacer>
</item>
<item row="7" column="0" colspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Text Editor</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="leftMargin">
<number>12</number>
</property>
<property name="rightMargin">
<number>12</number>
</property>
<property name="bottomMargin">
<number>12</number>
</property>
<item>
<widget class="QScrollArea" name="scrollArea_TextEditor">
<property name="frameShape">
<enum>QFrame::Shape::NoFrame</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_TextEditor">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>476</width>
<height>343</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="sizeConstraint">
<enum>QLayout::SizeConstraint::SetMinimumSize</enum>
</property>
<item row="6" column="0" colspan="2">
<widget class="QLabel" name="label_TextEditorGotoLineHelp">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;When this command is set a button will appear next to the &lt;span style=&quot; font-weight:600; font-style:italic;&quot;&gt;Script&lt;/span&gt; combo-box in the &lt;span style=&quot; font-weight:600; font-style:italic;&quot;&gt;Events&lt;/span&gt; tab which executes this command.&lt;span style=&quot; font-weight:600;&quot;&gt; %F&lt;/span&gt; will be substituted with the file path of the script and &lt;span style=&quot; font-weight:600;&quot;&gt;%L&lt;/span&gt; will be substituted with the line number of the script in that file. &lt;span style=&quot; font-weight:600;&quot;&gt;%F &lt;/span&gt;&lt;span style=&quot; font-style:italic;&quot;&gt;must&lt;/span&gt; be given if &lt;span style=&quot; font-weight:600;&quot;&gt;%L&lt;/span&gt; is given. If &lt;span style=&quot; font-weight:600;&quot;&gt;%F&lt;/span&gt; is &lt;span style=&quot; font-style:italic;&quot;&gt;not&lt;/span&gt; given then the script's file path will be added to the end of the command. If the script can't be found then the current map's scripts file is opened.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_TextEditorGotoLine">
<property name="text">
<string>Goto Line Command</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_TextEditorOpenFolder">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The shell command for your preferred text editor (possibly an absolute path if the program doesn't exist in your PATH).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="placeholderText">
<string>e.g. code %D</string>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="label_TextEditorOpenFolderHelp">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;This is the command that is executed when clicking &lt;span style=&quot; font-weight:600; font-style:italic;&quot;&gt;Open Project in Text Editor&lt;/span&gt; in the &lt;span style=&quot; font-weight:600; font-style:italic;&quot;&gt;Tools&lt;/span&gt; menu. &lt;span style=&quot; font-weight:600;&quot;&gt;%D&lt;/span&gt; will be substituted with the project's root directory. If &lt;span style=&quot; font-weight:600;&quot;&gt;%D&lt;/span&gt; is &lt;span style=&quot; font-style:italic;&quot;&gt;not&lt;/span&gt; specified then the project directory will be added to the end of the command.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_TextEditorOpenFolder">
<property name="text">
<string>Open Directory Command</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="lineEdit_TextEditorGotoLine">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The shell command for your preferred text editor to open a file to a specific line number (possibly an absolute path if the program doesn't exist in your PATH).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="placeholderText">
<string>e.g. code --goto %F:%L</string>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Policy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>15</height>
</size>
</property>
</spacer>
</item>
<item row="7" column="0" colspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
<set>QDialogButtonBox::StandardButton::Apply|QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
</property>
</widget>
</item>

File diff suppressed because it is too large Load Diff

View File

@@ -18,10 +18,10 @@
<item row="0" column="1">
<widget class="QFrame" name="frame_regionSelector">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
<enum>QFrame::Shape::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
<enum>QFrame::Shadow::Plain</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
@@ -46,14 +46,14 @@
<item>
<widget class="QComboBox" name="comboBox_regionSelector">
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContents</enum>
<enum>QComboBox::SizeAdjustPolicy::AdjustToContents</enum>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -83,7 +83,7 @@
</size>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
<enum>Qt::FocusPolicy::StrongFocus</enum>
</property>
<property name="minimum">
<number>10</number>
@@ -95,10 +95,10 @@
<number>30</number>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="tickPosition">
<enum>QSlider::NoTicks</enum>
<enum>QSlider::TickPosition::NoTicks</enum>
</property>
<property name="tickInterval">
<number>1</number>
@@ -108,7 +108,7 @@
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -123,7 +123,7 @@
<item row="1" column="1">
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="childrenCollapsible">
<bool>false</bool>
@@ -160,7 +160,7 @@
<x>0</x>
<y>0</y>
<width>466</width>
<height>351</height>
<height>336</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_18">
@@ -182,7 +182,7 @@
<item row="1" column="2">
<spacer name="horizontalSpacer_RMBI_East">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -207,17 +207,17 @@
<bool>false</bool>
</property>
<property name="sizeAdjustPolicy">
<enum>QAbstractScrollArea::AdjustIgnored</enum>
<enum>QAbstractScrollArea::SizeAdjustPolicy::AdjustIgnored</enum>
</property>
<property name="dragMode">
<enum>QGraphicsView::NoDrag</enum>
<enum>QGraphicsView::DragMode::NoDrag</enum>
</property>
</widget>
</item>
<item row="0" column="1">
<spacer name="verticalSpacer_RMBI_North">
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -230,7 +230,7 @@
<item row="2" column="1">
<spacer name="verticalSpacer_RMBI_South">
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -243,7 +243,7 @@
<item row="1" column="0">
<spacer name="horizontalSpacer_RMBI_West">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -281,7 +281,7 @@
<x>0</x>
<y>0</y>
<width>466</width>
<height>351</height>
<height>336</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_19">
@@ -315,17 +315,17 @@
<bool>false</bool>
</property>
<property name="sizeAdjustPolicy">
<enum>QAbstractScrollArea::AdjustIgnored</enum>
<enum>QAbstractScrollArea::SizeAdjustPolicy::AdjustIgnored</enum>
</property>
<property name="dragMode">
<enum>QGraphicsView::NoDrag</enum>
<enum>QGraphicsView::DragMode::NoDrag</enum>
</property>
</widget>
</item>
<item row="1" column="0">
<spacer name="horizontalSpacer_RML_West">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -338,7 +338,7 @@
<item row="2" column="1">
<spacer name="verticalSpacer_RML_South">
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -351,7 +351,7 @@
<item row="1" column="2">
<spacer name="horizontalSpacer_RML_East">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -364,7 +364,7 @@
<item row="0" column="1">
<spacer name="verticalSpacer_RML_North">
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -402,7 +402,7 @@
<x>0</x>
<y>0</y>
<width>466</width>
<height>351</height>
<height>336</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_24">
@@ -436,17 +436,17 @@
<bool>false</bool>
</property>
<property name="sizeAdjustPolicy">
<enum>QAbstractScrollArea::AdjustIgnored</enum>
<enum>QAbstractScrollArea::SizeAdjustPolicy::AdjustIgnored</enum>
</property>
<property name="dragMode">
<enum>QGraphicsView::NoDrag</enum>
<enum>QGraphicsView::DragMode::NoDrag</enum>
</property>
</widget>
</item>
<item row="1" column="0">
<spacer name="horizontalSpacer_RME_West">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -459,7 +459,7 @@
<item row="2" column="1">
<spacer name="verticalSpacer_RME_South">
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -472,7 +472,7 @@
<item row="1" column="2">
<spacer name="horizontalSpacer_RME_East">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -485,7 +485,7 @@
<item row="0" column="1">
<spacer name="verticalSpacer_RME_North">
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -529,19 +529,19 @@
</size>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOn</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAsNeeded</enum>
<enum>Qt::ScrollBarPolicy::ScrollBarAsNeeded</enum>
</property>
<property name="sizeAdjustPolicy">
<enum>QAbstractScrollArea::AdjustIgnored</enum>
<enum>QAbstractScrollArea::SizeAdjustPolicy::AdjustIgnored</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignHCenter|Qt::AlignTop</set>
<set>Qt::AlignmentFlag::AlignHCenter|Qt::AlignmentFlag::AlignTop</set>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_RM_Metatiles">
<property name="enabled">
@@ -552,7 +552,7 @@
<x>8</x>
<y>0</y>
<width>278</width>
<height>342</height>
<height>327</height>
</rect>
</property>
<property name="sizePolicy">
@@ -563,7 +563,7 @@
</property>
<layout class="QGridLayout" name="gridLayout_21">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
<enum>QLayout::SizeConstraint::SetDefaultConstraint</enum>
</property>
<property name="leftMargin">
<number>0</number>
@@ -583,7 +583,7 @@
<item row="1" column="1">
<spacer name="verticalSpacer_RMM_South">
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -596,7 +596,7 @@
<item row="0" column="2">
<spacer name="horizontalSpacer_RMM_East">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -618,20 +618,20 @@
</sizepolicy>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOff</enum>
</property>
<property name="sizeAdjustPolicy">
<enum>QAbstractScrollArea::AdjustIgnored</enum>
<enum>QAbstractScrollArea::SizeAdjustPolicy::AdjustIgnored</enum>
</property>
</widget>
</item>
<item row="0" column="0">
<spacer name="horizontalSpacer_RMM_West">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -648,10 +648,10 @@
<item row="0" column="0">
<widget class="QFrame" name="frame_tileOptions">
<property name="frameShape">
<enum>QFrame::Panel</enum>
<enum>QFrame::Shape::Panel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
<enum>QFrame::Shadow::Sunken</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="leftMargin">
@@ -681,7 +681,7 @@
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBox_tilePalette">
<widget class="NoScrollSpinBox" name="spinBox_tilePalette">
<property name="maximum">
<number>15</number>
</property>
@@ -719,10 +719,10 @@
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
<enum>QFrame::Shape::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
<enum>QFrame::Shadow::Raised</enum>
</property>
<property name="lineWidth">
<number>1</number>
@@ -747,7 +747,7 @@
<item>
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -760,10 +760,10 @@
<item>
<layout class="QGridLayout" name="gridLayout_22">
<property name="sizeConstraint">
<enum>QLayout::SetNoConstraint</enum>
<enum>QLayout::SizeConstraint::SetNoConstraint</enum>
</property>
<item row="0" column="1">
<widget class="NoScrollComboBox" name="comboBox_RM_ConnectedMap" native="true">
<widget class="NoScrollComboBox" name="comboBox_RM_ConnectedMap">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -771,10 +771,10 @@
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The section of the region map which the map is grouped under. This also determines the name of the map that is display when the player enters it.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The section of the region map which the map is grouped under. This also determines the name of the map that is displayed when the player enters it.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable" stdset="0">
<bool>true</bool>
<property name="editable">
<bool>false</bool>
</property>
</widget>
</item>
@@ -803,7 +803,7 @@
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -816,10 +816,10 @@
<item>
<layout class="QGridLayout" name="gridLayout_8">
<item row="1" column="1">
<widget class="QSpinBox" name="spinBox_RM_LayoutHeight"/>
<widget class="NoScrollSpinBox" name="spinBox_RM_LayoutHeight"/>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="spinBox_RM_LayoutWidth"/>
<widget class="NoScrollSpinBox" name="spinBox_RM_LayoutWidth"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_7">
@@ -862,10 +862,10 @@
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
<enum>QFrame::Shape::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
<enum>QFrame::Shadow::Raised</enum>
</property>
<property name="lineWidth">
<number>1</number>
@@ -874,15 +874,15 @@
<item>
<layout class="QGridLayout" name="gridLayout_23">
<property name="sizeConstraint">
<enum>QLayout::SetNoConstraint</enum>
<enum>QLayout::SizeConstraint::SetNoConstraint</enum>
</property>
<item row="3" column="1">
<item row="2" column="1">
<widget class="QFrame" name="frame_2">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
<enum>QFrame::Shape::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
<enum>QFrame::Shadow::Raised</enum>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
@@ -893,10 +893,10 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="spinBox_RM_Entry_width"/>
<widget class="NoScrollSpinBox" name="spinBox_RM_Entry_width"/>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="spinBox_RM_Entry_height"/>
<widget class="NoScrollSpinBox" name="spinBox_RM_Entry_height"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_5">
@@ -909,7 +909,7 @@
</widget>
</item>
<item row="0" column="1">
<widget class="NoScrollComboBox" name="comboBox_RM_Entry_MapSection" native="true">
<widget class="NoScrollComboBox" name="comboBox_RM_Entry_MapSection">
<property name="enabled">
<bool>true</bool>
</property>
@@ -922,25 +922,25 @@
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The section of the region map which the map is grouped under. This also determines the name of the map that is display when the player enters it.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable" stdset="0">
<bool>true</bool>
<property name="editable">
<bool>false</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_RM_CityMap_2">
<item row="2" column="0">
<widget class="QLabel" name="label_Dimensions">
<property name="text">
<string>Dimensions</string>
</property>
</widget>
</item>
<item row="2" column="1">
<item row="1" column="1">
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
<enum>QFrame::Shape::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
<enum>QFrame::Shadow::Raised</enum>
</property>
<layout class="QFormLayout" name="formLayout_2">
<item row="0" column="0">
@@ -951,10 +951,10 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="spinBox_RM_Entry_x"/>
<widget class="NoScrollSpinBox" name="spinBox_RM_Entry_x"/>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="spinBox_RM_Entry_y"/>
<widget class="NoScrollSpinBox" name="spinBox_RM_Entry_y"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
@@ -966,7 +966,7 @@
</layout>
</widget>
</item>
<item row="2" column="0">
<item row="1" column="0">
<widget class="QLabel" name="label_RM_Location">
<property name="text">
<string>Location</string>
@@ -980,16 +980,6 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Map Name</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEdit_RM_MapName"/>
</item>
</layout>
</item>
<item>
@@ -1002,7 +992,7 @@
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -1037,7 +1027,7 @@
</size>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
<enum>Qt::FocusPolicy::StrongFocus</enum>
</property>
<property name="minimum">
<number>10</number>
@@ -1049,10 +1039,10 @@
<number>30</number>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="tickPosition">
<enum>QSlider::NoTicks</enum>
<enum>QSlider::TickPosition::NoTicks</enum>
</property>
<property name="tickInterval">
<number>1</number>
@@ -1062,7 +1052,7 @@
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -1082,7 +1072,7 @@
<x>0</x>
<y>0</y>
<width>957</width>
<height>22</height>
<height>37</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
@@ -1180,9 +1170,14 @@
<customwidgets>
<customwidget>
<class>NoScrollComboBox</class>
<extends>QWidget</extends>
<extends>QComboBox</extends>
<header>noscrollcombobox.h</header>
</customwidget>
<customwidget>
<class>NoScrollSpinBox</class>
<extends>QSpinBox</extends>
<header>noscrollspinbox.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>

View File

@@ -21,7 +21,7 @@
</property>
<layout class="QFormLayout" name="formLayout_4">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
<enum>QFormLayout::FieldGrowthPolicy::AllNonFixedFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label">
@@ -33,7 +33,7 @@
<item row="0" column="1">
<widget class="QLineEdit" name="config_alias">
<property name="toolTip">
<string>A nickname for this region map that will differentiate it from others (should be unique).</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;A nickname for this region map that will differentiate it from others (should be unique).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
@@ -131,7 +131,7 @@
</size>
</property>
<property name="toolTip">
<string>The height of the tilemap</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The height of the tilemap&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="maximum">
<number>255</number>
@@ -148,10 +148,10 @@
<item row="6" column="1">
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
<enum>QFrame::Shape::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
<enum>QFrame::Shadow::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
@@ -218,10 +218,10 @@
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Path to the tilemap binary relative to the project root.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
<enum>QFrame::Shape::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
<enum>QFrame::Shadow::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="leftMargin">
@@ -269,10 +269,10 @@
<item row="10" column="1">
<widget class="QFrame" name="frame_3">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
<enum>QFrame::Shape::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
<enum>QFrame::Shadow::Plain</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="leftMargin">
@@ -392,10 +392,10 @@
<item row="2" column="1">
<widget class="QFrame" name="frame_5">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
<enum>QFrame::Shape::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
<enum>QFrame::Shadow::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<property name="leftMargin">
@@ -487,7 +487,7 @@
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -517,7 +517,7 @@
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -590,7 +590,7 @@
<item>
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -617,7 +617,7 @@
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -646,7 +646,7 @@
<item row="9" column="0">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -659,10 +659,10 @@
<item row="9" column="1">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
</property>
</widget>
</item>

276
forms/resizelayoutpopup.ui Normal file
View File

@@ -0,0 +1,276 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ResizeLayoutPopup</class>
<widget class="QDialog" name="ResizeLayoutPopup">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>598</width>
<height>378</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Resize Layout</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="margin">
<number>8</number>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Reset</set>
</property>
<property name="centerButtons">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QGraphicsView" name="graphicsView"/>
</item>
<item row="1" column="0">
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Width</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="NoScrollSpinBox" name="spinBox_width">
<property name="minimumSize">
<size>
<width>64</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Height</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="NoScrollSpinBox" name="spinBox_height">
<property name="minimumSize">
<size>
<width>64</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="2" column="0">
<widget class="QFrame" name="frame_border">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Border Width</string>
</property>
</widget>
</item>
<item>
<widget class="NoScrollSpinBox" name="spinBox_borderWidth">
<property name="minimumSize">
<size>
<width>64</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>Border Height</string>
</property>
</widget>
</item>
<item>
<widget class="NoScrollSpinBox" name="spinBox_borderHeight">
<property name="minimumSize">
<size>
<width>64</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>NoScrollSpinBox</class>
<extends>QSpinBox</extends>
<header>noscrollspinbox.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>ResizeLayoutPopup</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>ResizeLayoutPopup</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@@ -6,12 +6,12 @@
<rect>
<x>0</x>
<y>0</y>
<width>727</width>
<height>700</height>
<width>733</width>
<height>784</height>
</rect>
</property>
<property name="focusPolicy">
<enum>Qt::ClickFocus</enum>
<enum>Qt::FocusPolicy::ClickFocus</enum>
</property>
<property name="windowTitle">
<string>Tileset Editor</string>
@@ -21,7 +21,7 @@
<item>
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="childrenCollapsible">
<bool>false</bool>
@@ -34,10 +34,10 @@
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
<enum>QFrame::Shape::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
<enum>QFrame::Shadow::Plain</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="leftMargin">
@@ -58,15 +58,15 @@
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignHCenter|Qt::AlignTop</set>
<set>Qt::AlignmentFlag::AlignHCenter|Qt::AlignmentFlag::AlignTop</set>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_Metatiles">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>223</width>
<height>593</height>
<width>239</width>
<height>659</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
@@ -88,17 +88,17 @@
<item row="0" column="0">
<widget class="NoScrollGraphicsView" name="graphicsView_Metatiles">
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOff</enum>
</property>
</widget>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -121,7 +121,7 @@
</sizepolicy>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
</widget>
</item>
@@ -129,10 +129,10 @@
</widget>
<widget class="QFrame" name="frame_Editing">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
<enum>QFrame::Shape::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
<enum>QFrame::Shadow::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
@@ -162,14 +162,14 @@
</size>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
<enum>QFrame::Shape::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
<enum>QFrame::Shadow::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="sizeConstraint">
<enum>QLayout::SetMinimumSize</enum>
<enum>QLayout::SizeConstraint::SetMinimumSize</enum>
</property>
<property name="leftMargin">
<number>0</number>
@@ -195,6 +195,70 @@
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="15" column="0" colspan="4">
<widget class="QLineEdit" name="lineEdit_metatileLabel">
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="2" colspan="3">
<widget class="NoScrollComboBox" name="comboBox_layerType">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>185</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item row="14" column="0" colspan="5">
<widget class="QLabel" name="label_metatileLabel">
<property name="text">
<string>Metatile Label (Optional)</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_BottomTop">
<property name="text">
<string>Bottom/Top</string>
</property>
</widget>
</item>
<item row="10" column="0" colspan="5">
<widget class="QLabel" name="label_terrainType">
<property name="text">
<string>Terrain Type</string>
</property>
</widget>
</item>
<item row="0" column="2" colspan="3">
<widget class="QLabel" name="label_layerType">
<property name="text">
<string>Layer Type</string>
</property>
</widget>
</item>
<item row="7" column="0" colspan="5">
<widget class="NoScrollComboBox" name="comboBox_metatileBehaviors">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="insertPolicy">
<enum>QComboBox::InsertPolicy::NoInsert</enum>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QGraphicsView" name="graphicsView_metatileLayers">
<property name="sizePolicy">
@@ -216,10 +280,10 @@
</size>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOff</enum>
</property>
</widget>
</item>
@@ -231,17 +295,23 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="insertPolicy">
<enum>QComboBox::InsertPolicy::NoInsert</enum>
</property>
</widget>
</item>
<item row="14" column="0">
<spacer name="verticalSpacer_7">
<item row="1" column="1">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Policy::Maximum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>1</height>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
@@ -254,16 +324,33 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="12" column="0" colspan="5">
<widget class="QLabel" name="label_metatileLabel">
<property name="text">
<string>Metatile Label (Optional)</string>
<property name="insertPolicy">
<enum>QComboBox::InsertPolicy::NoInsert</enum>
</property>
</widget>
</item>
<item row="13" column="4">
<item row="2" column="0" colspan="5">
<widget class="QLabel" name="label_metatileBehavior">
<property name="text">
<string>Metatile Behavior</string>
</property>
</widget>
</item>
<item row="12" column="0" colspan="5">
<widget class="QLabel" name="label_rawAttributesValue">
<property name="text">
<string>Raw Attributes Value</string>
</property>
</widget>
</item>
<item row="8" column="0" colspan="5">
<widget class="QLabel" name="label_encounterType">
<property name="text">
<string>Encounter Type</string>
</property>
</widget>
</item>
<item row="15" column="4">
<widget class="QToolButton" name="copyButton_metatileLabel">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Copies the full metatile label to the clipboard.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
@@ -277,89 +364,21 @@
</property>
</widget>
</item>
<item row="1" column="2" colspan="3">
<widget class="NoScrollComboBox" name="comboBox_layerType">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>185</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item row="7" column="0" colspan="5">
<widget class="NoScrollComboBox" name="comboBox_metatileBehaviors">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="2" colspan="3">
<widget class="QLabel" name="label_layerType">
<property name="text">
<string>Layer Type</string>
</property>
</widget>
</item>
<item row="13" column="0" colspan="4">
<widget class="QLineEdit" name="lineEdit_metatileLabel">
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0" colspan="5">
<widget class="QLabel" name="label_metatileBehavior">
<property name="text">
<string>Metatile Behavior</string>
</property>
</widget>
</item>
<item row="1" column="1">
<spacer name="horizontalSpacer_5">
<item row="16" column="0">
<spacer name="verticalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Maximum</enum>
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
<width>20</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="0" colspan="5">
<widget class="QLabel" name="label_encounterType">
<property name="text">
<string>Encounter Type</string>
</property>
</widget>
</item>
<item row="10" column="0" colspan="5">
<widget class="QLabel" name="label_terrainType">
<property name="text">
<string>Terrain Type</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_BottomTop">
<property name="text">
<string>Bottom/Top</string>
</property>
</widget>
<item row="13" column="0" colspan="5">
<widget class="UIntHexSpinBox" name="spinBox_rawAttributesValue"/>
</item>
</layout>
</widget>
@@ -399,7 +418,7 @@
<item row="1" column="1">
<widget class="QCheckBox" name="checkBox_xFlip">
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
<enum>Qt::LayoutDirection::LeftToRight</enum>
</property>
<property name="text">
<string/>
@@ -423,10 +442,10 @@
<item row="3" column="0" colspan="2">
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
<enum>QSizePolicy::Policy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -451,10 +470,10 @@
</size>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
<enum>QFrame::Shape::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
<enum>QFrame::Shadow::Plain</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="leftMargin">
@@ -497,13 +516,13 @@
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
<enum>QFrame::Shape::StyledPanel</enum>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOff</enum>
</property>
</widget>
</item>
@@ -513,7 +532,7 @@
<item row="6" column="0" colspan="2">
<spacer name="verticalSpacer_6">
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -535,15 +554,15 @@
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignHCenter|Qt::AlignTop</set>
<set>Qt::AlignmentFlag::AlignHCenter|Qt::AlignmentFlag::AlignTop</set>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_Tiles">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>455</width>
<height>232</height>
<width>445</width>
<height>237</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
@@ -562,17 +581,17 @@
<item row="0" column="0">
<widget class="NoScrollGraphicsView" name="graphicsView_Tiles">
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOff</enum>
</property>
</widget>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -589,7 +608,7 @@
<item>
<widget class="QSlider" name="horizontalSlider_TilesZoom">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
</widget>
</item>
@@ -604,8 +623,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>727</width>
<height>22</height>
<width>733</width>
<height>37</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
@@ -647,6 +666,8 @@
</property>
<addaction name="actionLayer_Grid"/>
<addaction name="actionMetatile_Grid"/>
<addaction name="actionShow_Tileset_Divider"/>
<addaction name="actionShow_Raw_Metatile_Attributes"/>
<addaction name="separator"/>
<addaction name="actionShow_Counts"/>
<addaction name="actionShow_Unused"/>
@@ -799,6 +820,22 @@
<string>Ctrl+G</string>
</property>
</action>
<action name="actionShow_Tileset_Divider">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Show Tileset Divider</string>
</property>
</action>
<action name="actionShow_Raw_Metatile_Attributes">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Show Raw Metatile Attributes</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
@@ -811,6 +848,16 @@
<extends>QGraphicsView</extends>
<header>mapview.h</header>
</customwidget>
<customwidget>
<class>UIntSpinBox</class>
<extends>QAbstractSpinBox</extends>
<header>uintspinbox.h</header>
</customwidget>
<customwidget>
<class>UIntHexSpinBox</class>
<extends>UIntSpinBox</extends>
<header location="global">uintspinbox.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="../resources/images.qrc"/>

View File

@@ -145,7 +145,7 @@
<bool>false</bool>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToMinimumContentsLength</enum>
<enum>QComboBox::AdjustToMinimumContentsLengthWithIcon</enum>
</property>
<property name="minimumContentsLength">
<number>8</number>
@@ -197,7 +197,7 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBox_Species">
<widget class="NoScrollComboBox" name="comboBox_Species">
<property name="editable">
<bool>true</bool>
</property>
@@ -237,6 +237,11 @@
<extends>QGraphicsView</extends>
<header>QtCharts</header>
</customwidget>
<customwidget>
<class>NoScrollComboBox</class>
<extends>QComboBox</extends>
<header>noscrollcombobox.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="../resources/images.qrc"/>

94
forms/wildmonsearch.ui Normal file
View File

@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>WildMonSearch</class>
<widget class="QDialog" name="WildMonSearch">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>547</width>
<height>329</height>
</rect>
</property>
<property name="windowTitle">
<string>Wild Pokémon Search</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QFrame" name="searchBar">
<property name="frameShape">
<enum>QFrame::Shape::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Shadow::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="speciesIcon">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../resources/images.qrc">:/images/pokemon_icon_placeholder.png</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="NoScrollComboBox" name="comboBox_Search">
<property name="editable">
<bool>true</bool>
</property>
<property name="insertPolicy">
<enum>QComboBox::InsertPolicy::NoInsert</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QTableWidget" name="table_Results">
<property name="columnCount">
<number>4</number>
</property>
<column/>
<column/>
<column/>
<column/>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>NoScrollComboBox</class>
<extends>QComboBox</extends>
<header>noscrollcombobox.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="../resources/images.qrc"/>
</resources>
<connections/>
</ui>

View File

@@ -11,27 +11,23 @@
#include <QDateTime>
#include <QUrl>
#include <QVersionNumber>
#include <QGraphicsPixmapItem>
#include "events.h"
#include "gridsettings.h"
static const QVersionNumber porymapVersion = QVersionNumber::fromString(PORYMAP_VERSION);
extern const QVersionNumber porymapVersion;
// In both versions the default new map border is a generic tree
#define DEFAULT_BORDER_RSE (QList<uint16_t>{0x1D4, 0x1D5, 0x1DC, 0x1DD})
#define DEFAULT_BORDER_FRLG (QList<uint16_t>{0x14, 0x15, 0x1C, 0x1D})
// Distance in pixels from the edge of a GBA screen (240x160) to the center 16x16 pixels.
#define GBA_H_DIST_TO_CENTER ((240-16)/2)
#define GBA_V_DIST_TO_CENTER ((160-16)/2)
#define CONFIG_BACKWARDS_COMPATABILITY
enum MapSortOrder {
Group = 0,
Area = 1,
Layout = 2,
};
class KeyValueConfigBase
{
public:
void save();
bool save();
void load();
virtual ~KeyValueConfigBase();
virtual void reset() = 0;
@@ -41,9 +37,11 @@ protected:
virtual QMap<QString, QString> getKeyValueMap() = 0;
virtual void init() = 0;
virtual void setUnreadKeys() = 0;
bool getConfigBool(QString key, QString value);
int getConfigInteger(QString key, QString value, int min = INT_MIN, int max = INT_MAX, int defaultValue = 0);
uint32_t getConfigUint32(QString key, QString value, uint32_t min = 0, uint32_t max = UINT_MAX, uint32_t defaultValue = 0);
static bool getConfigBool(const QString &key, const QString &value);
static int getConfigInteger(const QString &key, const QString &value, int min = INT_MIN, int max = INT_MAX, int defaultValue = 0);
static uint32_t getConfigUint32(const QString &key, const QString &value, uint32_t min = 0, uint32_t max = UINT_MAX, uint32_t defaultValue = 0);
static QColor getConfigColor(const QString &key, const QString &value, const QColor &defaultValue = Qt::black);
};
class PorymapConfig: public KeyValueConfigBase
@@ -56,7 +54,9 @@ public:
this->recentProjects.clear();
this->projectManuallyClosed = false;
this->reopenOnLaunch = true;
this->mapSortOrder = MapSortOrder::Group;
this->mapListTab = 0;
this->mapListEditGroupsEnabled = false;
this->mapListHideEmptyEnabled.clear();
this->prettyCursors = true;
this->mirrorConnectingMaps = true;
this->showDiveEmergeMaps = false;
@@ -74,19 +74,28 @@ public:
this->showGrid = false;
this->showTilesetEditorMetatileGrid = false;
this->showTilesetEditorLayerGrid = true;
this->showTilesetEditorDivider = false;
this->showTilesetEditorRawAttributes = false;
this->monitorFiles = true;
this->tilesetCheckerboardFill = true;
this->newMapHeaderSectionExpanded = false;
this->theme = "default";
this->wildMonChartTheme = "";
this->textEditorOpenFolder = "";
this->textEditorGotoLine = "";
this->paletteEditorBitDepth = 24;
this->projectSettingsTab = 0;
this->loadAllEventScripts = false;
this->warpBehaviorWarningDisabled = false;
this->eventDeleteWarningDisabled = false;
this->eventOverlayEnabled = false;
this->checkForUpdates = true;
this->lastUpdateCheckTime = QDateTime();
this->lastUpdateCheckVersion = porymapVersion;
this->rateLimitTimes.clear();
this->eventSelectionShapeMode = QGraphicsPixmapItem::MaskShape;
this->shownInGameReloadMessage = false;
this->gridSettings = GridSettings();
}
void addRecentProject(QString project);
void setRecentProjects(QStringList projects);
@@ -107,7 +116,9 @@ public:
bool reopenOnLaunch;
bool projectManuallyClosed;
MapSortOrder mapSortOrder;
int mapListTab;
bool mapListEditGroupsEnabled;
QMap<int, bool> mapListHideEmptyEnabled;
bool prettyCursors;
bool mirrorConnectingMaps;
bool showDiveEmergeMaps;
@@ -125,20 +136,31 @@ public:
bool showGrid;
bool showTilesetEditorMetatileGrid;
bool showTilesetEditorLayerGrid;
bool showTilesetEditorDivider;
bool showTilesetEditorRawAttributes;
bool monitorFiles;
bool tilesetCheckerboardFill;
bool newMapHeaderSectionExpanded;
QString theme;
QString wildMonChartTheme;
QString textEditorOpenFolder;
QString textEditorGotoLine;
int paletteEditorBitDepth;
int projectSettingsTab;
bool loadAllEventScripts;
bool warpBehaviorWarningDisabled;
bool eventDeleteWarningDisabled;
bool eventOverlayEnabled;
bool checkForUpdates;
QDateTime lastUpdateCheckTime;
QVersionNumber lastUpdateCheckVersion;
QMap<QUrl, QDateTime> rateLimitTimes;
QGraphicsPixmapItem::ShapeMode eventSelectionShapeMode;
QByteArray wildMonChartGeometry;
QByteArray newMapDialogGeometry;
QByteArray newLayoutDialogGeometry;
bool shownInGameReloadMessage;
GridSettings gridSettings;
protected:
virtual QString getConfigFilepath() override;
@@ -148,8 +170,8 @@ protected:
virtual void setUnreadKeys() override {};
private:
QString stringFromByteArray(QByteArray);
QByteArray bytesFromString(QString);
QString stringFromByteArray(const QByteArray&);
QByteArray bytesFromString(const QString&);
QStringList recentProjects;
QByteArray mainWindowGeometry;
@@ -183,14 +205,9 @@ enum ProjectIdentifier {
symbol_facing_directions,
symbol_obj_event_gfx_pointers,
symbol_pokemon_icon_table,
symbol_wild_encounters,
symbol_heal_locations_type,
symbol_heal_locations,
symbol_spawn_points,
symbol_spawn_maps,
symbol_spawn_npcs,
symbol_attribute_table,
symbol_tilesets_prefix,
symbol_dynamic_map_name,
define_obj_event_count,
define_min_level,
define_max_level,
@@ -202,6 +219,8 @@ enum ProjectIdentifier {
define_pals_total,
define_tiles_per_metatile,
define_map_size,
define_map_offset_width,
define_map_offset_height,
define_mask_metatile,
define_mask_collision,
define_mask_elevation,
@@ -213,14 +232,14 @@ enum ProjectIdentifier {
define_attribute_encounter,
define_metatile_label_prefix,
define_heal_locations_prefix,
define_spawn_prefix,
define_layout_prefix,
define_map_prefix,
define_map_dynamic,
define_map_empty,
define_map_section_prefix,
define_map_section_empty,
define_map_section_count,
define_species_prefix,
define_species_empty,
regex_behaviors,
regex_obj_event_gfx,
regex_items,
@@ -235,6 +254,12 @@ enum ProjectIdentifier {
regex_sign_facing_directions,
regex_trainer_types,
regex_music,
regex_encounter_types,
regex_terrain_types,
regex_gbapal,
regex_bpp,
pals_output_extension,
tiles_output_extension,
};
enum ProjectFilePath {
@@ -246,6 +271,7 @@ enum ProjectFilePath {
json_map_groups,
json_layouts,
json_wild_encounters,
json_heal_locations,
json_region_map_entries,
json_region_porymap_cfg,
tilesets_headers,
@@ -259,15 +285,12 @@ enum ProjectFilePath {
data_obj_event_pic_tables,
data_obj_event_gfx,
data_pokemon_gfx,
data_heal_locations,
constants_global,
constants_map_groups,
constants_items,
constants_flags,
constants_vars,
constants_weather,
constants_songs,
constants_heal_locations,
constants_pokemon,
constants_map_types,
constants_trainer_types,
@@ -275,7 +298,6 @@ enum ProjectFilePath {
constants_obj_event_movement,
constants_obj_events,
constants_event_bg,
constants_region_map_sections,
constants_metatile_labels,
constants_metatile_behaviors,
constants_species,
@@ -302,20 +324,31 @@ public:
this->defaultMetatileId = 1;
this->defaultElevation = 3;
this->defaultCollision = 0;
this->defaultMapSize = QSize(20,20);
this->defaultPrimaryTileset = "gTileset_General";
this->prefabFilepath = QString();
this->prefabImportPrompted = false;
this->tilesetsHaveCallback = true;
this->tilesetsHaveIsCompressed = true;
this->setTransparentPixelsBlack = true;
this->preserveMatchingOnlyData = false;
this->filePaths.clear();
this->eventIconPaths.clear();
this->pokemonIconPaths.clear();
this->eventsTabIconPath = QString();
this->collisionSheetPath = QString();
this->collisionSheetWidth = 2;
this->collisionSheetHeight = 16;
this->collisionSheetSize = QSize(2, 16);
this->playerViewDistance = QMargins(GBA_H_DIST_TO_CENTER, GBA_V_DIST_TO_CENTER, GBA_H_DIST_TO_CENTER, GBA_V_DIST_TO_CENTER);
this->blockMetatileIdMask = 0x03FF;
this->blockCollisionMask = 0x0C00;
this->blockElevationMask = 0xF000;
this->unusedTileNormal = 0x3014;
this->unusedTileCovered = 0x0000;
this->unusedTileSplit = 0x0000;
this->maxEventsPerGroup = 255;
this->forcedMajorVersion = 0;
this->globalConstantsFilepaths.clear();
this->globalConstants.clear();
this->identifiers.clear();
this->readKeys.clear();
}
@@ -324,13 +357,16 @@ public:
static const QStringList versionStrings;
static BaseGameVersion stringToBaseGameVersion(const QString &string);
static QString getPlayerIconPath(BaseGameVersion baseGameVersion, int character);
static QIcon getPlayerIcon(BaseGameVersion baseGameVersion, int character);
void reset(BaseGameVersion baseGameVersion);
void setFilePath(ProjectFilePath pathId, const QString &path);
void setFilePath(const QString &pathId, const QString &path);
QString getCustomFilePath(ProjectFilePath pathId);
QString getCustomFilePath(const QString &pathId);
QString getFilePath(ProjectFilePath pathId);
void setIdentifier(ProjectIdentifier id, const QString &text);
void setIdentifier(ProjectIdentifier id, QString text);
void setIdentifier(const QString &id, const QString &text);
QString getCustomIdentifier(ProjectIdentifier id);
QString getCustomIdentifier(const QString &id);
@@ -343,7 +379,7 @@ public:
QString getEventIconPath(Event::Group group);
void setPokemonIconPath(const QString &species, const QString &path);
QString getPokemonIconPath(const QString &species);
QHash<QString, QString> getPokemonIconPaths();
QMap<QString, QString> getPokemonIconPaths();
BaseGameVersion baseGameVersion;
QString projectDir;
@@ -361,6 +397,7 @@ public:
uint16_t defaultMetatileId;
uint16_t defaultElevation;
uint16_t defaultCollision;
QSize defaultMapSize;
QList<uint16_t> newMapBorderMetatileIds;
QString defaultPrimaryTileset;
QString defaultSecondaryTileset;
@@ -368,6 +405,8 @@ public:
bool prefabImportPrompted;
bool tilesetsHaveCallback;
bool tilesetsHaveIsCompressed;
bool setTransparentPixelsBlack;
bool preserveMatchingOnlyData;
int metatileAttributesSize;
uint32_t metatileBehaviorMask;
uint32_t metatileTerrainTypeMask;
@@ -376,11 +415,19 @@ public:
uint16_t blockMetatileIdMask;
uint16_t blockCollisionMask;
uint16_t blockElevationMask;
uint16_t unusedTileNormal;
uint16_t unusedTileCovered;
uint16_t unusedTileSplit;
bool mapAllowFlagsEnabled;
QString eventsTabIconPath;
QString collisionSheetPath;
int collisionSheetWidth;
int collisionSheetHeight;
QSet<uint32_t> warpBehaviors;
QSize collisionSheetSize;
QMargins playerViewDistance;
QList<uint32_t> warpBehaviors;
int maxEventsPerGroup;
int forcedMajorVersion;
QStringList globalConstantsFilepaths;
QMap<QString,QString> globalConstants;
protected:
virtual QString getConfigFilepath() override;
@@ -394,7 +441,7 @@ private:
QMap<ProjectIdentifier, QString> identifiers;
QMap<ProjectFilePath, QString> filePaths;
QMap<Event::Group, QString> eventIconPaths;
QHash<QString, QString> pokemonIconPaths;
QMap<QString, QString> pokemonIconPaths;
};
extern ProjectConfig projectConfig;
@@ -406,7 +453,7 @@ public:
reset();
}
virtual void reset() override {
this->recentMap = QString();
this->recentMapOrLayout = QString();
this->useEncounterJson = true;
this->customScripts.clear();
this->readKeys.clear();
@@ -418,7 +465,7 @@ public:
QList<bool> getCustomScriptsEnabled();
QString projectDir;
QString recentMap;
QString recentMapOrLayout;
bool useEncounterJson;
protected:

View File

@@ -0,0 +1,18 @@
#ifndef ADVANCEMAPPARSER_H
#define ADVANCEMAPPARSER_H
#include <QList>
#include <QString>
#include <QRgb>
class Project;
class Layout;
class Metatile;
namespace AdvanceMapParser {
Layout *parseLayout(const QString &filepath, bool *error, const Project *project);
QList<Metatile*> parseMetatiles(const QString &filepath, bool *error, bool primaryTileset);
QList<QRgb> parsePalette(const QString &filepath, bool *error);
};
#endif // ADVANCEMAPPARSER_H

View File

@@ -8,12 +8,13 @@
#include <QUndoCommand>
#include <QList>
#include <QPointer>
#include <QMargins>
class MapPixmapItem;
class Map;
class Layout;
class Blockdata;
class Event;
class DraggablePixmapItem;
class EventPixmapItem;
class Editor;
enum CommandId {
@@ -24,9 +25,9 @@ enum CommandId {
ID_PaintCollision,
ID_BucketFillCollision,
ID_MagicFillCollision,
ID_ResizeMap,
ID_ResizeLayout,
ID_PaintBorder,
ID_ScriptEditMap,
ID_ScriptEditLayout,
ID_EventMove,
ID_EventShift,
ID_EventCreate,
@@ -46,11 +47,18 @@ enum CommandId {
#define IDMask_EventType_Trigger (1 << 11)
#define IDMask_EventType_Heal (1 << 12)
#define IDMask_ConnectionDirection_Up (1 << 8)
#define IDMask_ConnectionDirection_Down (1 << 9)
#define IDMask_ConnectionDirection_Left (1 << 10)
#define IDMask_ConnectionDirection_Right (1 << 11)
#define IDMask_ConnectionDirection_Dive (1 << 12)
#define IDMask_ConnectionDirection_Emerge (1 << 13)
/// Implements a command to commit metatile paint actions
/// onto the map using the pencil tool.
class PaintMetatile : public QUndoCommand {
public:
PaintMetatile(Map *map,
PaintMetatile(Layout *layout,
const Blockdata &oldMetatiles, const Blockdata &newMetatiles,
unsigned actionId, QUndoCommand *parent = nullptr);
@@ -61,7 +69,7 @@ public:
int id() const override { return CommandId::ID_PaintMetatile; }
private:
Map *map;
Layout *layout;
Blockdata newMetatiles;
Blockdata oldMetatiles;
@@ -75,10 +83,10 @@ private:
/// on the metatile collision and elevation.
class PaintCollision : public PaintMetatile {
public:
PaintCollision(Map *map,
PaintCollision(Layout *layout,
const Blockdata &oldCollision, const Blockdata &newCollision,
unsigned actionId, QUndoCommand *parent = nullptr)
: PaintMetatile(map, oldCollision, newCollision, actionId, parent) {
: PaintMetatile(layout, oldCollision, newCollision, actionId, parent) {
setText("Paint Collision");
}
@@ -90,7 +98,7 @@ public:
/// Implements a command to commit paint actions on the map border.
class PaintBorder : public QUndoCommand {
public:
PaintBorder(Map *map,
PaintBorder(Layout *layout,
const Blockdata &oldBorder, const Blockdata &newBorder,
unsigned actionId, QUndoCommand *parent = nullptr);
@@ -101,7 +109,7 @@ public:
int id() const override { return CommandId::ID_PaintBorder; }
private:
Map *map;
Layout *layout;
Blockdata newBorder;
Blockdata oldBorder;
@@ -115,10 +123,10 @@ private:
/// with the bucket tool onto the map.
class BucketFillMetatile : public PaintMetatile {
public:
BucketFillMetatile(Map *map,
BucketFillMetatile(Layout *layout,
const Blockdata &oldMetatiles, const Blockdata &newMetatiles,
unsigned actionId, QUndoCommand *parent = nullptr)
: PaintMetatile(map, oldMetatiles, newMetatiles, actionId, parent) {
: PaintMetatile(layout, oldMetatiles, newMetatiles, actionId, parent) {
setText("Bucket Fill Metatiles");
}
@@ -131,10 +139,10 @@ public:
/// on the metatile collision and elevation.
class BucketFillCollision : public PaintCollision {
public:
BucketFillCollision(Map *map,
BucketFillCollision(Layout *layout,
const Blockdata &oldCollision, const Blockdata &newCollision,
QUndoCommand *parent = nullptr)
: PaintCollision(map, oldCollision, newCollision, -1, parent) {
: PaintCollision(layout, oldCollision, newCollision, -1, parent) {
setText("Flood Fill Collision");
}
@@ -148,10 +156,10 @@ public:
/// with the bucket or paint tool onto the map.
class MagicFillMetatile : public PaintMetatile {
public:
MagicFillMetatile(Map *map,
MagicFillMetatile(Layout *layout,
const Blockdata &oldMetatiles, const Blockdata &newMetatiles,
unsigned actionId, QUndoCommand *parent = nullptr)
: PaintMetatile(map, oldMetatiles, newMetatiles, actionId, parent) {
: PaintMetatile(layout, oldMetatiles, newMetatiles, actionId, parent) {
setText("Magic Fill Metatiles");
}
@@ -163,10 +171,10 @@ public:
/// Implements a command to commit magic fill collision actions.
class MagicFillCollision : public PaintCollision {
public:
MagicFillCollision(Map *map,
MagicFillCollision(Layout *layout,
const Blockdata &oldCollision, const Blockdata &newCollision,
QUndoCommand *parent = nullptr)
: PaintCollision(map, oldCollision, newCollision, -1, parent) {
: PaintCollision(layout, oldCollision, newCollision, -1, parent) {
setText("Magic Fill Collision");
}
@@ -179,7 +187,7 @@ public:
/// Implements a command to commit metatile shift actions.
class ShiftMetatiles : public QUndoCommand {
public:
ShiftMetatiles(Map *map,
ShiftMetatiles(Layout *layout,
const Blockdata &oldMetatiles, const Blockdata &newMetatiles,
unsigned actionId, QUndoCommand *parent = nullptr);
@@ -190,7 +198,7 @@ public:
int id() const override { return CommandId::ID_ShiftMetatiles; }
private:
Map *map;
Layout *layout= nullptr;
Blockdata newMetatiles;
Blockdata oldMetatiles;
@@ -201,9 +209,9 @@ private:
/// Implements a command to commit a map or border resize action.
class ResizeMap : public QUndoCommand {
class ResizeLayout : public QUndoCommand {
public:
ResizeMap(Map *map, QSize oldMapDimensions, QSize newMapDimensions,
ResizeLayout(Layout *layout, QSize oldLayoutDimensions, QMargins newLayoutMargins,
const Blockdata &oldMetatiles, const Blockdata &newMetatiles,
QSize oldBorderDimensions, QSize newBorderDimensions,
const Blockdata &oldBorder, const Blockdata &newBorder,
@@ -213,15 +221,14 @@ public:
void redo() override;
bool mergeWith(const QUndoCommand *) override { return false; }
int id() const override { return CommandId::ID_ResizeMap; }
int id() const override { return CommandId::ID_ResizeLayout; }
private:
Map *map;
Layout *layout = nullptr;
int oldMapWidth;
int oldMapHeight;
int newMapWidth;
int newMapHeight;
int oldLayoutWidth;
int oldLayoutHeight;
QMargins newLayoutMargins;
int oldBorderWidth;
int oldBorderHeight;
@@ -351,10 +358,10 @@ public:
/// Implements a command to commit map edits from the scripting API.
/// The scripting api can edit map/border blocks and dimensions.
class ScriptEditMap : public QUndoCommand {
class ScriptEditLayout : public QUndoCommand {
public:
ScriptEditMap(Map *map,
QSize oldMapDimensions, QSize newMapDimensions,
ScriptEditLayout(Layout *layout,
QSize oldLayoutDimensions, QSize newLayoutDimensions,
const Blockdata &oldMetatiles, const Blockdata &newMetatiles,
QSize oldBorderDimensions, QSize newBorderDimensions,
const Blockdata &oldBorder, const Blockdata &newBorder,
@@ -364,10 +371,10 @@ public:
void redo() override;
bool mergeWith(const QUndoCommand *) override { return false; }
int id() const override { return CommandId::ID_ScriptEditMap; }
int id() const override { return CommandId::ID_ScriptEditLayout; }
private:
Map *map;
Layout *layout = nullptr;
Blockdata newMetatiles;
Blockdata oldMetatiles;
@@ -375,10 +382,10 @@ private:
Blockdata newBorder;
Blockdata oldBorder;
int oldMapWidth;
int oldMapHeight;
int newMapWidth;
int newMapHeight;
int oldLayoutWidth;
int oldLayoutHeight;
int newLayoutWidth;
int newLayoutHeight;
int oldBorderWidth;
int oldBorderHeight;
@@ -400,7 +407,7 @@ public:
void redo() override;
bool mergeWith(const QUndoCommand *command) override;
int id() const override { return CommandId::ID_MapConnectionMove; }
int id() const override;
private:
MapConnection *connection;
@@ -421,7 +428,7 @@ public:
void undo() override;
void redo() override;
int id() const override { return CommandId::ID_MapConnectionChangeDirection; }
int id() const override;
private:
QPointer<MapConnection> connection;
@@ -443,7 +450,7 @@ public:
void undo() override;
void redo() override;
int id() const override { return CommandId::ID_MapConnectionChangeMap; }
int id() const override;
private:
QPointer<MapConnection> connection;
@@ -465,7 +472,7 @@ public:
void undo() override;
void redo() override;
int id() const override { return CommandId::ID_MapConnectionAdd; }
int id() const override;
private:
Map *map = nullptr;
@@ -485,7 +492,7 @@ public:
void undo() override;
void redo() override;
int id() const override { return CommandId::ID_MapConnectionRemove; }
int id() const override;
private:
Map *map = nullptr;

View File

@@ -10,7 +10,7 @@
#include <QPointer>
#include "orderedjson.h"
using OrderedJson = poryjson::Json;
#include "parseutil.h"
class Project;
@@ -19,7 +19,7 @@ class EventFrame;
class ObjectFrame;
class CloneObjectFrame;
class WarpFrame;
class DraggablePixmapItem;
class EventPixmapItem;
class Event;
class ObjectEvent;
@@ -34,23 +34,6 @@ class HiddenItemEvent;
class SecretBaseEvent;
class HealLocationEvent;
class EventVisitor {
public:
virtual void nothing() { }
virtual void visitObject(ObjectEvent *) = 0;
virtual void visitTrigger(TriggerEvent *) = 0;
virtual void visitSign(SignEvent *) = 0;
};
struct EventGraphics
{
QImage spritesheet;
int spriteWidth;
int spriteHeight;
bool inanimate;
};
///
/// Event base class -- purely virtual
///
@@ -65,11 +48,7 @@ public:
Event& operator=(const Event &other) = delete;
protected:
Event() {
this->spriteWidth = 16;
this->spriteHeight = 16;
this->usingSprite = false;
}
Event() {}
// public enums & static methods
public:
@@ -79,7 +58,6 @@ public:
Trigger, WeatherTrigger,
Sign, HiddenItem, SecretBase,
HealLocation,
Generic,
None,
};
@@ -92,9 +70,13 @@ public:
None,
};
// all event groups except warps have IDs that start at 1
// Normally we refer to events using their index in the list of that group's events.
// Object events often get referred to with a special "local ID", which is really just the index + 1.
// We use this local ID number in the index spinner for object events instead of the actual index.
// This distinction is only really important for object and warp events, because these are normally
// the only two groups of events that need to be explicitly referred to.
static int getIndexOffset(Event::Group group) {
return (group == Event::Group::Warp) ? 0 : 1;
return (group == Event::Group::Object) ? 1 : 0;
}
static Event::Group typeToGroup(Event::Type type) {
@@ -120,20 +102,16 @@ public:
static Event* create(Event::Type type);
static QMap<Event::Group, const QPixmap*> icons;
// standard public methods
public:
virtual Event *duplicate() = 0;
virtual Event *duplicate() const = 0;
void setMap(Map *newMap) { this->map = newMap; }
Map *getMap() const { return this->map; }
void modify();
virtual void accept(EventVisitor *) { }
void setX(int newX) { this->x = newX; }
void setY(int newY) { this->y = newY; }
void setZ(int newZ) { this->elevation = newZ; }
@@ -144,8 +122,8 @@ public:
int getZ() const { return this->elevation; }
int getElevation() const { return this->elevation; }
int getPixelX() const { return (this->x * 16) - qMax(0, (this->spriteWidth - 16) / 2); }
int getPixelY() const { return (this->y * 16) - qMax(0, this->spriteHeight - 16); }
int getPixelX() const { return (this->x * 16) - qMax(0, (pixmap.width() - 16) / 2); }
int getPixelY() const { return (this->y * 16) - qMax(0, pixmap.height() - 16); }
virtual EventFrame *getEventFrame();
virtual EventFrame *createEventFrame() = 0;
@@ -160,35 +138,34 @@ public:
virtual void setDefaultValues(Project *project);
virtual QSet<QString> getExpectedFields() = 0;
void readCustomValues(QJsonObject values);
void addCustomValuesTo(OrderedJson::object *obj);
const QMap<QString, QJsonValue> getCustomValues() { return this->customValues; }
void setCustomValues(const QMap<QString, QJsonValue> newCustomValues) { this->customValues = newCustomValues; }
virtual void loadPixmap(Project *project);
virtual QStringList getScripts() const { return QStringList(); }
QJsonObject getCustomAttributes() const { return this->customAttributes; }
void setCustomAttributes(const QJsonObject &newCustomAttributes) { this->customAttributes = newCustomAttributes; }
virtual QPixmap loadPixmap(Project *project);
void setPixmap(QPixmap newPixmap) { this->pixmap = newPixmap; }
QPixmap getPixmap() { return this->pixmap; }
QPixmap getPixmap() const { return this->pixmap; }
void setPixmapItem(DraggablePixmapItem *item);
DraggablePixmapItem *getPixmapItem() { return this->pixmapItem; }
void setPixmapItem(EventPixmapItem *item);
EventPixmapItem *getPixmapItem() const { return this->pixmapItem; }
void setUsingSprite(bool newUsingSprite) { this->usingSprite = newUsingSprite; }
bool getUsingSprite() const { return this->usingSprite; }
void setSpriteWidth(int newSpriteWidth) { this->spriteWidth = newSpriteWidth; }
int getspriteWidth() const { return this->spriteWidth; }
void setSpriteHeight(int newSpriteHeight) { this->spriteHeight = newSpriteHeight; }
int getspriteHeight() const { return this->spriteHeight; }
void setUsesDefaultPixmap(bool newUsesDefaultPixmap) { this->usesDefaultPixmap = newUsesDefaultPixmap; }
bool getUsesDefaultPixmap() const { return this->usesDefaultPixmap; }
int getEventIndex();
static QString eventGroupToString(Event::Group group);
static QString eventTypeToString(Event::Type type);
static Event::Type eventTypeFromString(QString type);
static void clearIcons();
static void setIcons();
void setIdName(QString newIdName) { this->idName = newIdName; }
QString getIdName() const { return this->idName; }
static QString groupToString(Event::Group group);
static QString typeToString(Event::Type type);
static QString typeToJsonKey(Event::Type type);
static Event::Type typeFromJsonKey(QString type);
static QList<Event::Type> types();
static QList<Event::Group> groups();
// protected attributes
protected:
@@ -202,16 +179,23 @@ protected:
int y = 0;
int elevation = 0;
int spriteWidth = 16;
int spriteHeight = 16;
bool usingSprite = false;
bool usesDefaultPixmap = true;
QMap<QString, QJsonValue> customValues;
// Some events can have an associated #define name that should be unique to this event.
// e.g. object events can have a 'LOCALID', or Heal Locations have a 'HEAL_LOCATION' id.
// When deleting events like this we want to warn the user that the #define may also be deleted.
QString idName;
QJsonObject customAttributes;
QPixmap pixmap;
DraggablePixmapItem *pixmapItem = nullptr;
EventPixmapItem *pixmapItem = nullptr;
QPointer<EventFrame> eventFrame;
static QString readString(QJsonObject *object, const QString &key) { return ParseUtil::jsonToQString(object->take(key)); }
static int readInt(QJsonObject *object, const QString &key) { return ParseUtil::jsonToInt(object->take(key)); }
static bool readBool(QJsonObject *object, const QString &key) { return ParseUtil::jsonToBool(object->take(key)); }
};
@@ -227,9 +211,7 @@ public:
}
virtual ~ObjectEvent() {}
virtual Event *duplicate() override;
virtual void accept(EventVisitor *visitor) override { visitor->visitObject(this); }
virtual Event *duplicate() const override;
virtual EventFrame *createEventFrame() override;
@@ -240,35 +222,33 @@ public:
virtual QSet<QString> getExpectedFields() override;
virtual void loadPixmap(Project *project) override;
virtual QStringList getScripts() const override { return {getScript()}; }
virtual QPixmap loadPixmap(Project *project) override;
void setGfx(QString newGfx) { this->gfx = newGfx; }
QString getGfx() { return this->gfx; }
QString getGfx() const { return this->gfx; }
void setMovement(QString newMovement) { this->movement = newMovement; }
QString getMovement() { return this->movement; }
QString getMovement() const { return this->movement; }
void setRadiusX(int newRadiusX) { this->radiusX = newRadiusX; }
int getRadiusX() { return this->radiusX; }
int getRadiusX() const { return this->radiusX; }
void setRadiusY(int newRadiusY) { this->radiusY = newRadiusY; }
int getRadiusY() { return this->radiusY; }
int getRadiusY() const { return this->radiusY; }
void setTrainerType(QString newTrainerType) { this->trainerType = newTrainerType; }
QString getTrainerType() { return this->trainerType; }
QString getTrainerType() const { return this->trainerType; }
void setSightRadiusBerryTreeID(QString newValue) { this->sightRadiusBerryTreeID = newValue; }
QString getSightRadiusBerryTreeID() { return this->sightRadiusBerryTreeID; }
QString getSightRadiusBerryTreeID() const { return this->sightRadiusBerryTreeID; }
void setScript(QString newScript) { this->script = newScript; }
QString getScript() { return this->script; }
QString getScript() const { return this->script; }
void setFlag(QString newFlag) { this->flag = newFlag; }
QString getFlag() { return this->flag; }
public:
void setFrameFromMovement(QString movement);
void setPixmapFromSpritesheet(EventGraphics * gfx);
QString getFlag() const { return this->flag; }
protected:
@@ -300,7 +280,7 @@ public:
}
virtual ~CloneObjectEvent() {}
virtual Event *duplicate() override;
virtual Event *duplicate() const override;
virtual EventFrame *createEventFrame() override;
@@ -311,17 +291,17 @@ public:
virtual QSet<QString> getExpectedFields() override;
virtual void loadPixmap(Project *project) override;
virtual QPixmap loadPixmap(Project *project) override;
void setTargetMap(QString newTargetMap) { this->targetMap = newTargetMap; }
QString getTargetMap() { return this->targetMap; }
QString getTargetMap() const { return this->targetMap; }
void setTargetID(int newTargetID) { this->targetID = newTargetID; }
int getTargetID() { return this->targetID; }
void setTargetID(QString newTargetID) { this->targetID = newTargetID; }
QString getTargetID() const { return this->targetID; }
private:
QString targetMap;
int targetID = 0;
QString targetID;
};
@@ -338,7 +318,7 @@ public:
}
virtual ~WarpEvent() {}
virtual Event *duplicate() override;
virtual Event *duplicate() const override;
virtual EventFrame *createEventFrame() override;
@@ -350,16 +330,18 @@ public:
virtual QSet<QString> getExpectedFields() override;
void setDestinationMap(QString newDestinationMap) { this->destinationMap = newDestinationMap; }
QString getDestinationMap() { return this->destinationMap; }
QString getDestinationMap() const { return this->destinationMap; }
void setDestinationWarpID(QString newDestinationWarpID) { this->destinationWarpID = newDestinationWarpID; }
QString getDestinationWarpID() { return this->destinationWarpID; }
QString getDestinationWarpID() const { return this->destinationWarpID; }
void setWarningEnabled(bool enabled);
bool getWarningEnabled() const { return this->warningEnabled; }
private:
QString destinationMap;
QString destinationWarpID;
bool warningEnabled = false;
};
@@ -373,7 +355,7 @@ public:
CoordEvent() : Event() {}
virtual ~CoordEvent() {}
virtual Event *duplicate() override = 0;
virtual Event *duplicate() const override = 0;
virtual EventFrame *createEventFrame() override = 0;
@@ -399,9 +381,7 @@ public:
}
virtual ~TriggerEvent() {}
virtual Event *duplicate() override;
virtual void accept(EventVisitor *visitor) override { visitor->visitTrigger(this); }
virtual Event *duplicate() const override;
virtual EventFrame *createEventFrame() override;
@@ -412,14 +392,16 @@ public:
virtual QSet<QString> getExpectedFields() override;
virtual QStringList getScripts() const override { return {getScriptLabel()}; }
void setScriptVar(QString newScriptVar) { this->scriptVar = newScriptVar; }
QString getScriptVar() { return this->scriptVar; }
QString getScriptVar() const { return this->scriptVar; }
void setScriptVarValue(QString newScriptVarValue) { this->scriptVarValue = newScriptVarValue; }
QString getScriptVarValue() { return this->scriptVarValue; }
QString getScriptVarValue() const { return this->scriptVarValue; }
void setScriptLabel(QString newScriptLabel) { this->scriptLabel = newScriptLabel; }
QString getScriptLabel() { return this->scriptLabel; }
QString getScriptLabel() const { return this->scriptLabel; }
private:
QString scriptVar;
@@ -441,7 +423,7 @@ public:
}
virtual ~WeatherTriggerEvent() {}
virtual Event *duplicate() override;
virtual Event *duplicate() const override;
virtual EventFrame *createEventFrame() override;
@@ -453,7 +435,7 @@ public:
virtual QSet<QString> getExpectedFields() override;
void setWeather(QString newWeather) { this->weather = newWeather; }
QString getWeather() { return this->weather; }
QString getWeather() const { return this->weather; }
private:
QString weather;
@@ -472,7 +454,7 @@ public:
}
virtual ~BGEvent() {}
virtual Event *duplicate() override = 0;
virtual Event *duplicate() const override = 0;
virtual EventFrame *createEventFrame() override = 0;
@@ -497,9 +479,7 @@ public:
}
virtual ~SignEvent() {}
virtual Event *duplicate() override;
virtual void accept(EventVisitor *visitor) override { visitor->visitSign(this); }
virtual Event *duplicate() const override;
virtual EventFrame *createEventFrame() override;
@@ -510,11 +490,13 @@ public:
virtual QSet<QString> getExpectedFields() override;
virtual QStringList getScripts() const override { return {getScriptLabel()}; }
void setFacingDirection(QString newFacingDirection) { this->facingDirection = newFacingDirection; }
QString getFacingDirection() { return this->facingDirection; }
QString getFacingDirection() const { return this->facingDirection; }
void setScriptLabel(QString newScriptLabel) { this->scriptLabel = newScriptLabel; }
QString getScriptLabel() { return this->scriptLabel; }
QString getScriptLabel() const { return this->scriptLabel; }
private:
QString facingDirection;
@@ -534,7 +516,7 @@ public:
}
virtual ~HiddenItemEvent() {}
virtual Event *duplicate() override;
virtual Event *duplicate() const override;
virtual EventFrame *createEventFrame() override;
@@ -546,16 +528,16 @@ public:
virtual QSet<QString> getExpectedFields() override;
void setItem(QString newItem) { this->item = newItem; }
QString getItem() { return this->item; }
QString getItem() const { return this->item; }
void setFlag(QString newFlag) { this->flag = newFlag; }
QString getFlag() { return this->flag; }
QString getFlag() const { return this->flag; }
void setQuantity(int newQuantity) { this->quantity = newQuantity; }
int getQuantity() { return this->quantity; }
int getQuantity() const { return this->quantity; }
void setUnderfoot(bool newUnderfoot) { this->underfoot = newUnderfoot; }
bool getUnderfoot() { return this->underfoot; }
bool getUnderfoot() const { return this->underfoot; }
private:
QString item;
@@ -579,7 +561,7 @@ public:
}
virtual ~SecretBaseEvent() {}
virtual Event *duplicate() override;
virtual Event *duplicate() const override;
virtual EventFrame *createEventFrame() override;
@@ -591,7 +573,7 @@ public:
virtual QSet<QString> getExpectedFields() override;
void setBaseID(QString newBaseID) { this->baseID = newBaseID; }
QString getBaseID() { return this->baseID; }
QString getBaseID() const { return this->baseID; }
private:
QString baseID;
@@ -611,56 +593,35 @@ public:
}
virtual ~HealLocationEvent() {}
virtual Event *duplicate() override { return nullptr; }
virtual Event *duplicate() const override;
virtual EventFrame *createEventFrame() override;
virtual OrderedJson::object buildEventJson(Project *project) override;
virtual bool loadFromJson(QJsonObject, Project *) override { return false; }
virtual bool loadFromJson(QJsonObject json, Project *project) override;
virtual void setDefaultValues(Project *project) override;
virtual QSet<QString> getExpectedFields() override { return QSet<QString>(); }
virtual QSet<QString> getExpectedFields() override;
void setIndex(int newIndex) { this->index = newIndex; }
int getIndex() { return this->index; }
void setHostMapName(QString newHostMapName) { this->hostMapName = newHostMapName; }
QString getHostMapName() const;
void setLocationName(QString newLocationName) { this->locationName = newLocationName; }
QString getLocationName() { return this->locationName; }
void setRespawnMapName(QString newRespawnMapName) { this->respawnMapName = newRespawnMapName; }
QString getRespawnMapName() const { return this->respawnMapName; }
void setIdName(QString newIdName) { this->idName = newIdName; }
QString getIdName() { return this->idName; }
void setRespawnMap(QString newRespawnMap) { this->respawnMap = newRespawnMap; }
QString getRespawnMap() { return this->respawnMap; }
void setRespawnNPC(uint8_t newRespawnNPC) { this->respawnNPC = newRespawnNPC; }
uint8_t getRespawnNPC() { return this->respawnNPC; }
void setRespawnNPC(QString newRespawnNPC) { this->respawnNPC = newRespawnNPC; }
QString getRespawnNPC() const { return this->respawnNPC; }
private:
int index = -1;
QString locationName;
QString idName;
QString respawnMap;
uint8_t respawnNPC = 0;
QString respawnMapName;
QString respawnNPC;
QString hostMapName; // Only needed if the host map fails to load.
};
///
/// Keeps track of scripts
///
class ScriptTracker : public EventVisitor {
public:
virtual void visitObject(ObjectEvent *object) override { this->scripts << object->getScript(); };
virtual void visitTrigger(TriggerEvent *trigger) override { this->scripts << trigger->getScriptLabel(); };
virtual void visitSign(SignEvent *sign) override { this->scripts << sign->getScriptLabel(); };
QStringList getScripts() { return this->scripts; }
private:
QStringList scripts;
};
inline uint qHash(const Event::Group &key, uint seed = 0) {
return qHash(static_cast<int>(key), seed);
}
#endif // EVENTS_H

View File

@@ -1,28 +0,0 @@
#pragma once
#ifndef HEALLOCATION_H
#define HEALLOCATION_H
#include <QString>
#include <QDebug>
class Event;
class HealLocation {
public:
HealLocation()=default;
HealLocation(QString, QString, int, int16_t, int16_t, QString = "", uint8_t = 1);
friend QDebug operator<<(QDebug debug, const HealLocation &hl);
public:
QString idName;
QString mapName;
int index;
int16_t x;
int16_t y;
QString respawnMap;
uint8_t respawnNPC;
static HealLocation fromEvent(Event *);
};
#endif // HEALLOCATION_H

View File

@@ -7,11 +7,13 @@
#include "maplayout.h"
#include "tileset.h"
#include "events.h"
#include "mapheader.h"
#include <QUndoStack>
#include <QPixmap>
#include <QObject>
#include <QGraphicsPixmapItem>
#include <QFileSystemWatcher>
#include <math.h>
#define DEFAULT_BORDER_WIDTH 2
@@ -21,11 +23,7 @@
#define MAX_BORDER_WIDTH 255
#define MAX_BORDER_HEIGHT 255
// Number of metatiles to draw out from edge of map. Could allow modification of this in the future.
// porymap will reflect changes to it, but the value is hard-coded in the projects at the moment
#define BORDER_DISTANCE 7
class MapPixmapItem;
class LayoutPixmapItem;
class CollisionPixmapItem;
class BorderMetatilesPixmapItem;
@@ -34,117 +32,120 @@ class Map : public QObject
Q_OBJECT
public:
explicit Map(QObject *parent = nullptr);
explicit Map(const Map &other, QObject *parent = nullptr);
~Map();
public:
QString name;
QString constantName;
QString song;
QString layoutId;
QString location;
bool requiresFlash;
QString weather;
QString type;
bool show_location;
bool allowRunning;
bool allowBiking;
bool allowEscaping;
int floorNumber = 0;
QString battle_scene;
QString sharedEventsMap = "";
QString sharedScriptsMap = "";
QStringList scriptsFileLabels;
QMap<QString, QJsonValue> customHeaders;
MapLayout *layout;
bool isPersistedToFile = true;
bool hasUnsavedDataChanges = false;
bool needsLayoutDir = true;
bool needsHealLocation = false;
bool scriptsLoaded = false;
QImage collision_image;
QPixmap collision_pixmap;
QImage image;
QPixmap pixmap;
void setName(const QString &mapName) { m_name = mapName; }
QString name() const { return m_name; }
QMap<Event::Group, QList<Event *>> events;
QList<Event *> ownedEvents; // for memory management
void setConstantName(const QString &constantName) { m_constantName = constantName; }
QString constantName() const { return m_constantName; }
QList<int> metatileLayerOrder;
QList<float> metatileLayerOpacity;
static QString mapConstantFromName(const QString &name);
QString expectedConstantName() const { return Map::mapConstantFromName(m_name); }
void setName(QString mapName);
static QString mapConstantFromName(QString mapName, bool includePrefix = true);
int getWidth();
int getHeight();
int getBorderWidth();
int getBorderHeight();
QPixmap render(bool ignoreCache = false, MapLayout *fromLayout = nullptr, QRect bounds = QRect(0, 0, -1, -1));
QPixmap renderCollision(bool ignoreCache);
bool mapBlockChanged(int i, const Blockdata &cache);
bool borderBlockChanged(int i, const Blockdata &cache);
void cacheBlockdata();
void cacheCollision();
bool getBlock(int x, int y, Block *out);
void setBlock(int x, int y, Block block, bool enableScriptCallback = false);
void setBlockdata(Blockdata blockdata, bool enableScriptCallback = false);
uint16_t getBorderMetatileId(int x, int y);
void setBorderMetatileId(int x, int y, uint16_t metatileId, bool enableScriptCallback = false);
void setBorderBlockData(Blockdata blockdata, bool enableScriptCallback = false);
void floodFillCollisionElevation(int x, int y, uint16_t collision, uint16_t elevation);
void _floodFillCollisionElevation(int x, int y, uint16_t collision, uint16_t elevation);
void magicFillCollisionElevation(int x, int y, uint16_t collision, uint16_t elevation);
QList<Event *> getAllEvents() const;
QStringList getScriptLabels(Event::Group group = Event::Group::None);
void setLayout(Layout *layout);
Layout* layout() const { return m_layout; }
int getWidth() const;
int getHeight() const;
int getBorderWidth() const;
int getBorderHeight() const;
void setHeader(const MapHeader &header) { *m_header = header; }
MapHeader* header() const { return m_header; }
void setSharedEventsMap(const QString &sharedEventsMap) { m_sharedEventsMap = sharedEventsMap; }
void setSharedScriptsMap(const QString &sharedScriptsMap);
QString sharedEventsMap() const { return m_sharedEventsMap; }
QString sharedScriptsMap() const { return m_sharedScriptsMap; }
void setNeedsHealLocation(bool needsHealLocation) { m_needsHealLocation = needsHealLocation; }
void setIsPersistedToFile(bool persistedToFile) { m_isPersistedToFile = persistedToFile; }
void setHasUnsavedDataChanges(bool unsavedDataChanges) { m_hasUnsavedDataChanges = unsavedDataChanges; }
bool needsHealLocation() const { return m_needsHealLocation; }
bool isPersistedToFile() const { return m_isPersistedToFile; }
bool hasUnsavedDataChanges() const { return m_hasUnsavedDataChanges; }
void resetEvents();
QList<Event *> getEvents(Event::Group group = Event::Group::None) const;
Event* getEvent(Event::Group group, int index) const;
Event* getEvent(Event::Group group, const QString &idName) const;
QStringList getEventIdNames(Event::Group group) const;
int getNumEvents(Event::Group group = Event::Group::None) const;
void removeEvent(Event *);
void addEvent(Event *);
int getIndexOfEvent(Event *) const;
bool hasEvent(Event *) const;
QStringList getScriptLabels(Event::Group group = Event::Group::None);
QString getScriptsFilePath() const;
void openScript(const QString &label);
void deleteConnections();
QList<MapConnection*> getConnections() const;
QList<MapConnection*> getConnections() const { return m_connections; }
MapConnection* getConnection(const QString &direction) const;
void removeConnection(MapConnection *);
void addConnection(MapConnection *);
void loadConnection(MapConnection *);
QRect getConnectionRect(const QString &direction, MapLayout *fromLayout = nullptr);
QPixmap renderConnection(const QString &direction, MapLayout *fromLayout = nullptr);
QPixmap renderBorder(bool ignoreCache = false);
void setDimensions(int newWidth, int newHeight, bool setNewBlockdata = true, bool enableScriptCallback = false);
void setBorderDimensions(int newWidth, int newHeight, bool setNewBlockdata = true, bool enableScriptCallback = false);
void clearBorderCache();
void cacheBorder();
bool hasUnsavedChanges();
bool isWithinBounds(int x, int y);
bool isWithinBorderBounds(int x, int y);
void openScript(QString label);
QString getScriptsFilePath() const;
QRect getConnectionRect(const QString &direction, Layout *fromLayout = nullptr) const;
QPixmap renderConnection(const QString &direction, Layout *fromLayout = nullptr);
MapPixmapItem *mapItem = nullptr;
void setMapItem(MapPixmapItem *item) { mapItem = item; }
CollisionPixmapItem *collisionItem = nullptr;
void setCollisionItem(CollisionPixmapItem *item) { collisionItem = item; }
BorderMetatilesPixmapItem *borderItem = nullptr;
void setBorderItem(BorderMetatilesPixmapItem *item) { borderItem = item; }
QUndoStack editHistory;
QUndoStack* editHistory() const { return m_editHistory; }
void commit(QUndoCommand*);
void modify();
void clean();
void setClean();
bool hasUnsavedChanges() const;
void pruneEditHistory();
void setCustomAttributes(const QJsonObject &attributes) { m_customAttributes = attributes; }
QJsonObject customAttributes() const { return m_customAttributes; }
private:
void setNewDimensionsBlockdata(int newWidth, int newHeight);
void setNewBorderDimensionsBlockdata(int newWidth, int newHeight);
QString m_name;
QString m_constantName;
QString m_sharedEventsMap = "";
QString m_sharedScriptsMap = "";
QStringList m_scriptLabels;
QJsonObject m_customAttributes;
MapHeader *m_header = nullptr;
Layout *m_layout = nullptr;
bool m_isPersistedToFile = true;
bool m_hasUnsavedDataChanges = false;
bool m_needsHealLocation = false;
bool m_scriptsLoaded = false;
QMap<Event::Group, QList<Event *>> m_events;
QSet<Event *> m_ownedEvents; // for memory management
QList<int> m_metatileLayerOrder;
QList<float> m_metatileLayerOpacity;
void trackConnection(MapConnection*);
// MapConnections in 'ownedConnections' but not 'connections' persist in the edit history.
QList<MapConnection*> connections;
QSet<MapConnection*> ownedConnections;
QList<MapConnection*> m_connections;
QSet<MapConnection*> m_ownedConnections;
QPointer<QUndoStack> m_editHistory;
QPointer<QFileSystemWatcher> m_scriptFileWatcher;
void invalidateScripts();
signals:
void modified();
void scriptsModified();
void mapDimensionsChanged(const QSize &size);
void mapNeedsRedrawing();
void openScriptRequested(QString label);
void connectionAdded(MapConnection*);
void connectionRemoved(MapConnection*);
void layoutChanged();
};
#endif // MAP_H

View File

@@ -5,6 +5,7 @@
#include <QString>
#include <QObject>
#include <QMap>
#include <QJsonObject>
class Project;
class Map;
@@ -26,13 +27,22 @@ public:
QString direction() const { return m_direction; }
void setDirection(const QString &direction, bool mirror = true);
bool isCardinal() const { return isCardinal(m_direction); }
bool isHorizontal() const { return isHorizontal(m_direction); }
bool isVertical() const { return isVertical(m_direction); }
bool isDiving() const { return isDiving(m_direction); }
int offset() const { return m_offset; }
void setOffset(int offset, bool mirror = true);
QJsonObject customData() const { return m_customData; }
void setCustomData(const QJsonObject &customData) { m_customData = customData; }
MapConnection* findMirror();
MapConnection* createMirror();
QPixmap getPixmap();
QPixmap render() const;
QPoint relativePos(bool clipped = false) const;
static QPointer<Project> project;
static const QMap<QString, QString> oppositeDirections;
@@ -49,6 +59,7 @@ private:
QString m_targetMapName;
QString m_direction;
int m_offset;
QJsonObject m_customData;
void markMapEdited();
Map* getMap(const QString& mapName) const;

83
include/core/mapheader.h Normal file
View File

@@ -0,0 +1,83 @@
#ifndef MAPHEADER_H
#define MAPHEADER_H
#include <QObject>
class MapHeader : public QObject
{
Q_OBJECT
public:
MapHeader(QObject *parent = nullptr) : QObject(parent) {};
~MapHeader() {};
MapHeader(const MapHeader& other);
MapHeader& operator=(const MapHeader& other);
bool operator==(const MapHeader& other) const {
return m_song == other.m_song
&& m_location == other.m_location
&& m_requiresFlash == other.m_requiresFlash
&& m_weather == other.m_weather
&& m_type == other.m_type
&& m_showsLocationName == other.m_showsLocationName
&& m_allowsRunning == other.m_allowsRunning
&& m_allowsBiking == other.m_allowsBiking
&& m_allowsEscaping == other.m_allowsEscaping
&& m_floorNumber == other.m_floorNumber
&& m_battleScene == other.m_battleScene;
}
bool operator!=(const MapHeader& other) const {
return !(operator==(other));
}
void setSong(const QString &song);
void setLocation(const QString &location);
void setRequiresFlash(bool requiresFlash);
void setWeather(const QString &weather);
void setType(const QString &type);
void setShowsLocationName(bool showsLocationName);
void setAllowsRunning(bool allowsRunning);
void setAllowsBiking(bool allowsBiking);
void setAllowsEscaping(bool allowsEscaping);
void setFloorNumber(int floorNumber);
void setBattleScene(const QString &battleScene);
QString song() const { return m_song; }
QString location() const { return m_location; }
bool requiresFlash() const { return m_requiresFlash; }
QString weather() const { return m_weather; }
QString type() const { return m_type; }
bool showsLocationName() const { return m_showsLocationName; }
bool allowsRunning() const { return m_allowsRunning; }
bool allowsBiking() const { return m_allowsBiking; }
bool allowsEscaping() const { return m_allowsEscaping; }
int floorNumber() const { return m_floorNumber; }
QString battleScene() const { return m_battleScene; }
signals:
void songChanged(QString);
void locationChanged(QString);
void requiresFlashChanged(bool);
void weatherChanged(QString);
void typeChanged(QString);
void showsLocationNameChanged(bool);
void allowsRunningChanged(bool);
void allowsBikingChanged(bool);
void allowsEscapingChanged(bool);
void floorNumberChanged(int);
void battleSceneChanged(QString);
void modified();
private:
QString m_song;
QString m_location;
bool m_requiresFlash = false;
QString m_weather;
QString m_type;
bool m_showsLocationName = false;
bool m_allowsRunning = false;
bool m_allowsBiking = false;
bool m_allowsEscaping = false;
int m_floorNumber = 0;
QString m_battleScene;
};
#endif // MAPHEADER_H

View File

@@ -7,41 +7,152 @@
#include <QImage>
#include <QPixmap>
#include <QString>
#include <QUndoStack>
class MapLayout {
class Map;
class LayoutPixmapItem;
class CollisionPixmapItem;
class BorderMetatilesPixmapItem;
class Layout : public QObject {
Q_OBJECT
public:
MapLayout() {}
static QString layoutConstantFromName(QString mapName);
Layout() {}
Layout(const Layout &other);
static QString layoutConstantFromName(const QString &name);
bool hasUnsavedDataChanges = false;
QString id;
QString name;
QString newFolderPath;
int width;
int height;
int border_width;
int border_height;
QString border_path;
QString blockdata_path;
QString tileset_primary_label;
QString tileset_secondary_label;
Tileset *tileset_primary = nullptr;
Tileset *tileset_secondary = nullptr;
QJsonObject customData;
Blockdata blockdata;
QImage image;
QPixmap pixmap;
QImage border_image;
QPixmap border_pixmap;
QImage collision_image;
QPixmap collision_pixmap;
Blockdata border;
Blockdata cached_blockdata;
Blockdata cached_collision;
Blockdata cached_border;
struct {
Blockdata blocks;
QSize mapDimensions;
QSize layoutDimensions;
Blockdata border;
QSize borderDimensions;
} lastCommitBlocks; // to track map changes
int getWidth();
int getHeight();
int getBorderWidth();
int getBorderHeight();
QList<int> metatileLayerOrder;
QList<float> metatileLayerOpacity;
LayoutPixmapItem *layoutItem = nullptr;
CollisionPixmapItem *collisionItem = nullptr;
BorderMetatilesPixmapItem *borderItem = nullptr;
QUndoStack editHistory;
// to simplify new layout settings transfer between functions
struct Settings {
QString id;
QString name;
// The name of a new layout's folder in `data/layouts/` is not always the same as the layout's name
// (e.g. the majority of the default layouts use the name of their associated map).
QString folderName;
int width;
int height;
int borderWidth;
int borderHeight;
QString primaryTilesetLabel;
QString secondaryTilesetLabel;
};
Settings settings() const;
Layout *copy() const;
void copyFrom(const Layout *other);
int getWidth() const { return width; }
int getHeight() const { return height; }
int getBorderWidth() const { return border_width; }
int getBorderHeight() const { return border_height; }
QMargins getBorderMargins() const;
QRect getVisibleRect() const;
bool isWithinBounds(int x, int y) const;
bool isWithinBounds(const QRect &rect) const;
bool isWithinBorderBounds(int x, int y) const;
bool getBlock(int x, int y, Block *out);
void setBlock(int x, int y, Block block, bool enableScriptCallback = false);
void setBlockdata(Blockdata blockdata, bool enableScriptCallback = false);
void adjustDimensions(const QMargins &margins, bool setNewBlockdata = true);
void setDimensions(int newWidth, int newHeight, bool setNewBlockdata = true);
void setBorderDimensions(int newWidth, int newHeight, bool setNewBlockdata = true, bool enableScriptCallback = false);
void cacheBlockdata();
void cacheCollision();
void clearBorderCache();
void cacheBorder();
bool hasUnsavedChanges() const;
bool save(const QString &root);
bool saveBorder(const QString &root);
bool saveBlockdata(const QString &root);
bool layoutBlockChanged(int i, const Blockdata &cache);
uint16_t getBorderMetatileId(int x, int y);
void setBorderMetatileId(int x, int y, uint16_t metatileId, bool enableScriptCallback = false);
void setBorderBlockData(Blockdata blockdata, bool enableScriptCallback = false);
void floodFillCollisionElevation(int x, int y, uint16_t collision, uint16_t elevation);
void _floodFillCollisionElevation(int x, int y, uint16_t collision, uint16_t elevation);
void magicFillCollisionElevation(int x, int y, uint16_t collision, uint16_t elevation);
QPixmap render(bool ignoreCache = false, Layout *fromLayout = nullptr, QRect bounds = QRect(0, 0, -1, -1));
QPixmap renderCollision(bool ignoreCache);
// QPixmap renderConnection(MapConnection, Layout *);
QPixmap renderBorder(bool ignoreCache = false);
QPixmap getLayoutItemPixmap();
void setLayoutItem(LayoutPixmapItem *item) { layoutItem = item; }
void setCollisionItem(CollisionPixmapItem *item) { collisionItem = item; }
void setBorderItem(BorderMetatilesPixmapItem *item) { borderItem = item; }
private:
void setNewDimensionsBlockdata(int newWidth, int newHeight);
void setNewBorderDimensionsBlockdata(int newWidth, int newHeight);
bool writeBlockdata(const QString &path, const Blockdata &blockdata) const;
static int getBorderDrawDistance(int dimension, qreal minimum);
signals:
void dimensionsChanged(const QSize &size);
void needsRedrawing();
};
#endif // MAPLAYOUT_H

View File

@@ -1,16 +0,0 @@
#ifndef MAPPARSER_H
#define MAPPARSER_H
#include "maplayout.h"
#include "project.h"
#include <QList>
#include <QString>
class MapParser
{
public:
MapParser();
MapLayout *parse(QString filepath, bool *error, Project *project);
};
#endif // MAPPARSER_H

View File

@@ -11,27 +11,6 @@
class Project;
enum {
METATILE_LAYER_MIDDLE_TOP,
METATILE_LAYER_BOTTOM_MIDDLE,
METATILE_LAYER_BOTTOM_TOP,
NUM_METATILE_LAYER_TYPES
};
enum {
ENCOUNTER_NONE,
ENCOUNTER_LAND,
ENCOUNTER_WATER,
NUM_METATILE_ENCOUNTER_TYPES
};
enum {
TERRAIN_NONE,
TERRAIN_GRASS,
TERRAIN_WATER,
TERRAIN_WATERFALL,
NUM_METATILE_TERRAIN_TYPES
};
class Metatile
{
@@ -41,6 +20,13 @@ public:
Metatile &operator=(const Metatile &other) = default;
Metatile(const int numTiles);
enum LayerType {
Normal,
Covered,
Split,
Count
};
enum Attr {
Behavior,
TerrainType,

View File

@@ -1,12 +0,0 @@
#pragma once
#ifndef METATILEPARSER_H
#define METATILEPARSER_H
#include "metatile.h"
#include <QList>
namespace MetatileParser {
QList<Metatile*> parse(QString filepath, bool *error, bool primaryTileset);
}
#endif // METATILEPARSER_H

View File

@@ -7,7 +7,7 @@
namespace PaletteUtil {
QList<QRgb> parse(QString filepath, bool *error);
void writeJASC(QString filepath, QVector<QRgb> colors, int offset, int nColors);
bool writeJASC(const QString &filepath, const QVector<QRgb> &colors, int offset, int nColors);
}
#endif // PALETTEUTIL_H

View File

@@ -2,9 +2,9 @@
#ifndef PARSEUTIL_H
#define PARSEUTIL_H
#include "heallocation.h"
#include "log.h"
#include "orderedjson.h"
#include "orderedmap.h"
#include <QString>
#include <QList>
@@ -43,26 +43,35 @@ class ParseUtil
{
public:
ParseUtil();
void set_root(const QString &dir);
static QString readTextFile(const QString &path);
void invalidateTextFile(const QString &path);
void setRoot(const QString &dir) { this->root = dir; }
void setUpdatesSplashScreen(bool updates) { this->updatesSplashScreen = updates; }
static QString readTextFile(const QString &path, QString *error = nullptr);
QString loadTextFile(const QString &path, QString *error = nullptr);
bool cacheFile(const QString &path, QString *error = nullptr);
void clearFileCache() { this->fileCache.clear(); }
static int textFileLineCount(const QString &path);
QList<QStringList> parseAsm(const QString &filename);
QStringList readCArray(const QString &filename, const QString &label);
QMap<QString, QStringList> readCArrayMulti(const QString &filename);
QMap<QString, QString> readNamedIndexCArray(const QString &text, const QString &label);
QMap<QString, QString> readNamedIndexCArray(const QString &text, const QString &label, QString *error = nullptr);
QString readCIncbin(const QString &text, const QString &label);
QMap<QString, QString> readCIncbinMulti(const QString &filepath);
QStringList readCIncbinArray(const QString &filename, const QString &label);
QMap<QString, int> readCDefinesByRegex(const QString &filename, const QStringList &regexList);
QMap<QString, int> readCDefinesByName(const QString &filename, const QStringList &names);
QStringList readCDefineNames(const QString &filename, const QStringList &regexList);
QMap<QString, QHash<QString, QString>> readCStructs(const QString &, const QString & = "", const QHash<int, QString> = { });
QHash<QString, int> readCDefinesByRegex(const QString &filename, const QSet<QString> &regexList, QString *error = nullptr);
QHash<QString, int> readCDefinesByName(const QString &filename, const QSet<QString> &names, QString *error = nullptr);
QStringList readCDefineNames(const QString &filename, const QSet<QString> &regexList, QString *error = nullptr);
void loadGlobalCDefinesFromFile(const QString &filename, QString *error = nullptr);
void loadGlobalCDefines(const QMap<QString,QString> &defines);
void loadGlobalCDefines(const QHash<QString,QString> &defines);
void resetCDefines();
OrderedMap<QString, QHash<QString, QString>> readCStructs(const QString &, const QString & = "", const QHash<int, QString>& = {});
QList<QStringList> getLabelMacros(const QList<QStringList>&, const QString&);
QStringList getLabelValues(const QList<QStringList>&, const QString&);
bool tryParseJsonFile(QJsonDocument *out, const QString &filepath);
bool tryParseOrderedJsonFile(poryjson::Json::object *out, const QString &filepath);
bool ensureFieldsExist(const QJsonObject &obj, const QList<QString> &fields);
bool tryParseJsonFile(QJsonDocument *out, const QString &filepath, QString *error = nullptr);
bool tryParseOrderedJsonFile(poryjson::Json::object *out, const QString &filepath, QString *error = nullptr);
// Returns the 1-indexed line number for the definition of scriptLabel in the scripts file at filePath.
// Returns 0 if a definition for scriptLabel cannot be found.
@@ -77,35 +86,52 @@ public:
static QString removeLineComments(QString text, const QStringList &commentSymbols);
static QStringList splitShellCommand(QStringView command);
static int gameStringToInt(QString gameString, bool * ok = nullptr);
static bool gameStringToBool(QString gameString, bool * ok = nullptr);
static QString jsonToQString(QJsonValue value, bool * ok = nullptr);
static int jsonToInt(QJsonValue value, bool * ok = nullptr);
static bool jsonToBool(QJsonValue value, bool * ok = nullptr);
static int gameStringToInt(const QString &gameString, bool * ok = nullptr);
static bool gameStringToBool(const QString &gameString, bool * ok = nullptr);
static QString jsonToQString(const QJsonValue &value, bool * ok = nullptr);
static int jsonToInt(const QJsonValue &value, bool * ok = nullptr);
static bool jsonToBool(const QJsonValue &value, bool * ok = nullptr);
private:
QString root;
QString text;
QString file;
QString curDefine;
QHash<QString, QString> fileCache;
QHash<QString, QStringList> errorMap;
int evaluateDefine(const QString&, const QString &, QMap<QString, int>*, QMap<QString, QString>*);
QList<Token> tokenizeExpression(QString, QMap<QString, int>*, QMap<QString, QString>*);
// The maps of define names to values/expressions that are available while parsing C defines.
// As the parser reads and evaluates more defines it will update these maps accordingly.
QHash<QString, int> knownDefineValues;
QHash<QString, QString> knownDefineExpressions;
// Maps of special define names to values/expressions that take precedence over defines encountered while parsing.
// Some (like 'TRUE'/'FALSE') are always present in these maps, others may be specified by the user with 'loadGlobalCDefines' / 'loadGlobalCDefinesFromFile'.
QHash<QString, int> globalDefineValues;
QHash<QString, QString> globalDefineExpressions;
bool updatesSplashScreen = false;
int evaluateDefine(const QString &identifier, bool *ok = nullptr);
int evaluateExpression(const QString &expression);
QList<Token> tokenizeExpression(QString expression);
QList<Token> generatePostfix(const QList<Token> &tokens);
int evaluatePostfix(const QList<Token> &postfix);
void recordError(const QString &message);
void recordErrors(const QStringList &errors);
void logRecordedErrors();
QString createErrorMessage(const QString &message, const QString &expression);
void updateSplashScreen(QString path);
struct ParsedDefines {
QMap<QString,QString> expressions; // Map of all define names encountered to their expressions
QHash<QString,QString> expressions; // Map of all define names encountered to their expressions
QStringList filteredNames; // List of define names that matched the search text, in the order that they were encountered
};
ParsedDefines readCDefines(const QString &filename, const QStringList &filterList, bool useRegex);
QMap<QString, int> evaluateCDefines(const QString &filename, const QStringList &filterList, bool useRegex);
bool defineNameMatchesFilter(const QString &name, const QStringList &filterList) const;
bool defineNameMatchesFilter(const QString &name, const QList<QRegularExpression> &filterList) const;
ParsedDefines readCDefines(const QString &filename, const QSet<QString> &filterList, bool useRegex, QString *error);
QHash<QString, int> evaluateCDefines(const QString &filename, const QSet<QString> &filterList, bool useRegex, QString *error);
bool defineNameMatchesFilter(const QString &name, const QSet<QString> &filterList) const;
bool defineNameMatchesFilter(const QString &name, const QSet<QRegularExpression> &filterList) const;
QString pathWithRoot(const QString &path);
static const QRegularExpression re_incScriptLabel;
static const QRegularExpression re_globalIncScriptLabel;

View File

@@ -33,7 +33,6 @@ struct LayoutSquare
struct MapSectionEntry
{
QString name = "";
int x = 0;
int y = 0;
int width = 1;
@@ -57,8 +56,8 @@ public:
bool loadLayout(poryjson::Json);
bool loadEntries();
void setEntries(tsl::ordered_map<QString, MapSectionEntry> *entries) { this->region_map_entries = entries; }
void setEntries(tsl::ordered_map<QString, MapSectionEntry> entries) { *(this->region_map_entries) = entries; }
void setEntries(QHash<QString, MapSectionEntry> *entries) { this->region_map_entries = entries; }
void setEntries(const QHash<QString, MapSectionEntry> &entries) { *(this->region_map_entries) = entries; }
void clearEntries() { this->region_map_entries->clear(); }
MapSectionEntry getEntry(QString section);
void setEntry(QString section, MapSectionEntry entry);
@@ -114,8 +113,6 @@ public:
void setLayer(QString layer) { this->current_layer = layer; }
QString getLayer() { return this->current_layer; }
QString fixCase(QString);
int padLeft() { return this->offset_left; }
int padTop() { return this->offset_top; }
int padRight() { return this->tilemap_width - this->layout_width - this->offset_left; }
@@ -149,14 +146,12 @@ public:
const QString section_prefix;
const QString default_map_section;
const QString count_map_section;
signals:
void mapNeedsDisplaying();
private:
// TODO: defaults needed?
tsl::ordered_map<QString, MapSectionEntry> *region_map_entries = nullptr;
QHash<QString, MapSectionEntry> *region_map_entries = nullptr;
QString alias = "";

View File

@@ -64,9 +64,9 @@ private:
/// Edit Layout Dimensions
class ResizeLayout : public QUndoCommand {
class ResizeRMLayout : public QUndoCommand {
public:
ResizeLayout(RegionMap *map, int oldWidth, int oldHeight, int newWidth, int newHeight,
ResizeRMLayout(RegionMap *map, int oldWidth, int oldHeight, int newWidth, int newHeight,
QMap<QString, QList<LayoutSquare>> oldLayouts, QMap<QString, QList<LayoutSquare>> newLayouts, QUndoCommand *parent = nullptr);
void undo() override;
@@ -153,7 +153,7 @@ private:
/// ClearEntries
class ClearEntries : public QUndoCommand {
public:
ClearEntries(RegionMap *map, tsl::ordered_map<QString, MapSectionEntry>, QUndoCommand *parent = nullptr);
ClearEntries(RegionMap *map, QHash<QString, MapSectionEntry>, QUndoCommand *parent = nullptr);
void undo() override;
void redo() override;
@@ -163,7 +163,7 @@ public:
private:
RegionMap *map;
tsl::ordered_map<QString, MapSectionEntry> entries;
QHash<QString, MapSectionEntry> entries;
};
#endif // REGIONMAPEDITCOMMANDS_H

View File

@@ -19,6 +19,8 @@ public:
uint16_t rawValue() const;
static int getIndexInTileset(int);
static const uint16_t maxValue;
};
inline bool operator==(const Tile &a, const Tile &b) {

View File

@@ -38,8 +38,6 @@ public:
QList<QList<QRgb>> palettes;
QList<QList<QRgb>> palettePreviews;
bool hasUnsavedTilesImage;
static Tileset* getMetatileTileset(int, Tileset*, Tileset*);
static Tileset* getTileTileset(int, Tileset*, Tileset*);
static Metatile* getMetatile(int, Tileset*, Tileset*);
@@ -56,9 +54,24 @@ public:
static QHash<int, QString> getHeaderMemberMap(bool usingAsm);
static QString getExpectedDir(QString tilesetName, bool isSecondary);
QString getExpectedDir();
bool appendToHeaders(QString root, QString friendlyName, bool usingAsm);
bool appendToGraphics(QString root, QString friendlyName, bool usingAsm);
bool appendToMetatiles(QString root, QString friendlyName, bool usingAsm);
bool load();
bool loadMetatiles();
bool loadMetatileAttributes();
bool loadTilesImage(QImage *importedImage = nullptr);
bool loadPalettes();
bool save();
bool saveMetatileAttributes();
bool saveMetatiles();
bool saveTilesImage();
bool savePalettes();
bool appendToHeaders(const QString &filepath, const QString &friendlyName, bool usingAsm);
bool appendToGraphics(const QString &filepath, const QString &friendlyName, bool usingAsm);
bool appendToMetatiles(const QString &filepath, const QString &friendlyName, bool usingAsm);
void setTilesImage(const QImage &image);
void setMetatiles(const QList<Metatile*> &metatiles);
void addMetatile(Metatile* metatile);
@@ -67,11 +80,12 @@ public:
Metatile* metatileAt(unsigned int i) const { return m_metatiles.at(i); }
void clearMetatiles();
void resizeMetatiles(unsigned int newNumMetatiles);
void resizeMetatiles(int newNumMetatiles);
int numMetatiles() const { return m_metatiles.length(); }
private:
QList<Metatile*> m_metatiles;
bool m_hasUnsavedTilesImage = false;
};
#endif // TILESET_H

16
include/core/utility.h Normal file
View File

@@ -0,0 +1,16 @@
#pragma once
#ifndef UTILITY_H
#define UTILITY_H
#include <QString>
namespace Util {
void numericalModeSort(QStringList &list);
int roundUp(int numToRound, int multiple);
QString toDefineCase(QString input);
QString toHexString(uint32_t value, int minLength = 0);
QString toHtmlParagraph(const QString &text);
Qt::Orientations getOrientation(bool xflip, bool yflip);
}
#endif // UTILITY_H

69
include/core/validator.h Normal file
View File

@@ -0,0 +1,69 @@
#ifndef VALIDATOR_H
#define VALIDATOR_H
/*
This file contains our subclasses of QValidator.
- PrefixValidator is for input widgets that want to enforce a particular prefix.
It differs from a QRegularExpressionValidator with a prefix in the regex because
it will automatically enforce the prefix in fixup() if it isn't present.
It's preferable to QLineEdit's input mask because it won't affect cursor behavior.
- IdentifierValidator is for validating that input text can be used for the name of an identifier in the project.
(i.e., starts with a letter or underscore, then may continue with letters, numbers, or underscores).
Unless a prefix is specified this is a normal QRegularExpressionValidator, we only have a subclass because we use it so often.
- UppercaseValidator is just a validator that uppercases input text.
*/
#include <QValidator>
class PrefixValidator : public QRegularExpressionValidator {
Q_OBJECT
public:
explicit PrefixValidator(const QString &prefix, QObject *parent = nullptr)
: QRegularExpressionValidator(parent), m_prefix(prefix) {};
explicit PrefixValidator(const QString &prefix, const QRegularExpression &re, QObject *parent = nullptr)
: QRegularExpressionValidator(re, parent), m_prefix(prefix) {};
~PrefixValidator() {};
virtual QValidator::State validate(QString &input, int &) const override;
virtual void fixup(QString &input) const override;
QString prefix() const { return m_prefix; }
void setPrefix(const QString &prefix);
bool isValid(const QString &input) const;
private:
QString m_prefix;
bool missingPrefix(const QString &input) const;
};
class IdentifierValidator : public PrefixValidator {
Q_OBJECT
public:
explicit IdentifierValidator(QObject *parent = nullptr)
: PrefixValidator("", re_identifier, parent) {};
explicit IdentifierValidator(const QString &prefix, QObject *parent = nullptr)
: PrefixValidator(prefix, re_identifier, parent) {};
~IdentifierValidator() {};
void setAllowEmpty(bool allowEmpty);
private:
static const QRegularExpression re_identifier;
static const QRegularExpression re_identifierOrEmpty;
};
class UppercaseValidator : public QValidator {
virtual QValidator::State validate(QString &input, int &) const override {
input = input.toUpper();
return QValidator::Acceptable;
}
};
#endif // VALIDATOR_H

View File

@@ -3,34 +3,43 @@
#define GUARD_WILDMONINFO_H
#include <QtWidgets>
#include "orderedmap.h"
#include "orderedjson.h"
struct WildPokemon {
int minLevel = 5;
int maxLevel = 5;
QString species = "SPECIES_NONE";
class WildPokemon {
public:
WildPokemon();
WildPokemon(int minLevel, int maxLevel, const QString &species);
int minLevel;
int maxLevel;
QString species;
OrderedJson::object customData;
};
struct WildMonInfo {
bool active = false;
int encounterRate = 0;
QVector<WildPokemon> wildPokemon;
OrderedJson::object customData;
};
struct WildPokemonHeader {
tsl::ordered_map<QString, WildMonInfo> wildMons;
OrderedMap<QString, WildMonInfo> wildMons;
OrderedJson::object customData;
};
struct EncounterField {
QString name; // Ex: "fishing_mons"
QVector<int> encounterRates;
tsl::ordered_map<QString, QVector<int>> groups; // Ex: "good_rod", {2, 3, 4}
OrderedMap<QString, QVector<int>> groups; // Ex: "good_rod", {2, 3, 4}
OrderedJson::object customData;
};
typedef QVector<EncounterField> EncounterFields;
void setDefaultEncounterRate(QString fieldName, int rate);
WildMonInfo getDefaultMonInfo(EncounterField field);
WildMonInfo getDefaultMonInfo(const EncounterField &field);
QVector<double> getWildEncounterPercentages(const EncounterField &field);
void combineEncounters(WildMonInfo &to, WildMonInfo from);
#endif // GUARD_WILDMONINFO_H

View File

@@ -10,6 +10,7 @@
#include <QCheckBox>
#include <QCursor>
#include <QUndoGroup>
#include <QPointer>
#include "mapconnection.h"
#include "metatileselector.h"
@@ -21,7 +22,7 @@
#include "divingmappixmapitem.h"
#include "currentselectedmetatilespixmapitem.h"
#include "collisionpixmapitem.h"
#include "mappixmapitem.h"
#include "layoutpixmapitem.h"
#include "settings.h"
#include "gridsettings.h"
#include "movablerect.h"
@@ -29,7 +30,7 @@
#include "mapruler.h"
#include "encountertablemodel.h"
class DraggablePixmapItem;
class EventPixmapItem;
class MetatilesPixmapItem;
class Editor : public QObject
@@ -45,19 +46,32 @@ public:
public:
Ui::MainWindow* ui;
QObject *parent = nullptr;
QPointer<Project> project = nullptr;
Map *map = nullptr;
QPointer<Map> map = nullptr;
QPointer<Layout> layout = nullptr;
QUndoGroup editGroup; // Manages the undo history for each map
Settings *settings;
GridSettings gridSettings;
void setProject(Project * project);
void saveProject();
void save();
void closeProject();
bool setMap(QString map_name);
void saveUiFields();
bool saveAll();
bool saveCurrent();
void saveEncounterTabData();
void closeProject();
bool setMap(QString map_name);
bool setLayout(QString layoutName);
void unsetMap();
Tileset *getCurrentMapPrimaryTileset();
bool displayMap();
bool displayLayout();
void displayMetatileSelector();
void displayMapMetatiles();
void displayMapMovementPermissions();
@@ -75,56 +89,63 @@ public:
void updateMapBorder();
void updateMapConnections();
void setEditingMap();
void setEditingCollision();
void setEditingObjects();
void setEditingConnections();
void setMapEditingButtonsEnabled(bool enabled);
void setConnectionsVisibility(bool visible);
void updateDivingMapsVisibility();
void renderDivingConnections();
void addConnection(MapConnection* connection);
void addNewConnection(const QString &mapName, const QString &direction);
void replaceConnection(const QString &mapName, const QString &direction);
void removeConnection(MapConnection* connection);
void removeSelectedConnection();
void addNewWildMonGroup(QWidget *window);
void deleteWildMonGroup();
void configureEncounterJSON(QWidget *);
EncounterTableModel* getCurrentWildMonTable();
void updateDiveMap(QString mapName);
void updateEmergeMap(QString mapName);
bool setDivingMapName(const QString &mapName, const QString &direction);
QString getDivingMapName(const QString &direction) const;
void setSelectedConnection(MapConnection *connection);
void updatePrimaryTileset(QString tilesetLabel, bool forceLoad = false);
void updateSecondaryTileset(QString tilesetLabel, bool forceLoad = false);
void toggleBorderVisibility(bool visible, bool enableScriptCallback = true);
void updateCustomMapHeaderValues(QTableWidget *);
void configureEncounterJSON(QWidget *);
Tileset *getCurrentMapPrimaryTileset();
void updateCustomMapAttributes();
DraggablePixmapItem *addMapEvent(Event *event);
void selectMapEvent(DraggablePixmapItem *object, bool toggle = false);
DraggablePixmapItem *addNewEvent(Event::Type type);
void updateSelectedEvents();
EventPixmapItem *addEventPixmapItem(Event *event);
void removeEventPixmapItem(Event *event);
bool canAddEvents(const QList<Event*> &events);
void selectMapEvent(Event *event, bool toggle = false);
Event *addNewEvent(Event::Type type);
void updateEvents();
void duplicateSelectedEvents();
void redrawObject(DraggablePixmapItem *item);
QList<DraggablePixmapItem *> getObjects();
void redrawAllEvents();
void redrawEvents(const QList<Event*> &events);
void redrawEventPixmapItem(EventPixmapItem *item);
void updateEventPixmapItemZValue(EventPixmapItem *item);
qreal getEventOpacity(const Event *event) const;
void setPlayerViewRect(const QRectF &rect);
void updateCursorRectPos(int x, int y);
void setCursorRectVisible(bool visible);
void onEventDragged(Event *event, const QPoint &oldPosition, const QPoint &newPosition);
void onEventReleased(Event *event, const QPoint &position);
void updateWarpEventWarning(Event *event);
void updateWarpEventWarnings();
bool eventLimitReached(Map *, Event::Type);
QPointer<QGraphicsScene> scene = nullptr;
QGraphicsPixmapItem *current_view = nullptr;
QPointer<MapPixmapItem> map_item = nullptr;
QPointer<LayoutPixmapItem> map_item = nullptr;
QList<QPointer<ConnectionPixmapItem>> connection_items;
QMap<QString, QPointer<DivingMapPixmapItem>> diving_map_items;
QGraphicsPathItem *connection_mask = nullptr;
QPointer<CollisionPixmapItem> collision_item = nullptr;
QGraphicsItemGroup *events_group = nullptr;
QList<QGraphicsPixmapItem*> borderItems;
QGraphicsItemGroup *mapGrid = nullptr;
QPointer<MapRuler> map_ruler = nullptr;
MovableRect *playerViewRect = nullptr;
CursorTileRect *cursorMapTileRect = nullptr;
MapRuler *map_ruler = nullptr;
QPointer<QGraphicsScene> scene_metatiles = nullptr;
QPointer<QGraphicsScene> scene_current_metatile_selection = nullptr;
@@ -136,31 +157,51 @@ public:
CurrentSelectedMetatilesPixmapItem *current_metatile_selection_item = nullptr;
QPointer<MovementPermissionsSelector> movement_permissions_selector_item = nullptr;
QList<DraggablePixmapItem *> *selected_events = nullptr;
QList<Event*> selectedEvents;
QPointer<ConnectionPixmapItem> selected_connection_item = nullptr;
QPointer<MapConnection> connection_to_select = nullptr;
QString map_edit_mode = "paint";
QString obj_edit_mode = "select";
enum class EditAction { None, Paint, Select, Fill, Shift, Pick, Move };
EditAction mapEditAction = EditAction::Paint;
EditAction eventEditAction = EditAction::Select;
enum class EditMode { None, Disabled, Metatiles, Collision, Header, Events, Connections, Encounters };
void setEditMode(EditMode editMode);
EditMode getEditMode() const { return this->editMode; }
bool getEditingLayout();
void setMapEditingButtonsEnabled(bool enabled);
int scaleIndex = 2;
qreal collisionOpacity = 0.5;
static QList<QList<const QImage*>> collisionIcons;
void objectsView_onMousePress(QMouseEvent *event);
int getBorderDrawDistance(int dimension);
QUndoGroup editGroup; // Manages the undo history for each map
bool selectingEvent = false;
int eventShiftActionId = 0;
int eventMoveActionId = 0;
void deleteSelectedEvents();
void shouldReselectEvents();
void scaleMapView(int);
static void openInTextEditor(const QString &path, int lineNum = 0);
bool eventLimitReached(Event::Type type);
void setCollisionGraphics();
enum ZValue {
MapBorder = -4,
MapConnectionInactive = -3,
MapConnectionActive = -2,
MapConnectionMask = -1,
// Event pixmaps set their z value to be their y position on the map.
// Their y value is int16_t, so we have enough space to allocate the
// full range + 1 for the selected event (which should always be on top).
EventMinimum = 1,
EventMaximum = EventMinimum + 0x10000,
Ruler,
ResizeLayoutPopup
};
public slots:
void openMapScripts() const;
void openScript(const QString &scriptLabel) const;
@@ -175,6 +216,9 @@ private:
const QImage collisionPlaceholder = QImage(":/images/collisions_unknown.png");
QPixmap collisionSheetPixmap;
EditMode editMode = EditMode::None;
bool save(bool currentOnly);
void clearMap();
void clearMetatileSelector();
void clearMovementPermissionSelector();
@@ -188,15 +232,14 @@ private:
void clearMapBorder();
void clearMapGrid();
void clearWildMonTables();
int getSortedItemIndex(QComboBox *combo, QString item);
void updateBorderVisibility();
void disconnectMapConnection(MapConnection *connection);
QPoint getConnectionOrigin(MapConnection *connection);
void removeConnectionPixmap(MapConnection *connection);
void updateConnectionPixmap(ConnectionPixmapItem *connectionItem);
void displayConnection(MapConnection *connection);
void displayDivingConnection(MapConnection *connection);
void setDivingMapName(QString mapName, QString direction);
void removeDivingMapPixmap(MapConnection *connection);
void onDivingMapEditingFinished(NoScrollComboBox* combo, const QString &direction);
void updateDivingMapButton(QToolButton* button, const QString &mapName);
void updateEncounterFields(EncounterFields newFields);
QString getMovementPermissionText(uint16_t collision, uint16_t elevation);
QString getMetatileDisplayMessage(uint16_t metatileId);
@@ -206,11 +249,11 @@ private:
qint64 *pid = nullptr);
private slots:
void onMapStartPaint(QGraphicsSceneMouseEvent *event, MapPixmapItem *item);
void onMapEndPaint(QGraphicsSceneMouseEvent *event, MapPixmapItem *item);
void onMapStartPaint(QGraphicsSceneMouseEvent *event, LayoutPixmapItem *item);
void onMapEndPaint(QGraphicsSceneMouseEvent *event, LayoutPixmapItem *item);
void setSmartPathCursorMode(QGraphicsSceneMouseEvent *event);
void setStraightPathCursorMode(QGraphicsSceneMouseEvent *event);
void mouseEvent_map(QGraphicsSceneMouseEvent *event, MapPixmapItem *item);
void mouseEvent_map(QGraphicsSceneMouseEvent *event, LayoutPixmapItem *item);
void mouseEvent_collision(QGraphicsSceneMouseEvent *event, CollisionPixmapItem *item);
void setSelectedConnectionItem(ConnectionPixmapItem *connectionItem);
void onHoveredMovementPermissionChanged(uint16_t, uint16_t);
@@ -225,12 +268,12 @@ private slots:
void onWheelZoom(int);
signals:
void objectsChanged();
void eventsChanged();
void openEventMap(Event*);
void openConnectedMap(MapConnection*);
void wildMonTableOpened(EncounterTableModel*);
void wildMonTableClosed();
void wildMonTableEdited();
void warpEventDoubleClicked(QString, int, Event::Group);
void currentMetatilesSelectionChanged();
void mapRulerStatusChanged(const QString &);
void tilesetUpdated(QString);

View File

@@ -0,0 +1,69 @@
/*
Elypson/qt-collapsible-section
(c) 2016 Michael A. Voelkel - michael.alexander.voelkel@gmail.com
This file is part of Elypson/qt-collapsible section.
Elypson/qt-collapsible-section is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Elypson/qt-collapsible-section is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with Elypson/qt-collapsible-section. If not, see <http://www.gnu.org/licenses/>.
PORYMAP NOTE: Modified to support having the section expanded by default, to stop the contents
squashing during the collapse animation, and to add some guard rails against crashes.
*/
#ifndef COLLAPSIBLESECTION_H
#define COLLAPSIBLESECTION_H
#include <QFrame>
#include <QGridLayout>
#include <QParallelAnimationGroup>
#include <QPropertyAnimation>
#include <QSet>
#include <QScrollArea>
#include <QToolButton>
#include <QWidget>
class CollapsibleSection : public QWidget
{
Q_OBJECT
public:
explicit CollapsibleSection(const QString& title = "", const bool expanded = false, const int animationDuration = 0, QWidget* parent = 0);
void setContentLayout(QLayout* contentLayout);
void setTitle(const QString &title);
bool isExpanded() const { return this->expanded; }
public slots:
void toggle(bool collapsed);
private:
QGridLayout* mainLayout;
QToolButton* toggleButton;
QFrame* headerLine;
QParallelAnimationGroup* toggleAnimation;
QSet<QPropertyAnimation*> sectionAnimations;
QPropertyAnimation* contentAnimation;
QScrollArea* contentArea;
int animationDuration;
int collapsedHeight;
bool expanded;
void updateToggleButton();
void updateAnimationTargets();
int getContentHeight() const;
};
#endif // COLLAPSIBLESECTION_H

View File

@@ -96,6 +96,7 @@ namespace fex
case Type::kValuePair:
return pair_.first + " = " + pair_.second->ToString() + "\n";
}
return "";
}
static ArrayValue Empty()

View File

@@ -4,6 +4,7 @@
#include <cstdint>
#include <string>
#include <vector>
#include <QString>
namespace fex
{
@@ -89,9 +90,7 @@ namespace fex
Lexer() = default;
~Lexer() = default;
std::vector<Token> LexFile(const std::string &path);
std::vector<Token> LexString(const std::string &data);
void LexFileDumpTokens(const std::string &path, const std::string &out);
std::vector<Token> LexFile(const QString &path);
private:
std::vector<Token> Lex();

View File

@@ -9,6 +9,7 @@
#include "array_value.h"
#include "define_statement.h"
#include "lexer.h"
#include "orderedmap.h"
namespace fex
{
@@ -19,9 +20,9 @@ namespace fex
std::vector<DefineStatement> Parse(std::vector<Token> tokens);
std::vector<Array> ParseTopLevelArrays(std::vector<Token> tokens);
std::map<std::string, ArrayValue> ParseTopLevelObjects(std::vector<Token> tokens);
tsl::ordered_map<std::string, ArrayValue> ParseTopLevelObjects(std::vector<Token> tokens);
std::map<std::string, int> ReadDefines(const std::string &filename, std::vector<std::string> matching);
tsl::ordered_map<std::string, int> ReadDefines(const QString &filename, std::vector<std::string> matching);
private:
int EvaluateExpression(std::vector<Token> tokens);

View File

@@ -1,19 +0,0 @@
#ifndef PARSER_UTIL_H
#define PARSER_UTIL_H
#include <QString>
#include <QStringList>
class ParserUtil
{
public:
ParserUtil(QString root);
QStringList ReadDefines(QString filename, QString prefix);
QStringList ReadDefinesValueSort(QString filename, QString prefix);
private:
QString root_;
};
#endif // PARSER_UTIL_H

View File

@@ -99,7 +99,7 @@ public:
// Array and object typedefs
typedef QVector<Json> array;
typedef tsl::ordered_map<QString, Json> object;
typedef OrderedMap<QString, Json> object;
// Constructors for the various types of JSON value.
Json() noexcept; // NUL
@@ -132,7 +132,22 @@ public:
int>::type = 0>
Json(const V & v) : Json(array(v.begin(), v.end())) {}
static const Json fromQJsonValue(QJsonValue value);
static Json fromQJsonValue(const QJsonValue &value);
static void append(Json::array *array, const QJsonArray &addendum) {
for (const auto &i : addendum) array->push_back(fromQJsonValue(i));
}
static void append(Json::array *array, const Json::array &addendum) {
for (const auto &i : addendum) array->push_back(i);
}
static void append(Json::object *object, const QJsonObject &addendum) {
for (auto it = addendum.constBegin(); it != addendum.constEnd(); it++)
(*object)[it.key()] = fromQJsonValue(it.value());
}
static void append(Json::object *object, const Json::object &addendum) {
for (auto it = addendum.cbegin(); it != addendum.cend(); it++)
(*object)[it.key()] = it.value();
}
// This prevents Json(some_pointer) from accidentally producing a bool. Use
// Json(bool(some_pointer)) if that behavior is desired.
@@ -182,15 +197,15 @@ public:
// Parse. If parse fails, return Json() and assign an error message to err.
static Json parse(const QString & in,
QString & err,
QString * err = nullptr,
JsonParse strategy = JsonParse::STANDARD);
static Json parse(const char * in,
QString & err,
QString * err = nullptr,
JsonParse strategy = JsonParse::STANDARD) {
if (in) {
return parse(QString(in), err, strategy);
} else {
err = "null input";
if (err) *err = "null input";
return nullptr;
}
}
@@ -247,4 +262,7 @@ protected:
} // namespace poryjson
using OrderedJson = poryjson::Json;
using OrderedJsonDoc = poryjson::JsonDoc;
#endif // ORDERED_JSON_H

View File

@@ -1977,6 +1977,14 @@ public:
size_type erase(const K& key, std::size_t precalculated_hash) {
return m_ht.erase(key, precalculated_hash);
}
// Naive solution for take, should probably be replaced with one that does a single lookup and no unnecessary insertion.
// We want to mirror the behavior of QMap::take, which returns a default-constructed value if the key is not present.
T take(const key_type& key) {
typename ValueSelect::value_type value = m_ht[key];
m_ht.erase(key);
return value;
}
@@ -2404,4 +2412,7 @@ private:
} // end namespace tsl
template<class Key, class T>
using OrderedMap = tsl::ordered_map<Key, T>;
#endif

View File

@@ -21,16 +21,18 @@
#include "regionmapeditor.h"
#include "mapimageexporter.h"
#include "filterchildrenproxymodel.h"
#include "newmappopup.h"
#include "newtilesetdialog.h"
#include "maplistmodels.h"
#include "shortcutseditor.h"
#include "preferenceeditor.h"
#include "projectsettingseditor.h"
#include "gridsettings.h"
#include "customscriptseditor.h"
#include "wildmonchart.h"
#include "wildmonsearch.h"
#include "updatepromoter.h"
#include "aboutporymap.h"
#include "mapheaderform.h"
#include "newlayoutdialog.h"
@@ -50,6 +52,8 @@ public:
MainWindow(const MainWindow &) = delete;
MainWindow & operator = (const MainWindow &) = delete;
void initialize();
// Scripting API
Q_INVOKABLE QJSValue getBlock(int x, int y);
void tryRedrawMapArea(bool forceRedraw);
@@ -172,41 +176,37 @@ private slots:
void on_action_Open_Project_triggered();
void on_action_Reload_Project_triggered();
void on_action_Close_Project_triggered();
void on_mapList_activated(const QModelIndex &index);
void on_action_Save_Project_triggered();
void openWarpMap(QString map_name, int event_id, Event::Group event_group);
bool save(bool currentOnly = false);
void openEventMap(Event *event);
void duplicate();
void setClipboardData(poryjson::Json::object);
void setClipboardData(QImage);
void setClipboardData(const QString &text);
void copy();
void paste();
void onOpenConnectedMap(MapConnection*);
void onMapNeedsRedrawing();
void onTilesetsSaved(QString, QString);
void openNewMapPopupWindow();
void onNewMapCreated();
void onMapCacheCleared();
void onNewMapCreated(Map *newMap, const QString &groupName);
void onNewMapGroupCreated(const QString &groupName);
void onNewMapSectionCreated(const QString &idName);
void onMapSectionDisplayNameChanged(const QString &idName, const QString &displayName);
void onNewLayoutCreated(Layout *layout);
void onNewTilesetCreated(Tileset *tileset);
void onMapLoaded(Map *map);
void importMapFromAdvanceMap1_92();
void onMapRulerStatusChanged(const QString &);
void applyUserShortcuts();
void markMapEdited(Map*);
void markLayoutEdited();
void on_action_NewMap_triggered();
void on_actionNew_Tileset_triggered();
void on_action_Save_triggered();
void on_action_Exit_triggered();
void on_comboBox_Song_currentTextChanged(const QString &arg1);
void on_comboBox_Location_currentTextChanged(const QString &arg1);
void on_comboBox_Weather_currentTextChanged(const QString &arg1);
void on_comboBox_Type_currentTextChanged(const QString &arg1);
void on_comboBox_BattleScene_currentTextChanged(const QString &arg1);
void on_checkBox_ShowLocation_stateChanged(int selected);
void on_checkBox_AllowRunning_stateChanged(int selected);
void on_checkBox_AllowBiking_stateChanged(int selected);
void on_checkBox_AllowEscaping_stateChanged(int selected);
void on_spinBox_FloorNumber_valueChanged(int offset);
void onLayoutSelectorEditingFinished();
void on_comboBox_LayoutSelector_currentTextChanged(const QString &text);
void on_actionShortcuts_triggered();
void on_actionZoom_In_triggered();
@@ -221,14 +221,10 @@ private slots:
void on_actionMove_triggered();
void on_actionMap_Shift_triggered();
void onDeleteKeyPressed();
void on_toolButton_deleteObject_clicked();
void addNewEvent(Event::Type type);
void tryAddEventTab(QWidget * tab);
void displayEventTabs();
void updateSelectedObjects();
void updateObjects();
void updateSelectedEvents();
void updateEvents();
void on_toolButton_Paint_clicked();
void on_toolButton_Select_clicked();
@@ -238,9 +234,6 @@ private slots:
void on_toolButton_Shift_clicked();
void onOpenMapListContextMenu(const QPoint &point);
void onAddNewMapToGroupClick(QAction* triggeredAction);
void onAddNewMapToAreaClick(QAction* triggeredAction);
void onAddNewMapToLayoutClick(QAction* triggeredAction);
void currentMetatilesSelectionChanged();
void on_action_Export_Map_Image_triggered();
@@ -251,49 +244,41 @@ private slots:
void on_pushButton_AddConnection_clicked();
void on_button_OpenDiveMap_clicked();
void on_button_OpenEmergeMap_clicked();
void on_comboBox_DiveMap_currentTextChanged(const QString &mapName);
void on_comboBox_EmergeMap_currentTextChanged(const QString &mapName);
void on_comboBox_PrimaryTileset_currentTextChanged(const QString &arg1);
void on_comboBox_SecondaryTileset_currentTextChanged(const QString &arg1);
void on_pushButton_ChangeDimensions_clicked();
void on_checkBox_smartPaths_stateChanged(int selected);
void on_checkBox_Visibility_stateChanged(int selected);
void on_checkBox_ToggleBorder_stateChanged(int selected);
void resetMapViewScale();
void on_actionTileset_Editor_triggered();
void mapSortOrder_changed(QAction *action);
void on_lineEdit_filterBox_textChanged(const QString &arg1);
void moveEvent(QMoveEvent *event);
void closeEvent(QCloseEvent *);
void eventTabChanged(int index);
void on_checkBox_MirrorConnections_stateChanged(int selected);
void on_actionDive_Emerge_Map_triggered();
void on_actionShow_Events_In_Map_View_triggered();
void on_groupBox_DiveMapOpacity_toggled(bool on);
void on_slider_DiveEmergeMapOpacity_valueChanged(int value);
void on_slider_DiveMapOpacity_valueChanged(int value);
void on_slider_EmergeMapOpacity_valueChanged(int value);
void on_horizontalSlider_CollisionTransparency_valueChanged(int value);
void on_toolButton_ExpandAll_clicked();
void on_toolButton_CollapseAll_clicked();
void mapListShortcut_ToggleEmptyFolders();
void mapListShortcut_ExpandAll();
void mapListShortcut_CollapseAll();
void on_actionAbout_Porymap_triggered();
void on_actionOpen_Log_File_triggered();
void on_actionOpen_Config_Folder_triggered();
void on_pushButton_AddCustomHeaderField_clicked();
void on_pushButton_DeleteCustomHeaderField_clicked();
void on_tableWidget_CustomHeaderFields_cellChanged(int row, int column);
void on_horizontalSlider_MetatileZoom_valueChanged(int value);
void on_horizontalSlider_CollisionZoom_valueChanged(int value);
void on_pushButton_NewWildMonGroup_clicked();
void on_pushButton_DeleteWildMonGroup_clicked();
void on_pushButton_SummaryChart_clicked();
void on_pushButton_ConfigureEncountersJSON_clicked();
void on_toolButton_WildMonSearch_clicked();
void on_pushButton_CreatePrefab_clicked();
void on_spinBox_SelectedElevation_valueChanged(int elevation);
void on_spinBox_SelectedCollision_valueChanged(int collision);
@@ -306,91 +291,128 @@ private slots:
void reloadScriptEngine();
void on_actionShow_Grid_triggered();
void on_actionGrid_Settings_triggered();
void openWildMonTable(const QString &mapName, const QString &groupName, const QString &fieldName);
public:
Ui::MainWindow *ui;
QPointer<Editor> editor = nullptr;
signals:
void mapOpened(Map*);
void layoutOpened(Layout*);
private:
QLabel *label_MapRulerStatus = nullptr;
QPointer<TilesetEditor> tilesetEditor = nullptr;
QPointer<RegionMapEditor> regionMapEditor = nullptr;
QPointer<ShortcutsEditor> shortcutsEditor = nullptr;
QPointer<MapImageExporter> mapImageExporter = nullptr;
QPointer<NewMapPopup> newMapPrompt = nullptr;
QPointer<PreferenceEditor> preferenceEditor = nullptr;
QPointer<ProjectSettingsEditor> projectSettingsEditor = nullptr;
QPointer<GridSettingsDialog> gridSettingsDialog = nullptr;
QPointer<CustomScriptsEditor> customScriptsEditor = nullptr;
QPointer<FilterChildrenProxyModel> groupListProxyModel = nullptr;
QPointer<MapGroupModel> mapGroupModel = nullptr;
QPointer<FilterChildrenProxyModel> locationListProxyModel = nullptr;
QPointer<MapLocationModel> mapLocationModel = nullptr;
QPointer<FilterChildrenProxyModel> layoutListProxyModel = nullptr;
QPointer<LayoutTreeModel> layoutTreeModel = nullptr;
QPointer<UpdatePromoter> updatePromoter = nullptr;
QPointer<NetworkAccessManager> networkAccessManager = nullptr;
QPointer<AboutPorymap> aboutWindow = nullptr;
QPointer<WildMonChart> wildMonChart = nullptr;
FilterChildrenProxyModel *mapListProxyModel;
QStandardItemModel *mapListModel;
QList<QStandardItem*> *mapGroupItemsList;
QMap<QString, QModelIndex> mapListIndexes;
QIcon mapIcon;
QPointer<WildMonSearch> wildMonSearch = nullptr;
QAction *undoAction = nullptr;
QAction *redoAction = nullptr;
QPointer<QUndoView> undoView = nullptr;
QAction *copyAction = nullptr;
QAction *pasteAction = nullptr;
QMap<Event::Group, DraggablePixmapItem*> lastSelectedEvent;
MapHeaderForm *mapHeaderForm = nullptr;
QMap<Event::Group, Event*> lastSelectedEvent;
bool isProgrammaticEventTabChange;
bool newMapDefaultsSet = false;
bool tilesetNeedsRedraw = false;
bool userSetMap(QString, bool scrollTreeView = false);
bool setMap(QString, bool scrollTreeView = false);
bool setLayout(QString layoutId);
bool setMap(QString);
void unsetMap();
bool userSetLayout(QString layoutId);
bool userSetMap(QString);
void redrawMapScene();
void refreshMapScene();
bool checkProjectSanity();
void refreshMetatileViews();
void refreshCollisionSelector();
void setLayoutOnlyMode(bool layoutOnly);
bool isInvalidProject(Project *project);
bool checkProjectSanity(Project *project);
bool checkProjectVersion(Project *project);
bool loadProjectData();
bool setProjectUI();
void clearProjectUI();
void sortMapList();
void openEditHistory();
void openNewMapDialog();
void openDuplicateMapDialog(const QString &mapName);
NewLayoutDialog* createNewLayoutDialog(const Layout *layoutToCopy = nullptr);
void openNewLayoutDialog();
void openDuplicateLayoutDialog(const QString &layoutId);
void openDuplicateMapOrLayoutDialog();
void openNewMapGroupDialog();
void openNewLocationDialog();
void openSubWindow(QWidget * window);
void scrollMapList(MapTree *list, const QString &itemName);
void scrollMapListToCurrentMap(MapTree *list);
void scrollMapListToCurrentLayout(MapTree *list);
void resetMapListFilters();
void showFileWatcherWarning();
QString getExistingDirectory(QString);
bool openProject(QString dir, bool initial = false);
bool closeProject();
void showRecentError(const QString &baseMessage);
void showProjectOpenFailure();
void saveGlobalConfigs();
void showMapsExcludedAlert(const QStringList &excludedMapNames);
bool setInitialMap();
QStandardItem* createMapItem(QString mapName, int groupNum, int inGroupNum);
void saveGlobalConfigs();
void refreshRecentProjectsMenu();
void updateMapListIcon(const QString &mapName);
void rebuildMapList_Locations();
void rebuildMapList_Layouts();
void updateMapList();
void openMapListItem(const QModelIndex &index);
void onMapListTabChanged(int index);
void displayMapProperties();
void checkToolButtons();
void clickToolButtonFromEditMode(QString editMode);
void clickToolButtonFromEditAction(Editor::EditAction editAction);
void markMapEdited();
void markMapEdited(Map*);
void showWindowTitle();
void updateWindowTitle();
void initWindow();
void initCustomUI();
void initExtraSignals();
void initEditor();
void initMiscHeapObjects();
void initMapSortOrder();
void initMapList();
void initShortcuts();
void initExtraShortcuts();
void loadUserSettings();
void applyMapListFilter(QString filterText);
void restoreWindowState();
void setTheme(QString);
void updateTilesetEditor();
Event::Group getEventGroupFromTabWidget(QWidget *tab);
bool closeSupplementaryWindows();
void setWindowDisabled(bool);
void resetMapCustomAttributesTable();
void initTilesetEditor();
bool initRegionMapEditor(bool silent = false);
bool askToFixRegionMapEditor();
@@ -403,19 +425,20 @@ private:
double getMetatilesZoomScale();
void redrawMetatileSelection();
void scrollMetatileSelectorToSelection();
MapListToolBar* getMapListToolBar(int tab);
MapListToolBar* getCurrentMapListToolBar();
MapTree* getCurrentMapList();
void setLocationComboBoxes(const QStringList &locations);
QObjectList shortcutableObjects() const;
void addCustomHeaderValue(QString key, QJsonValue value, bool isNew = false);
int insertTilesetLabel(QStringList * list, QString label);
void checkForUpdates(bool requestedByUser);
void setDivingMapsVisible(bool visible);
};
enum MapListUserRoles {
GroupRole = Qt::UserRole + 1, // Used to hold the map group number.
TypeRole, // Used to differentiate between the different layers of the map list tree view.
TypeRole2, // Used for various extra data needed.
void setSmartPathsEnabled(bool enabled);
void setBorderVisibility(bool visible);
void setMirrorConnectionsEnabled(bool enabled);
};
// These are namespaced in a struct to avoid colliding with e.g. class Map.
@@ -437,4 +460,10 @@ struct MapViewTab {
};
};
struct MapListTab {
enum {
Groups = 0, Locations, Layouts
};
};
#endif // MAINWINDOW_H

View File

@@ -4,7 +4,6 @@
#include "map.h"
#include "blockdata.h"
#include "heallocation.h"
#include "wildmoninfo.h"
#include "parseutil.h"
#include "orderedjson.h"
@@ -18,14 +17,11 @@
#include <QVariant>
#include <QFileSystemWatcher>
// The displayed name of the special map value used by warps with multiple potential destinations
static QString DYNAMIC_MAP_NAME = "Dynamic";
class Project : public QObject
{
Q_OBJECT
public:
Project(QWidget *parent = nullptr);
Project(QObject *parent = nullptr);
~Project();
Project(const Project &) = delete;
@@ -35,29 +31,24 @@ public:
public:
QString root;
QStringList groupNames;
QMap<QString, int> mapGroups;
QList<QStringList> groupedMapNames;
QStringList mapNames;
QList<HealLocation> healLocations;
QMap<QString, int> healLocationNameToValue;
QStringList groupNames;
QMap<QString, QStringList> groupNameToMapNames;
QStringList healLocationSaveOrder;
QMap<QString, QList<HealLocationEvent*>> healLocations;
QMap<QString, QString> mapConstantsToMapNames;
QMap<QString, QString> mapNamesToMapConstants;
QStringList mapLayoutsTable;
QStringList mapLayoutsTableMaster;
QString layoutsLabel;
QMap<QString, MapLayout*> mapLayouts;
QMap<QString, MapLayout*> mapLayoutsMaster;
QMap<QString, QString> mapSecToMapHoverName;
QMap<QString, int> mapSectionNameToValue;
QMap<int, QString> mapSectionValueToName;
QMap<QString, EventGraphics*> eventGraphicsMap;
QStringList layoutIds;
QStringList layoutIdsMaster;
QMap<QString, Layout*> mapLayouts;
QMap<QString, Layout*> mapLayoutsMaster;
QMap<QString, int> gfxDefines;
QString defaultSong;
QStringList songNames;
QStringList itemNames;
QStringList flagNames;
QStringList varNames;
QStringList speciesNames;
QStringList movementTypes;
QStringList mapTypes;
QStringList mapBattleScenes;
@@ -67,14 +58,17 @@ public:
QStringList bgEventFacingDirections;
QStringList trainerTypes;
QStringList globalScriptLabels;
QStringList mapSectionIdNamesSaveOrder;
QStringList mapSectionIdNames;
QMap<uint32_t, QString> encounterTypeToName;
QMap<uint32_t, QString> terrainTypeToName;
QMap<QString, QMap<QString, uint16_t>> metatileLabelsMap;
QMap<QString, uint16_t> unusedMetatileLabels;
QMap<QString, uint32_t> metatileBehaviorMap;
QMap<uint32_t, QString> metatileBehaviorMapInverse;
QMap<QString, QString> facingDirections;
ParseUtil parser;
QFileSystemWatcher fileWatcher;
QMap<QString, qint64> modifiedFileTimestamps;
QSet<QString> modifiedFiles;
bool usingAsmTilesets;
QSet<QString> disabledSettingsNames;
int pokemonMinLevel;
@@ -82,30 +76,27 @@ public:
int maxEncounterRate;
bool wildEncountersLoaded;
void set_root(QString);
void setRoot(const QString&);
void initSignals();
void clearMapCache();
void clearMaps();
void clearTilesetCache();
void clearMapLayouts();
void clearEventGraphics();
struct DataQualifiers
{
bool isStatic;
bool isConst;
};
DataQualifiers getDataQualifiers(QString, QString);
DataQualifiers healLocationDataQualifiers;
QString healLocationsTableName;
void clearHealLocations();
bool sanityCheck();
int getSupportedMajorVersion(QString *errorOut = nullptr);
bool load();
QMap<QString, Map*> mapCache;
Map* loadMap(QString);
Map* getMap(QString);
Map* loadMap(const QString &mapName);
// Note: This does not guarantee the map is loaded.
Map* getMap(const QString &mapName) { return this->maps.value(mapName); }
bool isMapLoaded(const Map *map) const { return map && isMapLoaded(map->name()); }
bool isMapLoaded(const QString &mapName) const { return this->loadedMapNames.contains(mapName); }
bool isLayoutLoaded(const Layout *layout) const { return layout && isLayoutLoaded(layout->id); }
bool isLayoutLoaded(const QString &layoutId) const { return this->loadedLayoutIds.contains(layoutId); }
QMap<QString, Tileset*> tilesetCache;
Tileset* loadTileset(QString, Tileset *tileset = nullptr);
@@ -114,64 +105,81 @@ public:
QStringList secondaryTilesetLabels;
QStringList tilesetLabelsOrdered;
Blockdata readBlockdata(QString);
bool loadBlockdata(MapLayout*);
bool loadLayoutBorder(MapLayout*);
void saveTextFile(QString path, QString text);
void appendTextFile(QString path, QString text);
void deleteFile(QString path);
Blockdata readBlockdata(QString, bool *ok = nullptr);
bool loadBlockdata(Layout *);
bool loadLayoutBorder(Layout *);
bool readMapGroups();
Map* addNewMapToGroup(QString, int, Map*, bool, bool);
QString getNewMapName();
QString getProjectTitle();
void addNewMapGroup(const QString &groupName);
QString mapNameToMapGroup(const QString &mapName) const;
QString getMapConstant(const QString &mapName, const QString &defaultValue = QString()) const;
QString getMapLayoutId(const QString &mapName, const QString &defaultValue = QString()) const;
QString getMapLocation(const QString &mapName, const QString &defaultValue = QString()) const;
QString readMapLayoutId(QString map_name);
QString readMapLocation(QString map_name);
struct NewMapSettings {
QString name;
QString group;
bool canFlyTo;
Layout::Settings layout;
MapHeader header;
};
NewMapSettings newMapSettings;
Layout::Settings newLayoutSettings;
void initNewMapSettings();
void initNewLayoutSettings();
Map *createNewMap(const Project::NewMapSettings &mapSettings, const Map* toDuplicate = nullptr);
Layout *createNewLayout(const Layout::Settings &layoutSettings, const Layout* toDuplicate = nullptr);
Tileset *createNewTileset(QString name, bool secondary, bool checkerboardFill);
bool isIdentifierUnique(const QString &identifier) const;
bool isValidNewIdentifier(const QString &identifier) const;
QString toUniqueIdentifier(const QString &identifier) const;
QString getProjectTitle() const;
QString getNewHealLocationName(const Map* map) const;
bool readWildMonData();
tsl::ordered_map<QString, tsl::ordered_map<QString, WildPokemonHeader>> wildMonData;
OrderedMap<QString, OrderedMap<QString, WildPokemonHeader>> wildMonData;
QString wildMonTableName;
QVector<EncounterField> wildMonFields;
QVector<QString> encounterGroupLabels;
QVector<poryjson::Json::object> extraEncounterGroups;
bool readSpeciesIconPaths();
QMap<QString, QString> speciesToIconPath;
QString getDefaultSpeciesIconPath(const QString &species);
QPixmap getSpeciesIcon(const QString &species);
QSet<QString> getTopLevelMapFields();
bool addNewMapsec(const QString &idName, const QString &displayName = QString());
void removeMapsec(const QString &idName);
QString getMapsecDisplayName(const QString &idName) const { return this->locationData.value(idName).displayName; }
void setMapsecDisplayName(const QString &idName, const QString &displayName);
bool hasUnsavedChanges();
bool hasUnsavedDataChanges = false;
bool readMapJson(const QString &mapName, QJsonDocument * out);
bool loadMapEvent(Map *map, QJsonObject json, Event::Type defaultType = Event::Type::None);
bool loadMapData(Map*);
bool readMapLayouts();
bool loadLayout(MapLayout *);
Layout *loadLayout(QString layoutId);
bool loadLayout(Layout *);
bool loadMapLayout(Map*);
bool loadLayoutTilesets(MapLayout*);
void loadTilesetAssets(Tileset*);
void loadTilesetTiles(Tileset*, QImage);
void loadTilesetMetatiles(Tileset*);
bool loadLayoutTilesets(Layout *);
bool loadTilesetAssets(Tileset*);
void loadTilesetMetatileLabels(Tileset*);
void loadTilesetPalettes(Tileset*);
void readTilesetPaths(Tileset* tileset);
void saveLayoutBlockdata(Map*);
void saveLayoutBorder(Map*);
void writeBlockdata(QString, const Blockdata &);
void saveAllMaps();
void saveMap(Map*);
void saveAllDataStructures();
void saveConfig();
void saveMapLayouts();
void saveMapGroups();
void saveWildMonData();
void saveMapConstantsHeader();
void saveHealLocations(Map*);
void saveTilesets(Tileset*, Tileset*);
void saveTilesetMetatileLabels(Tileset*, Tileset*);
void saveTilesetMetatileAttributes(Tileset*);
void saveTilesetMetatiles(Tileset*);
void saveTilesetTilesImage(Tileset*);
void saveTilesetPalettes(Tileset*);
void appendTilesetLabel(QString label, QString isSecondaryStr);
bool saveAll();
bool saveGlobalData();
bool saveConfig();
bool saveLayout(Layout *layout);
bool saveMap(Map *map, bool skipLayout = false);
bool saveTextFile(const QString &path, const QString &text);
bool saveRegionMapSections();
bool saveTilesets(Tileset*, Tileset*);
bool saveTilesetMetatileLabels(Tileset*, Tileset*);
void appendTilesetLabel(const QString &label, const QString &isSecondaryStr);
bool readTilesetLabels();
bool readTilesetMetatileLabels();
bool readRegionMapSections();
@@ -188,7 +196,6 @@ public:
bool readBgEventFacingDirections();
bool readTrainerTypes();
bool readMetatileBehaviors();
bool readHealLocationConstants();
bool readHealLocations();
bool readMiscellaneousConstants();
bool readEventScriptLabels();
@@ -197,9 +204,13 @@ public:
bool readEventGraphics();
bool readFieldmapProperties();
bool readFieldmapMasks();
bool readGlobalConstants();
QMap<QString, QMap<QString, QString>> readObjEventGfxInfo();
void setEventPixmap(Event *event, bool forceLoad = false);
QPixmap getEventPixmap(const QString &gfxName, const QString &movementName);
QPixmap getEventPixmap(const QString &gfxName, int frame, bool hFlip);
QPixmap getEventPixmap(Event::Group group);
void loadEventPixmap(Event *event, bool forceLoad = false);
QString fixPalettePath(QString path);
QString fixGraphicPath(QString path);
@@ -207,59 +218,138 @@ public:
static QString getScriptFileExtension(bool usePoryScript);
QString getScriptDefaultString(bool usePoryScript, QString mapName) const;
QStringList getEventScriptsFilePaths() const;
void insertGlobalScriptLabels(QStringList &scriptLabels) const;
QString getDefaultPrimaryTilesetLabel();
QString getDefaultSecondaryTilesetLabel();
QString getDynamicMapDefineName();
QString getDefaultPrimaryTilesetLabel() const;
QString getDefaultSecondaryTilesetLabel() const;
void updateTilesetMetatileLabels(Tileset *tileset);
QString buildMetatileLabelsText(const QMap<QString, uint16_t> defines);
QString findMetatileLabelsTileset(QString label);
static QString getExistingFilepath(QString filepath);
void applyParsedLimits();
void setRegionMapEntries(const QHash<QString, MapSectionEntry> &entries);
QHash<QString, MapSectionEntry> getRegionMapEntries() const;
static int getNumTilesPrimary();
static int getNumTilesTotal();
static int getNumMetatilesPrimary();
static int getNumMetatilesTotal();
static int getNumPalettesPrimary();
static int getNumPalettesTotal();
static int getMaxMapDataSize();
static int getDefaultMapSize();
static int getMaxMapWidth();
static int getMaxMapHeight();
static int getMapDataSize(int width, int height);
static bool mapDimensionsValid(int width, int height);
QSet<QString> getTopLevelMapFields() const;
int getMapDataSize(int width, int height) const;
int getMaxMapDataSize() const { return this->maxMapDataSize; }
int getMaxMapWidth() const;
int getMaxMapHeight() const;
bool mapDimensionsValid(int width, int height) const;
bool calculateDefaultMapSize();
static int getMaxObjectEvents();
QSize getDefaultMapSize() const { return this->defaultMapSize; }
QSize getMapSizeAddition() const { return this->mapSizeAddition; }
int getMaxEvents(Event::Group group) const;
static QString getEmptyMapDefineName();
static QString getDynamicMapDefineName();
static QString getDynamicMapName();
static QString getEmptySpeciesName();
static QMargins getMetatileViewDistance();
static int getNumTilesPrimary() { return num_tiles_primary; }
static int getNumTilesTotal() { return num_tiles_total; }
static int getNumMetatilesPrimary() { return num_metatiles_primary; }
static int getNumMetatilesTotal() { return Block::getMaxMetatileId() + 1; }
static int getNumPalettesPrimary(){ return num_pals_primary; }
static int getNumPalettesTotal() { return num_pals_total; }
static QString getEmptyMapsecName();
static QString getMapGroupPrefix();
private:
void updateMapLayout(Map*);
QMap<QString, qint64> modifiedFileTimestamps;
QMap<QString, QString> facingDirections;
QHash<QString, QString> speciesToIconPath;
QHash<QString, Map*> maps;
void setNewMapBlockdata(Map* map);
void setNewMapBorder(Map *map);
void setNewMapEvents(Map *map);
void setNewMapConnections(Map *map);
// Fields for preserving top-level JSON data that Porymap isn't expecting.
QJsonObject customLayoutsData;
QJsonObject customMapSectionsData;
QJsonObject customMapGroupsData;
QJsonObject customHealLocationsData;
OrderedJson::object customWildMonData;
OrderedJson::object customWildMonGroupData;
OrderedJson::array extraEncounterGroups;
void saveHealLocationsData(Map *map);
void saveHealLocationsConstants();
// Maps/layouts represented in these sets have been fully loaded from the project.
// If a valid map name / layout id is not in these sets, a Map / Layout object exists
// for it in Project::maps / Project::mapLayouts, but it has been minimally populated
// (i.e. for a map layout it only has the data read from layouts.json, none of its assets
// have been loaded, and for a map it only has the data needed to identify it in the map
// list, none of the rest of its data in map.json).
QSet<QString> loadedMapNames;
QSet<QString> loadedLayoutIds;
void ignoreWatchedFileTemporarily(QString filepath);
const QRegularExpression re_gbapalExtension;
const QRegularExpression re_bppExtension;
struct EventGraphics
{
QString filepath;
bool loaded = false;
QImage spritesheet;
int spriteWidth = -1;
int spriteHeight = -1;
bool inanimate = false;
};
QMap<QString, EventGraphics*> eventGraphicsMap;
// The extra data that can be associated with each MAPSEC name.
struct LocationData
{
MapSectionEntry map;
QString displayName;
QJsonObject custom;
};
QHash<QString, LocationData> locationData;
void setNewLayoutBlockdata(Layout *layout);
void setNewLayoutBorder(Layout *layout);
void watchFile(const QString &filename);
void watchFiles(const QStringList &filenames);
void ignoreWatchedFileTemporarily(const QString &filepath);
void ignoreWatchedFilesTemporarily(const QStringList &filepaths);
void recordFileChange(const QString &filepath);
void resetFileCache();
bool saveMapLayouts();
bool saveMapGroups();
bool saveWildMonData();
bool saveHealLocations();
bool appendTextFile(const QString &path, const QString &text);
QString findSpeciesIconPath(const QStringList &names) const;
int maxObjectEvents;
int maxMapDataSize;
QSize defaultMapSize;
QSize mapSizeAddition;
// TODO: These really shouldn't be static, they're specific to a single project.
// We're making an assumption here that we only have one project open at a single time
// (which is true, but then if that's the case we should have some global Project instance instead)
static int num_tiles_primary;
static int num_tiles_total;
static int num_metatiles_primary;
static int num_pals_primary;
static int num_pals_total;
static int max_map_data_size;
static int default_map_size;
static int max_object_events;
signals:
void reloadProject();
void uncheckMonitorFilesAction();
void mapCacheCleared();
void fileChanged(const QString &filepath);
void mapLoaded(Map *map);
void mapCreated(Map *newMap, const QString &groupName);
void layoutCreated(Layout *newLayout);
void tilesetCreated(Tileset *newTileset);
void mapGroupAdded(const QString &groupName);
void mapSectionAdded(const QString &idName);
void mapSectionDisplayNameChanged(const QString &idName, const QString &displayName);
void mapSectionIdNamesChanged(const QStringList &idNames);
void mapsExcluded(const QStringList &excludedMapNames);
void eventScriptLabelsRead();
};
#endif // PROJECT_H

View File

@@ -9,6 +9,8 @@
#include <QStringList>
#include <QJSEngine>
// !! New callback functions or changes to existing callback function names/arguments
// should be synced to resources/text/script_template.txt and docsrc/manual/scripting-capabilities.rst
enum CallbackType {
OnProjectOpened,
OnProjectClosed,
@@ -17,6 +19,7 @@ enum CallbackType {
OnBlockHoverChanged,
OnBlockHoverCleared,
OnMapOpened,
OnLayoutOpened,
OnMapResized,
OnBorderResized,
OnMapShifted,
@@ -36,6 +39,7 @@ public:
static void populateGlobalObject(MainWindow *mainWindow);
static QJSEngine *getEngine();
static void invokeAction(int actionIndex);
static void cb_ProjectOpened(QString projectPath);
static void cb_ProjectClosed(QString projectPath);
static void cb_MetatileChanged(int x, int y, Block prevBlock, Block newBlock);
@@ -43,18 +47,21 @@ public:
static void cb_BlockHoverChanged(int x, int y);
static void cb_BlockHoverCleared();
static void cb_MapOpened(QString mapName);
static void cb_MapResized(int oldWidth, int oldHeight, int newWidth, int newHeight);
static void cb_LayoutOpened(QString layoutName);
static void cb_MapResized(int oldWidth, int oldHeight, const QMargins &delta);
static void cb_BorderResized(int oldWidth, int oldHeight, int newWidth, int newHeight);
static void cb_MapShifted(int xDelta, int yDelta);
static void cb_TilesetUpdated(QString tilesetName);
static void cb_MainTabChanged(int oldTab, int newTab);
static void cb_MapViewTabChanged(int oldTab, int newTab);
static void cb_BorderVisibilityToggled(bool visible);
static bool tryErrorJS(QJSValue js);
static QJSValue fromBlock(Block block);
static QJSValue fromTile(Tile tile);
static Tile toTile(QJSValue obj);
static QJSValue dimensions(int width, int height);
static QJSValue margins(const QMargins &margins);
static QJSValue position(int x, int y);
static const QImage * getImage(const QString &filepath, bool useCache);
static QJSValue dialogInput(QJSValue input, bool selectedOk);

View File

@@ -42,6 +42,9 @@ public:
Q_INVOKABLE QList<float> getMetatileLayerOpacity();
Q_INVOKABLE void setMetatileLayerOpacity(QList<float> order);
Q_INVOKABLE QList<QString> getMapNames();
Q_INVOKABLE QList<QString> getMapConstants();
Q_INVOKABLE QList<QString> getLayoutNames();
Q_INVOKABLE QList<QString> getLayoutConstants();
Q_INVOKABLE QList<QString> getTilesetNames();
Q_INVOKABLE QList<QString> getPrimaryTilesetNames();
Q_INVOKABLE QList<QString> getSecondaryTilesetNames();

View File

@@ -2,18 +2,19 @@
#define ABOUTPORYMAP_H
#include <QString>
#include <QRegularExpression>
#include <QMainWindow>
#include <QDialog>
namespace Ui {
class AboutPorymap;
}
class AboutPorymap : public QMainWindow
class AboutPorymap : public QDialog
{
public:
explicit AboutPorymap(QWidget *parent = nullptr);
~AboutPorymap();
static QString getVersionString();
private:
Ui::AboutPorymap *ui;
};

View File

@@ -1,21 +1,21 @@
#ifndef BORDERMETATILESPIXMAPITEM_H
#define BORDERMETATILESPIXMAPITEM_H
#include "map.h"
#include "maplayout.h"
#include "metatileselector.h"
#include <QGraphicsPixmapItem>
class BorderMetatilesPixmapItem : public QObject, public QGraphicsPixmapItem {
Q_OBJECT
public:
BorderMetatilesPixmapItem(Map *map_, MetatileSelector *metatileSelector) {
this->map = map_;
this->map->setBorderItem(this);
BorderMetatilesPixmapItem(Layout *layout, MetatileSelector *metatileSelector) {
this->layout = layout;
this->layout->setBorderItem(this);
this->metatileSelector = metatileSelector;
setAcceptHoverEvents(true);
}
MetatileSelector *metatileSelector;
Map *map;
Layout *layout;
void draw();
signals:
void hoveredBorderMetatileSelectionChanged(uint16_t);

View File

@@ -4,19 +4,20 @@
#include <QSpinBox>
#include "metatileselector.h"
#include "mappixmapitem.h"
#include "movementpermissionsselector.h"
#include "layoutpixmapitem.h"
#include "map.h"
#include "settings.h"
class CollisionPixmapItem : public MapPixmapItem {
class CollisionPixmapItem : public LayoutPixmapItem {
Q_OBJECT
public:
CollisionPixmapItem(Map *map, QSpinBox * selectedCollision, QSpinBox * selectedElevation, MetatileSelector *metatileSelector, Settings *settings, qreal *opacity)
: MapPixmapItem(map, metatileSelector, settings){
CollisionPixmapItem(Layout *layout, QSpinBox * selectedCollision, QSpinBox * selectedElevation, MetatileSelector *metatileSelector, Settings *settings, qreal *opacity)
: LayoutPixmapItem(layout, metatileSelector, settings){
this->selectedCollision = selectedCollision;
this->selectedElevation = selectedElevation;
this->opacity = opacity;
map->setCollisionItem(this);
layout->setCollisionItem(this);
}
QSpinBox * selectedCollision;
QSpinBox * selectedElevation;

View File

@@ -2,7 +2,6 @@
#define COLORINPUTWIDGET_H
#include <QGroupBox>
#include <QValidator>
namespace Ui {
class ColorInputWidget;

View File

@@ -27,7 +27,7 @@ private:
QColor color = Qt::white;
void hover(int mouseX, int mouseY);
void hover(const QPoint &pos);
};
#endif // COLORPICKER_H

View File

@@ -5,26 +5,25 @@
#include <QGraphicsPixmapItem>
#include <QPainter>
#include <QPointer>
#include <QKeyEvent>
class ConnectionPixmapItem : public QObject, public QGraphicsPixmapItem {
Q_OBJECT
public:
ConnectionPixmapItem(MapConnection* connection, int originX, int originY);
ConnectionPixmapItem(MapConnection* connection, QPoint origin);
ConnectionPixmapItem(MapConnection* connection);
const QPointer<MapConnection> connection;
void setOrigin(int x, int y);
void setOrigin(QPoint pos);
void setEditable(bool editable);
bool getEditable();
void setSelected(bool selected);
void updatePos();
void render(bool ignoreCache = false);
signals:
void positionChanged(qreal x, qreal y);
private:
QPixmap basePixmap;
qreal originX;
@@ -35,15 +34,20 @@ private:
static const int mWidth = 16;
static const int mHeight = 16;
void updatePos();
void updateOrigin();
void refresh();
protected:
QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
void mousePressEvent(QGraphicsSceneMouseEvent*) override;
void mouseReleaseEvent(QGraphicsSceneMouseEvent*) override;
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent*) override;
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
virtual void mousePressEvent(QGraphicsSceneMouseEvent*) override;
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent*) override;
virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent*) override;
signals:
void connectionItemDoubleClicked(MapConnection*);
void selectionChanged(bool selected);
void deleteRequested(MapConnection*);
};
#endif // CONNECTIONPIXMAPITEM_H

View File

@@ -23,7 +23,6 @@ public:
explicit ConnectionsListItem(QWidget *parent, MapConnection *connection, const QStringList &mapNames);
~ConnectionsListItem();
void updateUI();
void setSelected(bool selected);
private:
@@ -33,20 +32,21 @@ private:
bool isSelected = false;
unsigned actionId = 0;
void updateUI();
protected:
void mousePressEvent(QMouseEvent*) override;
virtual void mousePressEvent(QMouseEvent*) override;
virtual bool eventFilter(QObject*, QEvent *event) override;
signals:
void selected();
void removed(MapConnection*);
void openMapClicked(MapConnection*);
private slots:
void on_comboBox_Direction_currentTextChanged(QString direction);
void on_comboBox_Map_currentTextChanged(QString mapName);
void on_spinBox_Offset_valueChanged(int offset);
void on_button_Delete_clicked();
void on_button_OpenMap_clicked();
private:
void commitDirection();
void commitMap(const QString &mapName);
void commitMove(int offset);
void commitRemove();
};
#endif // CONNECTIONSLISTITEM_H

View File

@@ -1,23 +1,24 @@
#ifndef CURRENTSELECTEDMETATILESPIXMAPITEM_H
#define CURRENTSELECTEDMETATILESPIXMAPITEM_H
#include "map.h"
#include "metatileselector.h"
#include <QGraphicsPixmapItem>
class Layout;
class CurrentSelectedMetatilesPixmapItem : public QGraphicsPixmapItem {
public:
CurrentSelectedMetatilesPixmapItem(Map *map, MetatileSelector *metatileSelector) {
this->map = map;
CurrentSelectedMetatilesPixmapItem(Layout *layout, MetatileSelector *metatileSelector) {
this->layout = layout;
this->metatileSelector = metatileSelector;
}
Map* map = nullptr;
Layout *layout = nullptr;
MetatileSelector *metatileSelector;
void draw();
void setMap(Map *map) { this->map = map; }
void setLayout(Layout *layout) { this->layout = layout; }
};
QPixmap drawMetatileSelection(MetatileSelection selection, Map *map);
QPixmap drawMetatileSelection(MetatileSelection selection, Layout *layout);
#endif // CURRENTSELECTEDMETATILESPIXMAPITEM_H

View File

@@ -0,0 +1,34 @@
#ifndef CUSTOMATTRIBUTESDIALOG_H
#define CUSTOMATTRIBUTESDIALOG_H
#include <QDialog>
#include <QAbstractButton>
#include "customattributestable.h"
namespace Ui {
class CustomAttributesDialog;
}
class CustomAttributesDialog : public QDialog
{
Q_OBJECT
public:
explicit CustomAttributesDialog(CustomAttributesTable *table);
~CustomAttributesDialog();
private:
Ui::CustomAttributesDialog *ui;
CustomAttributesTable *const m_table;
void setInputType(int inputType);
void onNameChanged(const QString &);
bool validateName(bool allowEmpty = false);
void clickedButton(QAbstractButton *button);
void addNewAttribute();
QVariant getValue() const;
};
#endif // CUSTOMATTRIBUTESDIALOG_H

View File

@@ -0,0 +1,36 @@
#ifndef CUSTOMATTRIBUTESFRAME_H
#define CUSTOMATTRIBUTESFRAME_H
/*
The frame containing the Custom Attributes table and its Add/Delete buttons.
Shared by the map's Header tab and Events.
*/
#include "customattributestable.h"
#include <QObject>
#include <QFrame>
namespace Ui {
class CustomAttributesFrame;
}
class CustomAttributesFrame : public QFrame
{
Q_OBJECT
public:
explicit CustomAttributesFrame(QWidget *parent = nullptr);
~CustomAttributesFrame();
CustomAttributesTable* table() const;
private:
Ui::CustomAttributesFrame *ui;
void addAttribute();
void deleteAttribute();
void updateDeleteButton();
};
#endif // CUSTOMATTRIBUTESFRAME_H

View File

@@ -1,25 +1,44 @@
#ifndef CUSTOMATTRIBUTESTABLE_H
#define CUSTOMATTRIBUTESTABLE_H
#include "events.h"
#include <QObject>
#include <QFrame>
#include <QJsonValue>
#include <QTableWidget>
class CustomAttributesTable : public QFrame
class CustomAttributesTable : public QTableWidget
{
public:
explicit CustomAttributesTable(Event *event, QWidget *parent = nullptr);
~CustomAttributesTable();
Q_OBJECT
static const QMap<QString, QJsonValue> getAttributes(QTableWidget * table);
static QJsonValue pickType(QWidget * parent, bool * ok = nullptr);
static void addAttribute(QTableWidget * table, QString key, QJsonValue value, bool isNew = false);
static bool deleteSelectedAttributes(QTableWidget * table);
public:
explicit CustomAttributesTable(QWidget *parent = nullptr);
~CustomAttributesTable() {};
QJsonObject getAttributes() const;
void setAttributes(const QJsonObject &attributes);
void addNewAttribute(const QString &key, const QJsonValue &value);
bool deleteSelectedAttributes();
bool isEmpty() const;
bool isSelectionEmpty() const;
QSet<QString> keys() const { return m_keys; }
QSet<QString> restrictedKeys() const { return m_restrictedKeys; }
void setRestrictedKeys(const QSet<QString> &keys) { m_restrictedKeys = keys; }
signals:
void edited();
protected:
virtual void resizeEvent(QResizeEvent *event) override;
private:
Event *event;
QTableWidget *table;
QSet<QString> m_keys; // All keys currently in the table
QSet<QString> m_restrictedKeys; // All keys not allowed in the table
QPair<QString, QJsonValue> getAttribute(int row) const;
int addAttribute(const QString &key, const QJsonValue &value);
void removeAttribute(const QString &key);
void resizeVertically();
};

View File

@@ -49,6 +49,7 @@ private:
void restoreWindowState();
void initShortcuts();
QObjectList shortcutableObjects() const;
void openManual();
private slots:
void dialogButtonClicked(QAbstractButton *button);

View File

@@ -2,6 +2,7 @@
#define DIVINGMAPPIXMAPITEM_H
#include "mapconnection.h"
#include "noscrollcombobox.h"
#include <QGraphicsPixmapItem>
#include <QPointer>
@@ -10,7 +11,7 @@
class DivingMapPixmapItem : public QObject, public QGraphicsPixmapItem {
Q_OBJECT
public:
DivingMapPixmapItem(MapConnection *connection, QComboBox *combo);
DivingMapPixmapItem(MapConnection *connection, NoScrollComboBox *combo);
~DivingMapPixmapItem();
MapConnection* connection() const { return m_connection; }
@@ -18,7 +19,7 @@ public:
private:
QPointer<MapConnection> m_connection;
QPointer<QComboBox> m_combo;
QPointer<NoScrollComboBox> m_combo;
void setComboText(const QString &text);
static QPixmap getBasePixmap(MapConnection* connection);

View File

@@ -1,70 +0,0 @@
#ifndef DRAGGABLEPIXMAPITEM_H
#define DRAGGABLEPIXMAPITEM_H
#include <QString>
#include <QGraphicsItemGroup>
#include <QGraphicsPixmapItem>
#include <QGraphicsItemAnimation>
#include <QtWidgets>
#include "events.h"
class Editor;
class DraggablePixmapItem : public QObject, public QGraphicsPixmapItem {
Q_OBJECT
public:
DraggablePixmapItem(QPixmap pixmap): QGraphicsPixmapItem(pixmap) {}
DraggablePixmapItem(Event *event, Editor *editor) : QGraphicsPixmapItem(event->getPixmap()) {
this->event = event;
event->setPixmapItem(this);
this->editor = editor;
updatePosition();
}
Event *event = nullptr;
void updatePosition();
void move(int dx, int dy);
void moveTo(const QPoint &pos);
void emitPositionChanged();
void updatePixmap();
private:
Editor *editor = nullptr;
QPoint lastPos;
bool active = false;
bool releaseSelectionQueued = false;
signals:
void positionChanged(Event *event);
void xChanged(int);
void yChanged(int);
void elevationChanged(int);
void spriteChanged(QPixmap pixmap);
void onPropertyChanged(QString key, QString value);
public slots:
void set_x(int x) {
event->setX(x);
updatePosition();
}
void set_y(int y) {
event->setY(y);
updatePosition();
}
void set_elevation(int z) {
event->setElevation(z);
updatePosition();
}
protected:
void mousePressEvent(QGraphicsSceneMouseEvent*);
void mouseMoveEvent(QGraphicsSceneMouseEvent*);
void mouseReleaseEvent(QGraphicsSceneMouseEvent*);
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent*);
};
#endif // DRAGGABLEPIXMAPITEM_H

View File

@@ -14,7 +14,7 @@ class EncounterTableModel : public QAbstractTableModel {
Q_OBJECT
public:
EncounterTableModel(WildMonInfo monInfo, EncounterFields allFields, int fieldIndex, QObject *parent = nullptr);
EncounterTableModel(const WildMonInfo &monInfo, const EncounterField &field, QObject *parent = nullptr);
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
@@ -28,22 +28,17 @@ public:
Slot, Group, Species, MinLevel, MaxLevel, EncounterChance, SlotRatio, EncounterRate, Count
};
WildMonInfo encounterData() const { return this->monInfo; }
EncounterField encounterField() const { return this->encounterFields.at(this->fieldIndex); }
QList<double> percentages() const { return this->slotPercentages; }
void resize(int rows, int cols);
WildMonInfo encounterData() const { return m_monInfo; }
EncounterField encounterField() const { return m_encounterField; }
QVector<double> percentages() const { return m_slotPercentages; }
private:
WildMonInfo monInfo;
EncounterFields encounterFields;
int fieldIndex;
int numRows = 0;
int numCols = 0;
QVector<int> slotRatios;
QList<QString> groupNames;
QList<double> slotPercentages;
int m_numRows = 0;
int m_numCols = 0;
WildMonInfo m_monInfo;
EncounterField m_encounterField;
QMap<int,QString> m_groupNames;
QVector<double> m_slotPercentages;
signals:
void edited();

41
include/ui/eventfilters.h Normal file
View File

@@ -0,0 +1,41 @@
#include <QObject>
#include <QEvent>
/// Prevent wheel scroll
class WheelFilter : public QObject {
Q_OBJECT
public:
WheelFilter(QObject *parent) : QObject(parent) {}
virtual ~WheelFilter() {}
bool eventFilter(QObject *obj, QEvent *event) override;
};
/// Ctrl+Wheel = zoom
class MapSceneEventFilter : public QObject {
Q_OBJECT
protected:
bool eventFilter(QObject *obj, QEvent *event) override;
public:
explicit MapSceneEventFilter(QObject *parent = nullptr) : QObject(parent) {}
signals:
void wheelZoom(int delta);
public slots:
};
/// Emits a signal when a window gets activated / regains focus
class ActiveWindowFilter : public QObject {
Q_OBJECT
public:
ActiveWindowFilter(QObject *parent) : QObject(parent) {}
virtual ~ActiveWindowFilter() {}
bool eventFilter(QObject *obj, QEvent *event) override;
signals:
void activated();
};

View File

@@ -31,8 +31,6 @@ public:
void invalidateUi();
void invalidateValues();
void populateScriptDropdown(NoScrollComboBox * combo, Project * project);
virtual void setActive(bool active);
public:
@@ -52,10 +50,18 @@ public:
QFrame *frame_contents;
QVBoxLayout *layout_contents;
CustomAttributesFrame *custom_attributes;
protected:
bool populated = false;
bool initialized = false;
bool connected = false;
QPointer<Project> project;
void populateDropdown(NoScrollComboBox * combo, const QStringList &items);
void populateScriptDropdown(NoScrollComboBox * combo, Project * project);
void populateMapNameDropdown(NoScrollComboBox * combo, Project * project);
void populateIdNameDropdown(NoScrollComboBox * combo, Project * project, const QString &mapName, Event::Group group);
private:
Event *event;
@@ -76,6 +82,7 @@ public:
virtual void populate(Project *project) override;
public:
QLineEdit *line_edit_local_id;
NoScrollComboBox *combo_sprite;
NoScrollComboBox *combo_movement;
NoScrollSpinBox *spinner_radius_x;
@@ -106,12 +113,15 @@ public:
virtual void populate(Project *project) override;
public:
QLineEdit *line_edit_local_id;
NoScrollComboBox *combo_sprite;
NoScrollSpinBox *spinner_target_id;
NoScrollComboBox *combo_target_id;
NoScrollComboBox *combo_target_map;
private:
CloneObjectEvent *clone;
void tryInvalidateIdDropdown(Map *map);
};
@@ -129,12 +139,15 @@ public:
virtual void populate(Project *project) override;
public:
QLineEdit *line_edit_id;
NoScrollComboBox *combo_dest_map;
NoScrollComboBox *combo_dest_warp;
QPushButton *warning;
private:
WarpEvent *warp;
void tryInvalidateIdDropdown(Map *map);
};
@@ -265,13 +278,16 @@ public:
virtual void populate(Project *project) override;
public:
QLineEdit *line_edit_id;
QFrame *hideable_respawn_map;
QFrame *hideable_respawn_npc;
NoScrollComboBox *combo_respawn_map;
NoScrollSpinBox *spinner_respawn_npc;
NoScrollComboBox *combo_respawn_npc;
private:
HealLocationEvent *healLocation;
void tryInvalidateIdDropdown(Map *map);
};
#endif // EVENTRAMES_H

View File

@@ -0,0 +1,58 @@
#ifndef EVENTPIXMAPITEM_H
#define EVENTPIXMAPITEM_H
#include <QString>
#include <QGraphicsItemGroup>
#include <QGraphicsPixmapItem>
#include <QGraphicsItemAnimation>
#include <QtWidgets>
#include "events.h"
class Project;
class EventPixmapItem : public QObject, public QGraphicsPixmapItem {
Q_OBJECT
public:
explicit EventPixmapItem(Event *event);
void render(Project *project);
bool isSelected() const { return m_selected; }
void setSelected(bool selected) { m_selected = selected; }
Event * getEvent() const { return m_event; }
void move(int dx, int dy);
void moveTo(int x, int y);
void moveTo(const QPoint &pos);
private:
QPixmap m_basePixmap;
Event *const m_event = nullptr;
QPoint m_lastPos;
bool m_active = false;
bool m_selected = false;
bool m_releaseSelectionQueued = false;
void updatePixelPosition();
signals:
void xChanged(int x);
void yChanged(int y);
void posChanged(int x, int y);
void rendered(const QPixmap &pixmap);
void selected(Event *event, bool toggle);
void dragged(Event *event, const QPoint &oldPosition, const QPoint &newPosition);
void released(Event *event, const QPoint &position);
void doubleClicked(Event *event);
protected:
virtual void mousePressEvent(QGraphicsSceneMouseEvent*) override;
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent*) override;
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent*) override;
virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent*) override { emit doubleClicked(m_event); }
};
#endif // EVENTPIXMAPITEM_H

View File

@@ -3,15 +3,30 @@
#include <QSortFilterProxyModel>
class FilterChildrenProxyModel : public QSortFilterProxyModel
class NumericSortProxyModel : public QSortFilterProxyModel
{
Q_OBJECT
public:
explicit FilterChildrenProxyModel(QObject *parent = nullptr);
protected:
bool filterAcceptsRow(int source_row, const QModelIndex & source_parent) const;
explicit NumericSortProxyModel(QObject *parent = nullptr) : QSortFilterProxyModel(parent) {};
protected:
virtual bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override;
};
class FilterChildrenProxyModel : public NumericSortProxyModel
{
Q_OBJECT
public:
explicit FilterChildrenProxyModel(QObject *parent = nullptr) : NumericSortProxyModel(parent) {};
void setHideEmpty(bool hidden) { this->hideEmpty = hidden; }
protected:
virtual bool filterAcceptsRow(int source_row, const QModelIndex & source_parent) const override;
private:
bool hideEmpty = false;
};
#endif // FILTERCHILDRENPROXYMODEL_H

View File

@@ -32,24 +32,17 @@ signals:
void clicked(QMouseEvent *event);
};
class Editor;
class GraphicsView : public QGraphicsView
class ConnectionsView : public QGraphicsView
{
Q_OBJECT
public:
GraphicsView() : QGraphicsView() {}
GraphicsView(QWidget *parent) : QGraphicsView(parent) {}
ConnectionsView(QWidget *parent = nullptr) : QGraphicsView(parent) {}
signals:
void pressedDelete();
public:
// GraphicsView_Object object;
Editor *editor;
protected:
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
void moveEvent(QMoveEvent *event);
virtual void keyPressEvent(QKeyEvent *event) override;
};
//Q_DECLARE_METATYPE(GraphicsView)
#endif // GRAPHICSVIEW_H

View File

@@ -8,8 +8,8 @@
QImage getCollisionMetatileImage(Block);
QImage getCollisionMetatileImage(int, int);
QImage getMetatileImage(uint16_t, Tileset*, Tileset*, QList<int>, QList<float>, bool useTruePalettes = false);
QImage getMetatileImage(Metatile*, Tileset*, Tileset*, QList<int>, QList<float>, bool useTruePalettes = false);
QImage getMetatileImage(uint16_t, Tileset*, Tileset*, const QList<int>&, const QList<float>&, bool useTruePalettes = false);
QImage getMetatileImage(Metatile*, Tileset*, Tileset*, const QList<int>&, const QList<float>&, bool useTruePalettes = false);
QImage getTileImage(uint16_t, Tileset*, Tileset*);
QImage getPalettedTileImage(uint16_t, Tileset*, Tileset*, int, bool useTruePalettes = false);
QImage getGreyscaleTileImage(uint16_t tile, Tileset *primaryTileset, Tileset *secondaryTileset);

View File

@@ -1,54 +1,58 @@
#ifndef MAPPIXMAPITEM_H
#define MAPPIXMAPITEM_H
#include "map.h"
#include "settings.h"
#include "metatileselector.h"
#include <QGraphicsPixmapItem>
class MapPixmapItem : public QObject, public QGraphicsPixmapItem {
class Layout;
class LayoutPixmapItem : public QObject, public QGraphicsPixmapItem {
Q_OBJECT
private:
using QGraphicsPixmapItem::paint;
public:
enum class PaintMode {
Disabled,
Metatiles,
EventObjects
};
MapPixmapItem(Map *map_, MetatileSelector *metatileSelector, Settings *settings) {
this->map = map_;
this->map->setMapItem(this);
LayoutPixmapItem(Layout *layout, MetatileSelector *metatileSelector, Settings *settings) {
this->layout = layout;
// this->map->setMapItem(this);
this->metatileSelector = metatileSelector;
this->settings = settings;
this->paintingMode = PaintMode::Metatiles;
this->lockedAxis = MapPixmapItem::Axis::None;
this->lockedAxis = LayoutPixmapItem::Axis::None;
this->prevStraightPathState = false;
setAcceptHoverEvents(true);
}
MapPixmapItem::PaintMode paintingMode;
Map *map;
Layout *layout;
MetatileSelector *metatileSelector;
Settings *settings;
bool active;
bool has_mouse = false;
bool right_click;
int paint_tile_initial_x;
int paint_tile_initial_y;
bool prevStraightPathState;
int straight_path_initial_x;
int straight_path_initial_y;
QPoint metatilePos;
enum Axis {
None = 0,
X,
Y
};
MapPixmapItem::Axis lockedAxis;
LayoutPixmapItem::Axis lockedAxis;
QPoint selection_origin;
QList<QPoint> selection;
virtual void paint(QGraphicsSceneMouseEvent*);
virtual void floodFill(QGraphicsSceneMouseEvent*);
virtual void magicFill(QGraphicsSceneMouseEvent*);
@@ -70,26 +74,33 @@ public:
QList<CollisionSelectionItem> selectedCollisions,
bool fromScriptCall = false);
void floodFillSmartPath(int initialX, int initialY, bool fromScriptCall = false);
virtual void pick(QGraphicsSceneMouseEvent*);
virtual void select(QGraphicsSceneMouseEvent*);
virtual void shift(QGraphicsSceneMouseEvent*);
void shift(int xDelta, int yDelta, bool fromScriptCall = false);
virtual void draw(bool ignoreCache = false);
void updateMetatileSelection(QGraphicsSceneMouseEvent *event);
void paintNormal(int x, int y, bool fromScriptCall = false);
void lockNondominantAxis(QGraphicsSceneMouseEvent *event);
QPoint adjustCoords(QPoint pos);
void setEditsEnabled(bool enabled) { this->editsEnabled = enabled; }
bool getEditsEnabled() { return this->editsEnabled; }
private:
void paintSmartPath(int x, int y, bool fromScriptCall = false);
static QList<int> smartPathTable;
unsigned actionId_ = 0;
bool editsEnabled = true;
signals:
void startPaint(QGraphicsSceneMouseEvent *, MapPixmapItem *);
void endPaint(QGraphicsSceneMouseEvent *, MapPixmapItem *);
void mouseEvent(QGraphicsSceneMouseEvent *, MapPixmapItem *);
void startPaint(QGraphicsSceneMouseEvent *, LayoutPixmapItem *);
void endPaint(QGraphicsSceneMouseEvent *, LayoutPixmapItem *);
void mouseEvent(QGraphicsSceneMouseEvent *, LayoutPixmapItem *);
void hoveredMapMetatileChanged(const QPoint &pos);
void hoveredMapMetatileCleared();

View File

@@ -0,0 +1,43 @@
#include "qgifimage.h"
#include <QSplashScreen>
#include <QTimer>
#include <QWidget>
namespace Ui {
class LoadingScreen;
}
class PorymapLoadingScreen : public QWidget {
Q_OBJECT
public:
explicit PorymapLoadingScreen(QWidget *parent = nullptr);
~PorymapLoadingScreen();
void setPixmap(const QPixmap &pixmap);
void showMessage(const QString &text);
void showMessage(const QString &prefix, const QString &text);
void showLoadingMessage(const QString &text);
void start();
void stop ();
private:
void setupUi();
public slots:
void updateFrame();
private:
Ui::LoadingScreen *ui;
QGifImage splashImage;
int frame = 0;
QTimer timer;
};
extern PorymapLoadingScreen *porysplash;

View File

@@ -0,0 +1,87 @@
#ifndef MAPHEADERFORM_H
#define MAPHEADERFORM_H
/*
This is the UI class used to edit the fields in a map's header.
It's intended to be used anywhere the UI needs to present an editor for a map's header,
e.g. for the current map in the main editor or in the new map dialog.
*/
#include <QWidget>
#include <QPointer>
#include "mapheader.h"
#include "project.h"
#include "noscrollcombobox.h"
namespace Ui {
class MapHeaderForm;
}
class MapHeaderForm : public QWidget
{
Q_OBJECT
public:
explicit MapHeaderForm(QWidget *parent = nullptr);
~MapHeaderForm();
void setProject(Project * project, bool allowProjectChanges = true);
void clear();
void setHeader(MapHeader *header);
void setHeaderData(const MapHeader &header);
MapHeader headerData() const;
void setSong(const QString &song);
void setLocation(const QString &location);
void setLocationName(const QString &locationName);
void setRequiresFlash(bool requiresFlash);
void setWeather(const QString &weather);
void setType(const QString &type);
void setBattleScene(const QString &battleScene);
void setShowsLocationName(bool showsLocationName);
void setAllowsRunning(bool allowsRunning);
void setAllowsBiking(bool allowsBiking);
void setAllowsEscaping(bool allowsEscaping);
void setFloorNumber(int floorNumber);
QString song() const;
QString location() const;
QString locationName() const;
bool requiresFlash() const;
QString weather() const;
QString type() const;
QString battleScene() const;
bool showsLocationName() const;
bool allowsRunning() const;
bool allowsBiking() const;
bool allowsEscaping() const;
int floorNumber() const;
private:
Ui::MapHeaderForm *ui;
QPointer<MapHeader> m_header = nullptr;
QPointer<Project> m_project = nullptr;
bool m_allowProjectChanges = true;
void setText(NoScrollComboBox *combo, const QString &text) const;
void setText(QLineEdit *lineEdit, const QString &text) const;
void setLocations(const QStringList &locations);
void updateLocationName();
void onSongUpdated(const QString &song);
void onLocationChanged(const QString &location);
void onLocationNameChanged(const QString &locationName);
void onWeatherChanged(const QString &weather);
void onTypeChanged(const QString &type);
void onBattleSceneChanged(const QString &battleScene);
void onRequiresFlashChanged(bool enabled);
void onShowLocationNameChanged(bool enabled);
void onAllowRunningChanged(bool enabled);
void onAllowBikingChanged(bool enabled);
void onAllowEscapingChanged(bool enabled);
void onFloorNumberChanged(int offset);
};
#endif // MAPHEADERFORM_H

View File

@@ -1,10 +1,9 @@
#ifndef MAPIMAGEEXPORTER_H
#define MAPIMAGEEXPORTER_H
#include "map.h"
#include "editor.h"
#include "project.h"
#include <QDialog>
class QGifImage;
namespace Ui {
class MapImageExporter;
@@ -17,21 +16,17 @@ enum ImageExporterMode {
};
struct ImageExporterSettings {
bool showObjects = false;
bool showWarps = false;
bool showBGs = false;
bool showTriggers = false;
bool showHealLocations = false;
bool showUpConnections = false;
bool showDownConnections = false;
bool showLeftConnections = false;
bool showRightConnections = false;
QSet<Event::Group> showEvents;
QSet<QString> showConnections;
bool showGrid = false;
bool showBorder = false;
bool showCollision = false;
bool previewActualSize = false;
bool disablePreviewScaling = false;
bool disablePreviewUpdates = false;
int timelapseSkipAmount = 1;
int timelapseDelayMs = 200;
// Not exposed as a setting in the UI atm (our color input widget has no alpha channel).
QColor fillColor = Qt::transparent;
};
class MapImageExporter : public QDialog
@@ -39,56 +34,84 @@ class MapImageExporter : public QDialog
Q_OBJECT
public:
explicit MapImageExporter(QWidget *parent, Editor *editor, ImageExporterMode mode);
explicit MapImageExporter(QWidget *parent, Project *project, Map *map, ImageExporterMode mode = ImageExporterMode::Normal)
: MapImageExporter(parent, project, map, map->layout(), mode) {};
explicit MapImageExporter(QWidget *parent, Project *project, Layout *layout, ImageExporterMode mode = ImageExporterMode::Normal)
: MapImageExporter(parent, project, nullptr, layout, mode) {};
~MapImageExporter();
ImageExporterMode mode() const { return m_mode; }
void setMap(Map *map);
void setLayout(Layout *layout);
private:
explicit MapImageExporter(QWidget *parent, Project *project, Map *map, Layout *layout, ImageExporterMode mode);
Ui::MapImageExporter *ui;
Project *m_project = nullptr;
Map *m_map = nullptr;
Layout *m_layout = nullptr;
QGraphicsScene *m_scene = nullptr;
QGifImage *m_timelapseGifImage = nullptr;
QBuffer *m_timelapseBuffer = nullptr;
QMovie *m_timelapseMovie = nullptr;
QGraphicsPixmapItem *m_preview = nullptr;
Map *map = nullptr;
Editor *editor = nullptr;
QGraphicsScene *scene = nullptr;
ImageExporterSettings m_settings;
ImageExporterMode m_mode = ImageExporterMode::Normal;
ImageExporterMode m_originalMode;
QPixmap preview;
ImageExporterSettings settings;
ImageExporterMode mode = ImageExporterMode::Normal;
void updatePreview();
void setModeSpecificUi();
void setSelectionText(const QString &text);
void updateMapSelection();
void resetSettings();
QString getTitle(ImageExporterMode mode);
QString getDescription(ImageExporterMode mode);
void updatePreview(bool forceUpdate = false);
void scalePreview();
void updateShowBorderState();
bool eventsEnabled();
void setEventGroupEnabled(Event::Group group, bool enable);
bool connectionsEnabled();
void setConnectionDirectionEnabled(const QString &dir, bool enable);
void saveImage();
QPixmap getStitchedImage(QProgressDialog *progress, bool includeBorder);
QPixmap getFormattedMapPixmap(Map *map, bool ignoreBorder = false);
bool historyItemAppliesToFrame(const QUndoCommand *command);
QGifImage* createTimelapseGifImage(QProgressDialog *progress);
QPixmap getStitchedImage(QProgressDialog *progress);
QPixmap getFormattedMapPixmap();
void paintBorder(QPainter *painter, Layout *layout);
void paintCollision(QPainter *painter, Layout *layout);
void paintConnections(QPainter *painter, const Map *map);
void paintEvents(QPainter *painter, const Map *map);
void paintGrid(QPainter *painter, const Layout *layout = nullptr);
QMargins getMargins(const Map *map);
QPixmap getExpandedPixmap(const QPixmap &pixmap, const QSize &targetSize, const QColor &fillColor);
bool currentHistoryAppliesToFrame(QUndoStack *historyStack);
protected:
virtual void showEvent(QShowEvent *) override;
virtual void resizeEvent(QResizeEvent *) override;
private slots:
void on_checkBox_Objects_stateChanged(int state);
void on_checkBox_Warps_stateChanged(int state);
void on_checkBox_BGs_stateChanged(int state);
void on_checkBox_Triggers_stateChanged(int state);
void on_checkBox_HealLocations_stateChanged(int state);
void on_checkBox_AllEvents_stateChanged(int state);
void on_checkBox_ConnectionUp_stateChanged(int state);
void on_checkBox_ConnectionDown_stateChanged(int state);
void on_checkBox_ConnectionLeft_stateChanged(int state);
void on_checkBox_ConnectionRight_stateChanged(int state);
void on_checkBox_AllConnections_stateChanged(int state);
void on_checkBox_Elevation_stateChanged(int state);
void on_checkBox_Grid_stateChanged(int state);
void on_checkBox_Border_stateChanged(int state);
private:
void setShowGrid(bool checked);
void setShowBorder(bool checked);
void setShowObjects(bool checked);
void setShowWarps(bool checked);
void setShowBgs(bool checked);
void setShowTriggers(bool checked);
void setShowHealLocations(bool checked);
void setShowAllEvents(bool checked);
void setShowConnectionUp(bool checked);
void setShowConnectionDown(bool checked);
void setShowConnectionLeft(bool checked);
void setShowConnectionRight(bool checked);
void setShowAllConnections(bool checked);
void setShowCollision(bool checked);
void setDisablePreviewScaling(bool checked);
void setDisablePreviewUpdates(bool checked);
void on_pushButton_Reset_pressed();
void on_spinBox_TimelapseDelay_valueChanged(int delayMs);
void on_spinBox_FrameSkip_valueChanged(int skip);
void on_checkBox_ActualSize_stateChanged(int state);
void on_spinBox_TimelapseDelay_editingFinished();
void on_spinBox_FrameSkip_editingFinished();
};
#endif // MAPIMAGEEXPORTER_H

156
include/ui/maplistmodels.h Normal file
View File

@@ -0,0 +1,156 @@
#pragma once
#ifndef MAPLISTMODELS_H
#define MAPLISTMODELS_H
#include <QTreeView>
#include <QFontDatabase>
#include <QStyledItemDelegate>
#include <QStandardItemModel>
#include <QMap>
class Project;
enum MapListUserRoles {
NameRole = Qt::UserRole, // Holds the name of the item in the list
TypeRole, // Used to differentiate between the different layers of the map list tree view.
};
class MapTree : public QTreeView {
Q_OBJECT
public:
MapTree(QWidget *parent) : QTreeView(parent) {
this->setDropIndicatorShown(true);
this->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
this->setFocusPolicy(Qt::StrongFocus);
this->setContextMenuPolicy(Qt::CustomContextMenu);
}
protected:
virtual void keyPressEvent(QKeyEvent *event) override;
public slots:
void removeSelected();
};
class GroupNameDelegate : public QStyledItemDelegate {
Q_OBJECT
public:
GroupNameDelegate(Project *project, QObject *parent = nullptr) : QStyledItemDelegate(parent), project(project) {}
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
void setEditorData(QWidget *editor, const QModelIndex &index) const override;
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override;
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
private:
Project *project = nullptr;
};
class MapListModel : public QStandardItemModel {
Q_OBJECT
public:
MapListModel(Project *project, QObject *parent = nullptr);
~MapListModel() { }
void setActiveItem(const QString &itemName) { this->activeItemName = itemName; }
virtual QStandardItem *insertMapItem(const QString &mapName, const QString &folderName);
virtual QStandardItem *insertMapFolderItem(const QString &folderName);
virtual QModelIndex indexOf(const QString &itemName) const;
virtual void removeItemAt(const QModelIndex &index);
virtual QStandardItem *itemAt(const QModelIndex &index) const;
virtual QStandardItem *itemAt(const QString &itemName) const;
virtual QVariant data(const QModelIndex &index, int role) const override;
protected:
Project *project;
QStandardItem *root = nullptr;
QString activeItemName;
QString folderTypeName;
bool editable = false;
QIcon mapGrayIcon;
QIcon mapIcon;
QIcon mapEditedIcon;
QIcon mapOpenedIcon;
QIcon mapFolderIcon;
QIcon emptyMapFolderIcon;
QMap<QString, QStandardItem *> mapFolderItems;
QMap<QString, QStandardItem *> mapItems;
virtual QStandardItem *createMapItem(const QString &mapName, QStandardItem *map = nullptr);
virtual QStandardItem *createMapFolderItem(const QString &groupName, QStandardItem *fromItem = nullptr);
virtual void removeItem(QStandardItem *item) = 0;
};
class MapGroupModel : public MapListModel {
Q_OBJECT
public:
MapGroupModel(Project *project, QObject *parent = nullptr);
~MapGroupModel() { }
QVariant data(const QModelIndex &index, int role) const override;
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
Qt::DropActions supportedDropActions() const override;
QStringList mimeTypes() const override;
QMimeData *mimeData(const QModelIndexList &indexes) const override;
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override;
protected:
void removeItem(QStandardItem *item) override;
private:
friend class MapTree;
void updateProject();
signals:
void dragMoveCompleted();
};
class MapLocationModel : public MapListModel {
Q_OBJECT
public:
MapLocationModel(Project *project, QObject *parent = nullptr);
~MapLocationModel() {}
QStandardItem *createMapFolderItem(const QString &folderName, QStandardItem *folder) override;
protected:
void removeItem(QStandardItem *item) override;
};
class LayoutTreeModel : public MapListModel {
Q_OBJECT
public:
LayoutTreeModel(Project *project, QObject *parent = nullptr);
~LayoutTreeModel() {}
QVariant data(const QModelIndex &index, int role) const override;
QStandardItem *createMapFolderItem(const QString &folderName, QStandardItem *folder) override;
protected:
void removeItem(QStandardItem *item) override;
};
#endif // MAPLISTMODELS_H

View File

@@ -0,0 +1,56 @@
#ifndef MAPLISTTOOLBAR_H
#define MAPLISTTOOLBAR_H
#include "maplistmodels.h"
#include "filterchildrenproxymodel.h"
#include <QFrame>
#include <QPointer>
namespace Ui {
class MapListToolBar;
}
class MapListToolBar : public QFrame
{
Q_OBJECT
public:
explicit MapListToolBar(QWidget *parent = nullptr);
~MapListToolBar();
MapTree* list() const { return m_list; }
void setList(MapTree *list);
void setEditsAllowedButtonVisible(bool visible);
void setEditsAllowed(bool allowed);
void toggleEditsAllowed();
void setEmptyFoldersVisible(bool visible);
void toggleEmptyFolders();
void expandList();
void collapseList();
void applyFilter(const QString &filterText);
void clearFilter();
void setFilterLocked(bool locked) { m_filterLocked = locked; }
bool isFilterLocked() const { return m_filterLocked; }
void setSearchFocus();
signals:
void filterCleared(MapTree*);
void addFolderClicked();
void editsAllowedChanged(bool allowed);
void emptyFoldersVisibleChanged(bool visible);
private:
Ui::MapListToolBar *ui;
QPointer<MapTree> m_list;
bool m_filterLocked = false;
bool m_editsAllowed = false;
bool m_emptyFoldersVisible = true;
};
#endif // MAPLISTTOOLBAR_H

View File

@@ -1,19 +0,0 @@
#ifndef MAPSCENEEVENTFILTER_H
#define MAPSCENEEVENTFILTER_H
#include <QObject>
class MapSceneEventFilter : public QObject
{
Q_OBJECT
protected:
bool eventFilter(QObject *obj, QEvent *event) override;
public:
explicit MapSceneEventFilter(QObject *parent = nullptr);
signals:
void wheelZoom(int delta);
public slots:
};
#endif // MAPSCENEEVENTFILTER_H

View File

@@ -5,13 +5,17 @@
#include "graphicsview.h"
#include "overlay.h"
class MapView : public GraphicsView
class Editor;
class MapView : public QGraphicsView
{
Q_OBJECT
public:
MapView() : GraphicsView() {}
MapView(QWidget *parent) : GraphicsView(parent) {}
MapView() : QGraphicsView() {}
MapView(QWidget *parent) : QGraphicsView(parent) {}
Editor *editor;
Overlay * getOverlay(int layer);
void clearOverlayMap();
@@ -70,10 +74,14 @@ public:
Q_INVOKABLE void addTileImage(int x, int y, QJSValue tileObj, bool setTransparency = false, int layer = 0);
Q_INVOKABLE void addMetatileImage(int x, int y, int metatileId, bool setTransparency = false, int layer = 0);
protected:
virtual void drawForeground(QPainter *painter, const QRectF &rect) override;
virtual void keyPressEvent(QKeyEvent*) override;
virtual void moveEvent(QMoveEvent *event) override;
private:
QMap<int, Overlay*> overlayMap;
protected:
void drawForeground(QPainter *painter, const QRectF &rect);
void updateScene();
};
#endif // GRAPHICSVIEW_H

60
include/ui/message.h Normal file
View File

@@ -0,0 +1,60 @@
#pragma once
#ifndef MESSAGE_H
#define MESSAGE_H
/*
These classes are thin wrappers around QMessageBox for convenience.
The base Message class is a regular window-modal QMessageBox with "porymap" as the window title.
QMessageBox's static functions enforce application modality (among other things), which changes the style of the message boxes on macOS.
With these equivalent static functions we have more control over the appearance and behavior of the window,
and we keep the convenience of not needing to provide all the arguments.
If more control is needed (like adding custom buttons to the window) use the constructors as you would for a normal QMessageBox.
*/
#include <QMessageBox>
class Message : public QMessageBox {
public:
Message(QMessageBox::Icon icon, const QString &text, QMessageBox::StandardButtons buttons, QWidget *parent);
};
// Basic error message with an 'Ok' button.
class ErrorMessage : public Message {
public:
ErrorMessage(const QString &message, QWidget *parent);
static void show(const QString &message, QWidget *parent);
};
// Basic warning message with an 'Ok' button.
class WarningMessage : public Message {
public:
WarningMessage(const QString &message, QWidget *parent);
static void show(const QString &message, QWidget *parent);
};
// Basic informational message with a 'Close' button.
class InfoMessage : public Message {
public:
InfoMessage(const QString &message, QWidget *parent);
static void show(const QString &message, QWidget *parent);
};
// Basic question message with a 'Yes' and 'No' button.
class QuestionMessage : public Message {
public:
QuestionMessage(const QString &message, QWidget *parent);
static int show(const QString &message, QWidget *parent);
};
// Error message directing users to their log file.
// Shows the most recent error as detailed text.
class RecentErrorMessage : public ErrorMessage {
public:
RecentErrorMessage(const QString &message, QWidget *parent);
static void show(const QString &message, QWidget *parent);
};
#endif // MESSAGE_H

View File

@@ -31,19 +31,21 @@ struct MetatileSelection
class MetatileSelector: public SelectablePixmapItem {
Q_OBJECT
public:
MetatileSelector(int numMetatilesWide, Map *map): SelectablePixmapItem(16, 16) {
MetatileSelector(int numMetatilesWide, Layout *layout): SelectablePixmapItem(16, 16) {
this->externalSelection = false;
this->prefabSelection = false;
this->numMetatilesWide = numMetatilesWide;
this->map = map;
this->primaryTileset = map->layout->tileset_primary;
this->secondaryTileset = map->layout->tileset_secondary;
this->layout = layout;
this->primaryTileset = layout->tileset_primary;
this->secondaryTileset = layout->tileset_secondary;
this->selection = MetatileSelection{};
this->cellPos = QPoint(-1, -1);
setAcceptHoverEvents(true);
}
QPoint getSelectionDimensions();
void draw();
QPoint getSelectionDimensions() override;
void draw() override;
bool select(uint16_t metatile);
void selectFromMap(uint16_t metatileId, uint16_t collision, uint16_t elevation);
void setTilesets(Tileset*, Tileset*);
@@ -51,27 +53,31 @@ public:
void setPrefabSelection(MetatileSelection selection);
void setExternalSelection(int, int, QList<uint16_t>, QList<QPair<uint16_t, uint16_t>>);
QPoint getMetatileIdCoordsOnWidget(uint16_t);
void setMap(Map*);
void setLayout(Layout *layout);
bool isInternalSelection() const { return (!this->externalSelection && !this->prefabSelection); }
Tileset *primaryTileset;
Tileset *secondaryTileset;
protected:
void mousePressEvent(QGraphicsSceneMouseEvent*);
void mouseMoveEvent(QGraphicsSceneMouseEvent*);
void mouseReleaseEvent(QGraphicsSceneMouseEvent*);
void hoverMoveEvent(QGraphicsSceneHoverEvent*);
void hoverLeaveEvent(QGraphicsSceneHoverEvent*);
void mousePressEvent(QGraphicsSceneMouseEvent*) override;
void mouseMoveEvent(QGraphicsSceneMouseEvent*) override;
void mouseReleaseEvent(QGraphicsSceneMouseEvent*) override;
void hoverMoveEvent(QGraphicsSceneHoverEvent*) override;
void hoverLeaveEvent(QGraphicsSceneHoverEvent*) override;
void drawSelection() override;
private:
QPixmap basePixmap;
bool externalSelection;
bool prefabSelection;
int numMetatilesWide;
Map *map;
Layout *layout;
int externalSelectionWidth;
int externalSelectionHeight;
QList<uint16_t> externalSelectedMetatiles;
MetatileSelection selection;
QPoint cellPos;
void updateBasePixmap();
void updateSelectedMetatiles();
void updateExternalSelectedMetatiles();
uint16_t getMetatileId(int x, int y) const;
@@ -79,6 +85,7 @@ private:
bool positionIsValid(const QPoint &pos) const;
bool selectionIsValid();
void hoverChanged();
int numPrimaryMetatilesRounded() const;
signals:
void hoveredMetatileSelectionChanged(uint16_t);

View File

@@ -27,19 +27,20 @@ public:
void copy(int index);
void paste(int index);
void setCurrentField(const QString &fieldName);
public slots:
void setTabActive(int index, bool active = true);
void deactivateTab(int tabIndex);
private:
bool eventFilter(QObject *object, QEvent *event);
void actionCopyTab(int index);
void actionAddDeleteTab(int index);
QVector<bool> activeTabs;
QVector<QPushButton *> addDeleteTabButtons;
QVector<QPushButton *> copyTabButtons;
QMap<QString,int> fieldNameToIndex;
Editor *editor;
};

View File

@@ -5,34 +5,86 @@
#include <QPainter>
#include <QRgb>
class MovableRect : public QGraphicsItem
class MovableRect : public QGraphicsRectItem
{
public:
MovableRect(bool *enabled, int width, int height, QRgb color);
QRectF boundingRect() const override
{
MovableRect(bool *enabled, const QRectF &rect, const QRgb &color);
QRectF boundingRect() const override {
qreal penWidth = 4;
return QRectF(-penWidth,
-penWidth,
30 * 8 + penWidth * 2,
20 * 8 + penWidth * 2);
this->rect().width() + penWidth * 2,
this->rect().height() + penWidth * 2);
}
void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) override
{
if (!(*enabled)) return;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) override {
if (!isVisible()) return;
painter->setPen(this->color);
painter->drawRect(x() - 2, y() - 2, this->width + 3, this->height + 3);
painter->setPen(QColor(0, 0, 0));
painter->drawRect(x() - 3, y() - 3, this->width + 5, this->height + 5);
painter->drawRect(x() - 1, y() - 1, this->width + 1, this->height + 1);
painter->drawRect(this->rect() + QMargins(1,1,1,1)); // Fill
painter->setPen(Qt::black);
painter->drawRect(this->rect() + QMargins(2,2,2,2)); // Outer border
painter->drawRect(this->rect()); // Inner border
}
void updateLocation(int x, int y);
bool *enabled;
private:
int width;
int height;
void setActive(bool active);
bool getActive() const { return this->active; }
protected:
bool *enabled = nullptr;
bool active = true;
QRectF baseRect;
QRgb color;
void updateVisibility();
};
/// A MovableRect with the addition of being resizable.
class ResizableRect : public QObject, public MovableRect
{
Q_OBJECT
public:
ResizableRect(QObject *parent, bool *enabled, int width, int height, QRgb color);
QRectF boundingRect() const override {
return QRectF(this->rect() + QMargins(lineWidth, lineWidth, lineWidth, lineWidth));
}
QPainterPath shape() const override {
QPainterPath path;
path.addRect(this->rect() + QMargins(lineWidth, lineWidth, lineWidth, lineWidth));
path.addRect(this->rect() - QMargins(lineWidth, lineWidth, lineWidth, lineWidth));
return path;
}
void updatePosFromRect(QRect newPos);
void setLimit(QRect limit) { this->limit = limit; }
protected:
void hoverMoveEvent(QGraphicsSceneHoverEvent *event) override;
void hoverLeaveEvent(QGraphicsSceneHoverEvent *) override;
void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
private:
enum class Edge { None, Left, Right, Top, Bottom, TopLeft, BottomLeft, TopRight, BottomRight };
ResizableRect::Edge detectEdge(int x, int y);
// Variables for keeping state of original rect while resizing
ResizableRect::Edge clickedEdge = ResizableRect::Edge::None;
QPointF clickedPos = QPointF();
QRect clickedRect;
QRect limit = QRect();
int lineWidth = 8;
signals:
void rectUpdated(QRect rect);
};
#endif // MOVABLERECT_H

Some files were not shown because too many files have changed in this diff Show More