Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ef4a7b1
[feature/redesign] Tree based effects dialog with custom effects
MaxFleur Dec 13, 2024
ea89a8c
[refactor] Reduce boilerplate code for file handlers
MaxFleur Dec 15, 2024
16848d8
[redesign/fix] Delete chars/effects now based on file name content
MaxFleur Dec 23, 2024
90d1df5
[infrastructure] Add missing link to file utils tests
MaxFleur Dec 23, 2024
e2c75b6
[redesign] Readjust icon ordering for toolbar and context menu
MaxFleur Dec 23, 2024
6da3489
[infrastructure] Rename general utils test
MaxFleur Dec 23, 2024
31b1532
[feature] Option to readjust table height after character is removed
MaxFleur Dec 23, 2024
12fa7b8
[fix] Height setting was buggy when calling redo operations
MaxFleur Dec 23, 2024
99b801a
[fix] Did not ask to sort correctly
MaxFleur Jan 16, 2025
e812255
[refactor] Redesign messagebox for different ruleset loaded
MaxFleur Jan 16, 2025
d07d065
[feature] Icons for move up and down actions
MaxFleur Jan 16, 2025
eb5db6e
[refactor] minor indentation and general cleanup
MaxFleur Jan 16, 2025
90edaad
[feature] Open Recent menu
MaxFleur Jan 18, 2025
5d2458d
[refactor] Cleanup constructor to be more uniform with other classes
MaxFleur Jan 18, 2025
6ff5740
[infrastructure] Remove Qt5 support
MaxFleur Feb 14, 2025
f548afe
[refactor] Apply emplace semantics on vectors
MaxFleur Feb 14, 2025
30ad155
[fix] Adjusted table height regardless of option setting
MaxFleur Apr 18, 2025
e2c79f0
[fix] Did not process row removal and return to main window resizes c…
MaxFleur Apr 18, 2025
a34b985
[refactor] Generalize to one timed resize function
MaxFleur Apr 18, 2025
315eda1
[version] Adjust UI to new version
MaxFleur Apr 18, 2025
3c8a70b
[fix] Templates were sometimes unsorted
MaxFleur Apr 18, 2025
5513a77
[readme] Adjust to 3.1.0
MaxFleur Apr 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions .github/workflows/run-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,14 @@ jobs:
- name: Install Catch2
run: brew install catch2

- name: Install Qt5
run: brew install qt@5

- name: Configure CMake - Qt5
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_PREFIX_PATH="$(brew --prefix qt@5)"

- name: Build Project - Qt5
run: cd build && cmake ..

- name: Test - Qt5
run: cd build && make tests && cd test && ./tests

- name: Install Qt6
run: brew install qt@6

- name: Configure CMake - Qt6
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_PREFIX_PATH="$(brew --prefix qt@6)"

- name: Build Project - Qt6
- name: Build Project
run: cd build && cmake ..

- name: Test - Qt6
- name: Test
run: cd build && make tests && cd test && ./tests
21 changes: 5 additions & 16 deletions .github/workflows/run-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Install dependencies - Qt5
run: sudo apt update && sudo apt install -y make cmake gcc qtbase5-dev libqt5svg5 libqt5svg5-dev catch2
- name: Configure CMake - Qt5
- name: Install dependencies
run: sudo apt update && sudo apt install -y make cmake gcc qt6-base-dev libqt6svg6 libqt6svg6-dev catch2
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build project - Qt5
- name: Build project
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test - Qt5
run: cmake --build build --target test

- name: Install Qt6
run: sudo apt update && sudo apt install -y qt6-base-dev libqt6svg6 libqt6svg6-dev
- name: Clear directory
run: rm -rf ${{github.workspace}}/build
- name: Configure CMake - Qt6
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build project - Qt6
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test - Qt6
- name: Test
run: cmake --build build --target test
48 changes: 4 additions & 44 deletions .github/workflows/run-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,46 +30,6 @@ jobs:
cmake .. -DBUILD_TESTING=OFF; cmake --build . --config Release --target install
shell: powershell

- name: Install Qt5
uses: jurplel/install-qt-action@v4
with:
version: '${{env.QT5_VERSION}}'
host: 'windows'
target: 'desktop'
arch: 'win64_msvc2019_64'
archives: 'qtbase qtsvg'
cache: 'false'
cache-key-prefix: 'install-qt-action'
install-deps: 'true'
setup-python: 'false'
set-env: 'true'

- name: Edit CMakeLists.txt - Qt5
run: |
Add-Content ${{github.workspace}}/CMakeLists.txt 'set(CMAKE_PREFIX_PATH "${{runner.workspace}}/Qt/${{env.QT5_VERSION}}/msvc2019_64/")'
(Get-Content ${{github.workspace}}/CMakeLists.txt).Replace('\', '/') | Set-Content ${{github.workspace}}/CMakeLists.txt
shell: powershell

- name: Configure CMake - Qt5
run: |
cmake -B build -G "Visual Studio 17 2022" -DCMAKE_CXX_COMPILER=cl

shell: powershell
- name: Build Project - Qt5
run: |
cmake --build build --config ${{env.BUILD_TYPE}}
shell: powershell

- name: Test - Qt5
run: |
${{github.workspace}}/build/test/${{env.BUILD_TYPE}}/tests.exe
shell: powershell

- name: Clear directory
run: |
Remove-Item "${{github.workspace}}/build" -Recurse -Include *.*
shell: powershell

- name: Install Qt6
uses: jurplel/install-qt-action@v4
with:
Expand All @@ -84,21 +44,21 @@ jobs:
setup-python: 'false'
set-env: 'true'

- name: Edit CMakeLists.txt - Qt6
- name: Edit CMakeLists.txt
run: |
(Get-Content ${{github.workspace}}/CMakeLists.txt).Replace('${{env.QT5_VERSION}}', '${{env.QT6_VERSION}}') | Set-Content ${{github.workspace}}/CMakeLists.txt
shell: powershell

- name: Configure CMake - Qt6
- name: Configure CMake
run: |
cmake -B build -G "Visual Studio 17 2022" -DCMAKE_CXX_COMPILER=cl

- name: Build Project - Qt6
- name: Build Project
run: |
cmake --build build --config ${{env.BUILD_TYPE}}
shell: powershell

- name: Test - Qt6
- name: Test
run: |
${{github.workspace}}/build/test/${{env.BUILD_TYPE}}/tests.exe
shell: powershell
11 changes: 2 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)

project(LightCombatManager LANGUAGES CXX)

find_package(Qt6 QUIET COMPONENTS Widgets)

if(${Qt6_FOUND})
find_package(QT NAMES Qt6 COMPONENTS SvgWidgets Widgets REQUIRED)
find_package(Qt6 COMPONENTS SvgWidgets Widgets REQUIRED)
else()
find_package(QT NAMES Qt5 COMPONENTS Svg Widgets REQUIRED)
find_package(Qt5 COMPONENTS Svg Widgets REQUIRED)
endif()
find_package(QT NAMES Qt6 COMPONENTS SvgWidgets Widgets REQUIRED)
find_package(Qt6 COMPONENTS SvgWidgets Widgets REQUIRED)

include(CTest)
enable_testing()
Expand Down
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
![CI MacOS badge](https://github.com/MaxFleur/LightCombatManager/actions/workflows/run-mac.yml/badge.svg?event=push)
![CI Ubuntu badge](https://github.com/MaxFleur/LightCombatManager/actions/workflows/run-ubuntu.yml/badge.svg?event=push)
![CI Windows badge](https://github.com/MaxFleur/LightCombatManager/actions/workflows/run-windows.yml/badge.svg?event=push)
![Tag badge](https://img.shields.io/badge/Release-v3.0.0-blue.svg)
![Tag badge](https://img.shields.io/badge/Release-v3.1.0-blue.svg)

</div>

Expand All @@ -17,11 +17,11 @@

### A small, lightweight cross-platform combat manager for d20-based role-playing games, based on Qt.

![bossfight](https://github.com/user-attachments/assets/a07db4f2-0c9f-451a-9143-4c4e774833e3)
![overall](https://github.com/user-attachments/assets/b8141a35-754b-460d-8cca-db51add3207a)

With LightCombatManager (or just **LCM**), you can easily manage a combat for a d20-based RPG. The table supports all sorts of combat-based operations, such as reordering rows when a character moves their initiative, removing or adding ruleset-defined status effects to one or multiple characters or subsequent addition of characters who just joined the combat. Undoing and logging changes are also supported!

![editor](https://github.com/user-attachments/assets/d925de4c-28d6-427c-ac4b-1250ba421cad)
![char_editor](https://github.com/user-attachments/assets/353a4b5a-6e27-4fad-94b7-17d8256a4929)

LCM provides an intuitive character editor, where characters with initiative value and modifier, a health point counter and additional information can be easily created.\
If the game ends, but the current combat is not finished yet, you can save it on the PC. Characters can also be stored as templates for later usage.
Expand All @@ -40,20 +40,19 @@ Support for more d20-based rulesets might be added in the future.

# Tools & Installation
LCM is written in C++20. The following frameworks are used for development:
* [Qt6 or Qt5](https://www.qt.io/) for the user interface and the storing and loading of tables.
* If no Qt6 installation is found on the system, the application searches for a Qt5 installation instead.
* [Qt6](https://www.qt.io/) for the user interface as well as table storage and loading.
* Note that for the correct displaying of svg files, the Qt SVG plugin is needed.
* [Catch2 v2 or v3](https://github.com/catchorg/Catch2) for Unit testing ([Catch2 license](https://github.com/catchorg/Catch2/blob/devel/LICENSE.txt)).
* [Uncrustify](https://github.com/uncrustify/uncrustify) for code formatting.
* CMake as build system.

The following commands will install all necessary requirements at once:
### Ubuntu:
`sudo apt install qtbase5-dev libqt5svg5 libqt5svg5-dev qt6-base-dev libqt6svg6 libqt6svg6-dev catch2 uncrustify cmake`
`sudo apt install qt6-base-dev libqt6svg6 libqt6svg6-dev catch2 uncrustify cmake`
### Arch Linux:
`sudo pacman -S qt5-base qt5-svg qt6-base qt6-svg catch2 uncrustify cmake`
`sudo pacman -S qt6-base qt6-svg catch2 uncrustify cmake`
### MacOS:
`brew install qt@5 qt@6 catch2 uncrustify cmake`
`brew install qt@6 catch2 uncrustify cmake`

For Windows, installers for Qt, CMake and Catch2 are available. Make sure to install the Qt SVG plugin as well!\
Alternatively, if you want to run the application without any additional installing, just download the binaries provided with the latest release.
Expand All @@ -62,7 +61,7 @@ Alternatively, if you want to run the application without any additional install

1. Clone this repository and `cd` into it.
2. `mkdir build && cd build`
3. On MacOS: Hit `cmake -DCMAKE_PREFIX_PATH="$(brew --prefix qt@5)"` (Change to `qt@6` for Qt6), on Linux: Hit `cmake ..`
3. On MacOS: Hit `cmake -DCMAKE_PREFIX_PATH="$(brew --prefix qt@6)"`, on Linux: Hit `cmake ..`
4. `make`
5. Start the application with `./src/LightCombatManager`.

Expand Down
22 changes: 22 additions & 0 deletions resources/icons/table/move_down_black.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions resources/icons/table/move_down_white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions resources/icons/table/move_up_black.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions resources/icons/table/move_up_white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 4 additions & 13 deletions resources/icons/table/remove_black.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 4 additions & 13 deletions resources/icons/table/remove_white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions resources/resources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
<file>icons/table/insert_table_white.svg</file>
<file>icons/table/log_black.svg</file>
<file>icons/table/log_white.svg</file>
<file>icons/table/move_down_black.svg</file>
<file>icons/table/move_down_white.svg</file>
<file>icons/table/move_up_black.svg</file>
<file>icons/table/move_up_white.svg</file>
<file>icons/table/redo_black.svg</file>
<file>icons/table/redo_white.svg</file>
<file>icons/table/remove_black.svg</file>
Expand Down
2 changes: 1 addition & 1 deletion src/handler/char/CharacterHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ CharacterHandler::storeCharacter(
bool isEnemy,
AdditionalInfoData additionalInfoData)
{
characters.push_back(Character(name, initiative, modifier, hp, isEnemy, additionalInfoData));
characters.emplace_back(Character(name, initiative, modifier, hp, isEnemy, additionalInfoData));
}


Expand Down
10 changes: 10 additions & 0 deletions src/handler/file/BaseFileHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,13 @@ BaseFileHandler::getStatus(const QString& fileName)
// Correct or false format
return !checkFileFormat();
}


bool
BaseFileHandler::writeJsonObjectToFile(const QJsonObject& object, const QString& fileName) const
{
const auto byteArray = QJsonDocument(object).toJson();
QFile fileOut(fileName);
fileOut.open(QIODevice::WriteOnly);
return fileOut.write(byteArray) != -1;
}
4 changes: 4 additions & 0 deletions src/handler/file/BaseFileHandler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ class BaseFileHandler {
[[nodiscard]] virtual int
getStatus(const QString& fileName);

[[maybe_unused]] bool
writeJsonObjectToFile(const QJsonObject& object,
const QString& fileName) const;

[[nodiscard]] QJsonObject&
getData()
{
Expand Down
Loading
Loading