Compare commits
266 Commits
fix_serva
...
tooomm-ci_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f63739427 | ||
|
|
99916272d0 | ||
|
|
b8354e3bfc | ||
|
|
3243e2b8b6 | ||
|
|
b1ed152207 | ||
|
|
9cf979d154 | ||
|
|
033c8b269d | ||
|
|
c4e42b94f9 | ||
|
|
5b9cb4fc8d | ||
|
|
99d9ce10c3 | ||
|
|
34400c7f60 | ||
|
|
05914e38f0 | ||
|
|
bddb54ef4c | ||
|
|
46e146b34a | ||
|
|
f16ba6861b | ||
|
|
fb6af544e2 | ||
|
|
4c3cfc8c2d | ||
|
|
286a7494d3 | ||
|
|
a07c1badd8 | ||
|
|
29d93fb9c1 | ||
|
|
4a54412d47 | ||
|
|
bd8306bd33 | ||
|
|
69107f79e3 | ||
|
|
2687a34019 | ||
|
|
9ae6357c34 | ||
|
|
baa7e25e30 | ||
|
|
700feb68af | ||
|
|
57c6f2716f | ||
|
|
24e27d3c31 | ||
|
|
77d13090b5 | ||
|
|
9353782ee4 | ||
|
|
fc40fea97a | ||
|
|
bb8213deb5 | ||
|
|
e3465be8c1 | ||
|
|
03a44a4c06 | ||
|
|
c8823838b3 | ||
|
|
5d7f8ae49d | ||
|
|
42ce9f4d89 | ||
|
|
1409dcc2e8 | ||
|
|
e6603d3b4a | ||
|
|
54afb34398 | ||
|
|
6fd1e9a4c4 | ||
|
|
95a86703b3 | ||
|
|
693fcc07e6 | ||
|
|
382f37f2a7 | ||
|
|
bcaa6c6b8a | ||
|
|
ffe02e59c7 | ||
|
|
f7152befec | ||
|
|
ca73033aea | ||
|
|
a1499854f9 | ||
|
|
873e0d346e | ||
|
|
44ac782978 | ||
|
|
6b39f6f6fa | ||
|
|
0cb06ff0dd | ||
|
|
dcbb8bab75 | ||
|
|
acd9a163f0 | ||
|
|
795149e776 | ||
|
|
55bff6b52f | ||
|
|
82be0a8898 | ||
|
|
f98aad57d3 | ||
|
|
81a911dc11 | ||
|
|
39f87a5e78 | ||
|
|
aff4ffdf83 | ||
|
|
574ea01e08 | ||
|
|
26dcb015ce | ||
|
|
b9b0311cc4 | ||
|
|
3b819e3c5e | ||
|
|
42ddb70bc3 | ||
|
|
99b46336d4 | ||
|
|
e5a6bb0bcb | ||
|
|
1d259a86c1 | ||
|
|
0c02d15e0d | ||
|
|
1e01c684c4 | ||
|
|
3b1d6e394d | ||
|
|
2fe639676b | ||
|
|
e8651a0230 | ||
|
|
0c59e49a57 | ||
|
|
2786226e99 | ||
|
|
29c3f1fa7a | ||
|
|
4afd0eae30 | ||
|
|
a35707ae18 | ||
|
|
b1cf8ff0bb | ||
|
|
adaa31b34d | ||
|
|
00095cb71c | ||
|
|
8af1f2b6d9 | ||
|
|
2dc1b875d2 | ||
|
|
653362567b | ||
|
|
ca538399f6 | ||
|
|
36f9f65798 | ||
|
|
2189fc0a96 | ||
|
|
854208ea0a | ||
|
|
67db245aea | ||
|
|
42c56898d5 | ||
|
|
a55a287a9d | ||
|
|
b4024ee552 | ||
|
|
181bef0057 | ||
|
|
e9d05e6271 | ||
|
|
15415afa9a | ||
|
|
728c87589f | ||
|
|
686717e544 | ||
|
|
c4d0921a15 | ||
|
|
ae90b6c93f | ||
|
|
ac1ae4fed5 | ||
|
|
a1f2617931 | ||
|
|
300a37a199 | ||
|
|
351c77182c | ||
|
|
b214933da9 | ||
|
|
9463390e80 | ||
|
|
3b758962e4 | ||
|
|
ad06814ac7 | ||
|
|
13d18986b2 | ||
|
|
6171658c0c | ||
|
|
9b5f5595b0 | ||
|
|
676ea0d5a7 | ||
|
|
80b6d6a31f | ||
|
|
6661a5d946 | ||
|
|
53e9a91dc6 | ||
|
|
56bbd8a172 | ||
|
|
0bd53d6dc7 | ||
|
|
61cb3d1d7c | ||
|
|
e808d030db | ||
|
|
4a68d9d3ea | ||
|
|
730305f4d2 | ||
|
|
d17523ff17 | ||
|
|
195116d1de | ||
|
|
92d7828a77 | ||
|
|
2a3b9a9a5e | ||
|
|
0e7d7ffcb2 | ||
|
|
b1fca404b7 | ||
|
|
b6e6328e6a | ||
|
|
ecf0327378 | ||
|
|
787c551f5f | ||
|
|
d662152088 | ||
|
|
2fcdb52157 | ||
|
|
70f2a32fad | ||
|
|
37356317a4 | ||
|
|
08f3a56285 | ||
|
|
5af71d1c2e | ||
|
|
1ada5ea424 | ||
|
|
91ee6097d2 | ||
|
|
a4b0cddcf8 | ||
|
|
9bc6ae1567 | ||
|
|
c71685b261 | ||
|
|
0ae7d01234 | ||
|
|
345606846f | ||
|
|
9decf78d2d | ||
|
|
a6f2e69e1a | ||
|
|
76fa87c63e | ||
|
|
2e01dfd23a | ||
|
|
99376e75d6 | ||
|
|
be28d50997 | ||
|
|
d03f5388d4 | ||
|
|
48123c8822 | ||
|
|
0fa744f6ec | ||
|
|
42301d4f1a | ||
|
|
6c19254abd | ||
|
|
b5c5d221c4 | ||
|
|
c219d8bdbb | ||
|
|
4812508afc | ||
|
|
57b9f0e54c | ||
|
|
0d2061365c | ||
|
|
4d8a124822 | ||
|
|
a7641a571f | ||
|
|
bd28e04635 | ||
|
|
37382dea44 | ||
|
|
57a8960841 | ||
|
|
6b4ae8308a | ||
|
|
2739550087 | ||
|
|
4ada011632 | ||
|
|
c99afe7956 | ||
|
|
b58b85dc0f | ||
|
|
a407c8b956 | ||
|
|
1851f71850 | ||
|
|
e4f40a82a2 | ||
|
|
b9900e67a6 | ||
|
|
7d558edb3e | ||
|
|
eb4b1c2a07 | ||
|
|
087f88146d | ||
|
|
3a11ccb854 | ||
|
|
068465143b | ||
|
|
1f0846297f | ||
|
|
4a0e0ed954 | ||
|
|
4b7d1ebb59 | ||
|
|
ec536126b9 | ||
|
|
9b00bdcaea | ||
|
|
da17c68830 | ||
|
|
badfb483b2 | ||
|
|
fafe636b7c | ||
|
|
ef15aa2dcd | ||
|
|
2d44c9ad2f | ||
|
|
0a1d0f650f | ||
|
|
2ba7c1ff9a | ||
|
|
0ecf6298a3 | ||
|
|
1d11bb19b8 | ||
|
|
ff7f31ca33 | ||
|
|
6bb9ae92bf | ||
|
|
5238087ddf | ||
|
|
08bb18cefe | ||
|
|
ecbdd32a2d | ||
|
|
2f415dcc6e | ||
|
|
8fc1b22889 | ||
|
|
85a50ce9d5 | ||
|
|
b706e26a32 | ||
|
|
15725c67c7 | ||
|
|
d8da4473e2 | ||
|
|
e1964f21de | ||
|
|
87c5d07807 | ||
|
|
3d0f4868df | ||
|
|
56bd11794e | ||
|
|
e541b9d572 | ||
|
|
a7e8c1f59b | ||
|
|
ec452aabe2 | ||
|
|
2a9599eed8 | ||
|
|
58a2b7ff39 | ||
|
|
448903efe3 | ||
|
|
d76e8f9146 | ||
|
|
3620664a9f | ||
|
|
7ff43f15fc | ||
|
|
e271e6ecf8 | ||
|
|
93d28717e0 | ||
|
|
6df97a156f | ||
|
|
05d06f9016 | ||
|
|
e8574641b0 | ||
|
|
9ac13018c6 | ||
|
|
06b25f1cfc | ||
|
|
6f5d369416 | ||
|
|
4543038fd8 | ||
|
|
345f8b772c | ||
|
|
47311b1dfd | ||
|
|
21e22ed5fb | ||
|
|
0d6497fcdc | ||
|
|
bfaeeb5aea | ||
|
|
b46667f6db | ||
|
|
49932ee6f8 | ||
|
|
57e37e8f4d | ||
|
|
af68a95964 | ||
|
|
959a268f91 | ||
|
|
77a3515470 | ||
|
|
6a008acb2b | ||
|
|
247e1aff83 | ||
|
|
3df4efebaa | ||
|
|
5c8d1f3cff | ||
|
|
01d5e58a5f | ||
|
|
a28300ac42 | ||
|
|
0666483756 | ||
|
|
abca5514af | ||
|
|
2247c66ea6 | ||
|
|
3b638598ad | ||
|
|
63e3e3ceb1 | ||
|
|
23f4c9c4e4 | ||
|
|
356b00e8c7 | ||
|
|
8916e049bd | ||
|
|
287b4a5597 | ||
|
|
d77ee00e70 | ||
|
|
18ac4c2bd4 | ||
|
|
2dc614c6b7 | ||
|
|
7c9bf75393 | ||
|
|
d1102939a2 | ||
|
|
cb060f43b5 | ||
|
|
80bd783d54 | ||
|
|
82b147d235 | ||
|
|
6944f5f81c | ||
|
|
8cbfe85ed4 | ||
|
|
eb2c71d381 | ||
|
|
86161185d9 | ||
|
|
79bf3adb2a |
@@ -1,4 +1,4 @@
|
||||
FROM fedora:40
|
||||
FROM fedora:42
|
||||
|
||||
RUN dnf install -y \
|
||||
ccache \
|
||||
@@ -4,24 +4,29 @@
|
||||
git push -d origin --REPLACE-WITH-BETA-LIST--
|
||||
-->
|
||||
|
||||
<!-- This list of binaries should be updated every time the CI is changed to
|
||||
include different targets -->
|
||||
<!-- This list of binaries should be updated every time the CI is changed to include all targets -->
|
||||
<pre>
|
||||
<b>Pre-compiled binaries we serve:</b>
|
||||
- <kbd>Windows 10+</kbd>
|
||||
- <kbd>Windows 7+</kbd>
|
||||
- <kbd>macOS 14+</kbd> ("Sonoma") / Apple M
|
||||
- <kbd>macOS 13+</kbd> ("Ventura") / Intel
|
||||
- <kbd>Ubuntu 24.04 LTS</kbd> ("Noble Numbat")
|
||||
- <kbd>Ubuntu 22.04 LTS</kbd> ("Jammy Jellyfish")
|
||||
- <kbd>Ubuntu 20.04 LTS</kbd> ("Focal Fossa")
|
||||
- <kbd>Debian 12</kbd> ("Bookworm")
|
||||
- <kbd>Debian 11</kbd> ("Bullseye")
|
||||
- <kbd>Fedora 41</kbd>
|
||||
- <kbd>Fedora 40</kbd>
|
||||
|
||||
<i>We are also packaged in <kbd>Arch Linux</kbd>'s official "extra" repository, courtesy of @FFY00</i>
|
||||
<i>General Linux support is available via a <kbd>flatpak</kbd> package (Flathub)</i>
|
||||
Available pre-compiled binaries for installation:
|
||||
|
||||
<b>Windows</b>
|
||||
• <kbd>Windows 10+</kbd>
|
||||
|
||||
<b>macOS</b>
|
||||
• <kbd>macOS 15+</kbd> <sub><i>Sequoia</i></sub> <sub>Apple M</sub>
|
||||
• <kbd>macOS 14+</kbd> <sub><i>Sonoma</i></sub> <sub>Apple M</sub>
|
||||
• <kbd>macOS 13+</kbd> <sub><i>Ventura</i></sub> <sub>Intel</sub>
|
||||
|
||||
<b>Linux</b>
|
||||
• <kbd>Ubuntu 24.04 LTS</kbd> <sub><i>Noble Numbat</i></sub>
|
||||
• <kbd>Ubuntu 22.04 LTS</kbd> <sub><i>Jammy Jellyfish</i></sub>
|
||||
• <kbd>Ubuntu 20.04 LTS</kbd> <sub><i>Focal Fossa</i></sub>
|
||||
• <kbd>Debian 12</kbd> <sub><i>Bookworm</i></sub>
|
||||
• <kbd>Debian 11</kbd> <sub><i>Bullseye</i></sub>
|
||||
• <kbd>Fedora 42</kbd>
|
||||
• <kbd>Fedora 41</kbd>
|
||||
|
||||
<sub>We are also packaged in <kbd>Arch Linux</kbd>'s <a href="https://archlinux.org/packages/extra/x86_64/cockatrice">official extra repository</a>, courtesy of @FFY00.</sub>
|
||||
<sub>General Linux support is available via a <kbd>flatpak</kbd> package at <a href="https://flathub.org/apps/io.github.Cockatrice.cockatrice">Flathub</a>!</sub>
|
||||
</pre>
|
||||
|
||||
|
||||
@@ -35,7 +40,7 @@ If you ever encounter a bug, have a suggestion or idea, or feel a need for a dev
|
||||
|
||||
For basic information related to the app and getting started, please take a look at our official site: **https://cockatrice.github.io**
|
||||
|
||||
If you'd like to help and contribute to Cockatrice in any way, check out our [README](https://github.com/Cockatrice/Cockatrice#get-involved-).
|
||||
If you'd like to help and contribute to Cockatrice in any way, check out our [README](https://github.com/Cockatrice/Cockatrice#contribute).
|
||||
We're always available to answer questions you may have on how the program works and how you can provide a meaningful contribution.
|
||||
|
||||
|
||||
|
||||
153
.github/CONTRIBUTING.md
vendored
@@ -7,32 +7,33 @@
|
||||
<br>
|
||||
|
||||
# Contributing to Cockatrice #
|
||||
First off, thanks for taking the time to contribute to our project! 🎉 ❤ ️✨
|
||||
|
||||
The following is a set of guidelines for contributing to Cockatrice. These are
|
||||
mostly guidelines, not rules. Use your best judgment, and feel free to propose
|
||||
changes to this document in a pull request.
|
||||
First off, thanks for taking the time and considering to lend a helping hand to our project! 🎉 ❤ ️✨
|
||||
|
||||
> [!NOTE]
|
||||
> The following is a set of guidelines for contributing to Cockatrice.
|
||||
> These are mostly guidelines, not rules. Use your best judgment, and feel free to
|
||||
> propose changes to this document in a pull request.
|
||||
>
|
||||
> [](
|
||||
> https://discord.gg/3Z9yzmA)
|
||||
> If you'd like to ask questions, get advice, or just want to say "Hi",
|
||||
> the Cockatrice Development Team uses [Discord](https://discord.gg/ZASRzKu)
|
||||
> for communications and you can reach out in the `#dev` channel.
|
||||
|
||||
|
||||
# Recommended Setups #
|
||||
|
||||
For those developers who like the Linux or MacOS environment, many of our
|
||||
For those developers on **Linux** or **macOS** environment, many of our
|
||||
developers like working with a nifty program called [CLion](
|
||||
https://www.jetbrains.com/clion/). The program's a great asset and one of the
|
||||
best tools you'll find on these systems, but you're welcomed to use any IDE
|
||||
you most enjoy.
|
||||
https://www.jetbrains.com/clion/). The program is a great asset and one of the
|
||||
best tools you'll find on these systems.
|
||||
|
||||
Developers who like Windows development tend to find [Visual Studio](
|
||||
Developers on **Windows** systems tend to find [Visual Studio](
|
||||
https://www.visualstudio.com/) the best tool for the job.
|
||||
|
||||
[](https://discord.gg/ZASRzKu)
|
||||
[](https://gitter.im/Cockatrice/Cockatrice)
|
||||
|
||||
If you'd like to ask questions, get advice, or just want to say hi,
|
||||
the Cockatrice Development Team uses [Discord](https://discord.gg/ZASRzKu)
|
||||
for communications in the #dev channel. If you're not into Discord, we also
|
||||
have a [Gitter](https://gitter.im/Cockatrice/Cockatrice) channel available,
|
||||
albeit slightly less active.
|
||||
But you're welcomed to use any IDE you enjoy most of course!
|
||||
|
||||
|
||||
# Code Style Guide #
|
||||
@@ -54,7 +55,7 @@ The message will look like this:
|
||||
*** Then commit and push those changes to this branch. ***
|
||||
*** Check our CONTRIBUTING.md file for more details. ***
|
||||
*** ***
|
||||
*** Thank you ❤️ ***
|
||||
*** Thank you ❤️ ***
|
||||
*** ***
|
||||
***********************************************************
|
||||
```
|
||||
@@ -64,7 +65,7 @@ information on our formatting guidelines.
|
||||
|
||||
### Compatibility ###
|
||||
|
||||
Cockatrice is currently compiled on all platforms using <kbd>C++11</kbd>.
|
||||
Cockatrice is currently compiled on all platforms using <kbd>C++20</kbd>.
|
||||
You'll notice <kbd>C++03</kbd> code throughout the codebase. Please feel free
|
||||
to help convert it over!
|
||||
|
||||
@@ -78,11 +79,12 @@ or other appropriate conversion.
|
||||
### Formatting ###
|
||||
|
||||
The handy tool `clang-format` can format your code for you, it is available for
|
||||
almost any environment. A special `.clang-format` configuration file is
|
||||
almost any environment. A special [`.clang-format`](
|
||||
https://github.com/Cockatrice/Cockatrice/blob/master/.clang-format) configuration file is
|
||||
included in the project and is used to format your code.
|
||||
|
||||
We've also included a bash script, `format.sh`, that will use clang-format to
|
||||
format all files in your pr in one go. Use `./format.sh --help` to show a full
|
||||
format all files in your PR in one go. Use `./format.sh --help` to show a full
|
||||
help page.
|
||||
|
||||
To run clang-format on a single source file simply use the command
|
||||
@@ -90,10 +92,10 @@ To run clang-format on a single source file simply use the command
|
||||
clang-format with a specific version number appended,
|
||||
`find /usr/bin -name clang-format*` should find it for you)
|
||||
|
||||
See [the clang-format documentation](
|
||||
See the [clang-format documentation](
|
||||
https://clang.llvm.org/docs/ClangFormat.html) for more information about the tool.
|
||||
|
||||
#### Header files ####
|
||||
#### Header Files ####
|
||||
|
||||
Use header files with the extension `.h` and source files with the extension
|
||||
`.cpp`.
|
||||
@@ -168,10 +170,10 @@ braces around single line statements is preferred.
|
||||
See the following example:
|
||||
```c++
|
||||
int main()
|
||||
{ // function or class: own line
|
||||
if (someCondition) { // control statement: same line
|
||||
doSomething(); // single line statement, braces preferred
|
||||
} else if (someOtherCondition1) { // else goes on the same line as a closing brace
|
||||
{ // function or class: own line
|
||||
if (someCondition) { // control statement: same line
|
||||
doSomething(); // single line statement, braces preferred
|
||||
} else if (someOtherCondition1) { // else goes on the same line as a closing brace
|
||||
for (int i = 0; i < 100; i++) {
|
||||
doSomethingElse();
|
||||
}
|
||||
@@ -234,7 +236,7 @@ mutating objects.)
|
||||
When pointers can't be avoided, try to use a smart pointer of some sort, such
|
||||
as `QScopedPointer`, or, less preferably, `QSharedPointer`.
|
||||
|
||||
### Database migrations ###
|
||||
### Database Migrations ###
|
||||
|
||||
The servatrice database's schema can be found at `servatrice/servatrice.sql`.
|
||||
Everytime the schema gets modified, some other steps are due:
|
||||
@@ -255,7 +257,7 @@ Ensure that the migration produces the expected effects; e.g. if you add a
|
||||
new column, make sure the migration places it in the same order as
|
||||
servatrice.sql.
|
||||
|
||||
### Protocol buffer ###
|
||||
### Protocol Buffer ###
|
||||
|
||||
Cockatrice and Servatrice exchange data using binary messages. The syntax of
|
||||
these messages is defined in the `proto` files in the `common/pb` folder. These
|
||||
@@ -268,6 +270,7 @@ new clients incompatible to the old server and vice versa.
|
||||
You can find more information on how we use Protobuf on [our wiki!](
|
||||
https://github.com/Cockatrice/Cockatrice/wiki/Client-server-protocol)
|
||||
|
||||
|
||||
# Reviewing Pull Requests #
|
||||
|
||||
After you have finished your changes to the project you should put them on a
|
||||
@@ -286,6 +289,7 @@ all changes have been approved your pull request will be squashed into a single
|
||||
commit and merged into the master branch by a team member. Your change will then
|
||||
be included in the next release 👍
|
||||
|
||||
|
||||
# Translations #
|
||||
|
||||
Basic workflow for translations:
|
||||
@@ -294,16 +298,16 @@ Basic workflow for translations:
|
||||
3. Maintainer verifies and merges the change;
|
||||
4. Transifex picks up the new files from GitHub automatically;
|
||||
5. Translators translate the new untranslated strings on Transifex;
|
||||
6. Before a release, a maintainer fetches the updated translations from Transifex.
|
||||
6. Before a release, a maintainer fetches the newest translations from Transifex.
|
||||
|
||||
### Using Translations (for developers) ###
|
||||
|
||||
All user interface strings inside Cockatrice's source code must be written
|
||||
in English (US).
|
||||
Translations to other languages are managed using [Transifex](
|
||||
https://www.transifex.com/projects/p/cockatrice/).
|
||||
https://transifex.com/cockatrice/cockatrice/).
|
||||
|
||||
Adding a new string to translate is as easy as adding the string in the
|
||||
Adding a new string for translation is as easy as adding the string in the
|
||||
`tr("")` function, the string will be picked up as translatable automatically
|
||||
and translated as needed.
|
||||
For example, setting the text of a label in the way that the string
|
||||
@@ -315,9 +319,9 @@ nameLabel.setText(tr("My name is:"));
|
||||
To translate a string that would have plural forms you can add the amount to
|
||||
the tr() call, also you can add an extra string as a hint for translators:
|
||||
```c++
|
||||
QString message = tr("Everyone draws %n cards", "pop up message", amount);
|
||||
QString message = tr("Everyone draws %n cards", "english hint for translators", amount);
|
||||
```
|
||||
See [QT's wiki on translations](
|
||||
See [Qt's wiki on translations](
|
||||
https://doc.qt.io/qt-5/i18n-source-translation.html#handling-plurals)
|
||||
|
||||
If you're about to propose a change that adds or modifies any translatable
|
||||
@@ -325,7 +329,7 @@ string in the code, you don't need to take care of adding the new strings to
|
||||
the translation files.<br>
|
||||
We have an automated process to update our language source files on a schedule
|
||||
and provide the translators on Transifex with the new contents.<br>
|
||||
Maintainers can also manually trigger this on demand.
|
||||
Maintainers can also manually trigger this workflow on demand via GitHub Actions.
|
||||
|
||||
### Maintaining Translations (for maintainers) ###
|
||||
|
||||
@@ -389,27 +393,27 @@ Now you are ready to commit your changes and open a PR.
|
||||
</details>
|
||||
|
||||
Once the changes get merged, Transifex will pick up the modified files
|
||||
automatically (checked every few hours) and update their online editor where
|
||||
automatically (checked every few hours) and update the web editor where
|
||||
translators will be able to translate the new strings right in the browser.
|
||||
|
||||
### Releasing Translations (for maintainers) ###
|
||||
|
||||
Before rushing out a new release, a maintainer should fetch the most up to date
|
||||
Before publishing a new release, a maintainer should fetch the most up to date
|
||||
translations from Transifex and commit them into the Cockatrice source code.
|
||||
This can be done manually from the Transifex web interface, but it's quite time
|
||||
consuming.
|
||||
|
||||
As an alternative, you can install the Transifex CLI:
|
||||
|
||||
http://docs.transifex.com/developer/client/
|
||||
We utilize the official GitHub integration to push all languages that are 100%
|
||||
translated from Transifex to our GitHub repo automatically.
|
||||
On top, it runs on a quarterly schedule to update changes for incomplete languages.
|
||||
A synchronisation/update can also be triggered manually from the Transifex web interface
|
||||
and a translation treshold can be set.
|
||||
|
||||
As an alternative, you can install the [Transifex CLI](https://developers.transifex.com/docs/cli).
|
||||
You'll then be able to use a git-like cli command to push and pull translations
|
||||
from Transifex to the source code and vice versa.
|
||||
|
||||
### Adding Translations (for translators) ###
|
||||
|
||||
As a translator you can help translate the new strings on [Transifex](
|
||||
https://www.transifex.com/projects/p/cockatrice/).
|
||||
As a translator, you can help to translate new strings on [Transifex](
|
||||
https://www.transifex.com/projects/p/cockatrice/) to your native language.
|
||||
Please have a look at the specific [FAQ for translators](
|
||||
https://github.com/Cockatrice/Cockatrice/wiki/Translation-FAQ).
|
||||
|
||||
@@ -419,9 +423,9 @@ https://github.com/Cockatrice/Cockatrice/wiki/Translation-FAQ).
|
||||
### Publishing A New Release ###
|
||||
|
||||
We use [GitHub Releases](https://github.com/Cockatrice/Cockatrice/releases) to
|
||||
publish new stable versions and betas.
|
||||
Whenever a git tag is pushed to the repository github will create a draft
|
||||
release and upload binaries automatically.
|
||||
publish new stable versions and beta releases.
|
||||
Whenever a git tag is pushed to the repository, GitHub will create a draft
|
||||
release and upload binaries from our CI automatically.
|
||||
|
||||
To create a tag, simply do the following:
|
||||
```bash
|
||||
@@ -433,18 +437,16 @@ git push $UPSTREAM $TAG_NAME
|
||||
```
|
||||
|
||||
You should define the variables as such:
|
||||
```
|
||||
`$UPSTREAM` - the remote for git@github.com:Cockatrice/Cockatrice.git
|
||||
`$TAG_NAME` should be formatted as:
|
||||
- `YYYY-MM-DD-Release-MAJ.MIN.PATCH` for **stable releases**
|
||||
- `YYYY-MM-DD-Development-MAJ.MIN.PATCH-beta.X` for **beta releases**<br>
|
||||
With *MAJ.MIN.PATCH* being the NEXT release version!
|
||||
```
|
||||
- `$UPSTREAM`: the remote for `git@github.com:Cockatrice/Cockatrice.git`
|
||||
- `$TAG_NAME` should be formatted as:
|
||||
- `YYYY-MM-DD-Release-MAJ.MIN.PATCH` for **stable releases**
|
||||
- `YYYY-MM-DD-Development-MAJ.MIN.PATCH-beta.X` for **beta releases**<br>
|
||||
With <kbd>MAJ</kbd>.<kbd>MIN</kbd>.<kbd>PATCH</kbd> being the NEXT release version!
|
||||
|
||||
This will cause a tagged release to be established on the GitHub repository,
|
||||
with the binaries being added to the release whenever they are ready.
|
||||
The release is initially a draft, where the path notes can be edited and after
|
||||
all is good and ready it can be published on GitHub.
|
||||
with the binaries being added to the release whenever they are done building in CI.
|
||||
The release is initially a draft, where the release notes can be edited and after
|
||||
all is checked and ready, it can be published as GitHub release.
|
||||
If you use a SemVer tag including "beta", the release that will be created at
|
||||
GitHub will be marked as a "Pre-release" automatically.
|
||||
The target of the `.../latest` URL will not be changed in that case, it always
|
||||
@@ -457,7 +459,7 @@ revoke the tag by doing the following:
|
||||
git push --delete upstream $TAG_NAME
|
||||
git tag -d $TAG_NAME
|
||||
```
|
||||
You can also do this on GitHub, you'll also want to delete the new release.
|
||||
You can also do this on GitHub, you'll also want to delete the false release.
|
||||
|
||||
In the first lines of [CMakeLists.txt](
|
||||
https://github.com/Cockatrice/Cockatrice/blob/master/CMakeLists.txt)
|
||||
@@ -468,25 +470,24 @@ coming from the tag title, it's good practice to increment the ones at CMake
|
||||
after every full release to stress that master is ahead of the last stable
|
||||
release.
|
||||
The preferred flow of operation is:
|
||||
* Just before a release, make sure the version number in CMakeLists.txt is set
|
||||
to the same release version you are about to tag.
|
||||
* This is also the time to change the pretty name in CMakeLists.txt called
|
||||
GIT_TAG_RELEASENAME and commit and push these changes.
|
||||
* Tag the release following the previously described syntax in order to get it
|
||||
correctly built and deployed by CI.
|
||||
* Wait for the configure step to create the release and update the patch
|
||||
notes.
|
||||
* Check on the github actions page for build progress which should be the top
|
||||
listed [here](
|
||||
- Just before a release, make sure the version number in CMakeLists.txt is set
|
||||
to the same release version you are about to tag.
|
||||
- This is also the time to change the pretty name in CMakeLists.txt called
|
||||
`GIT_TAG_RELEASENAME` and commit and push these changes.
|
||||
- Tag the release following the previously described syntax in order to get it
|
||||
correctly built and deployed by CI.
|
||||
- Wait for the configuration step to create the release and update the patch
|
||||
notes.
|
||||
- Check on the GitHub Actions page for build progress which should be the top
|
||||
listed [here](
|
||||
https://github.com/Cockatrice/Cockatrice/actions?query=event%3Apush+-branch%3Amaster
|
||||
).
|
||||
* When the build has been completed you can verify all uploaded files on the
|
||||
release are in order and hit the publish button.
|
||||
* After the release is complete, update the CMake version number again to the
|
||||
next targeted beta version, typically increasing `PROJECT_VERSION_PATCH` by
|
||||
one.
|
||||
- When the build has been completed, you can verify if all uploaded files on the
|
||||
draft release are included and hit the publish button.
|
||||
- After the release is complete, update the CMake version number again to the
|
||||
next targeted beta version, typically increasing `PROJECT_VERSION_PATCH` by
|
||||
one.
|
||||
|
||||
When releasing a new stable version, all previous beta releases (and tags)
|
||||
should be deleted. This is needed for Cockatrice to update users of the "Beta"
|
||||
release channel correctly to the latest stable version as well.
|
||||
should be deleted as well.
|
||||
This can be done the same way as revoking tags, mentioned above.
|
||||
|
||||
3
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -2,7 +2,8 @@
|
||||
name: "🐛 Bug Report"
|
||||
about: Report an issue encountered while using Cockatrice
|
||||
title: ''
|
||||
labels: 'Bug'
|
||||
type: 'Bug'
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
5
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,8 +1,9 @@
|
||||
---
|
||||
name: "💡 Feature Request"
|
||||
about: Request a new feature
|
||||
about: Request a new feature for Cockatrice
|
||||
title: ''
|
||||
labels: 'Feature Request'
|
||||
type: 'Feature'
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
50
.github/workflows/desktop-build.yml
vendored
@@ -9,6 +9,7 @@ on:
|
||||
- 'webclient/**'
|
||||
- '.github/workflows/web-*.yml'
|
||||
- '.github/workflows/translations-*.yml'
|
||||
- '.github/workflows/docker-release.yml'
|
||||
tags:
|
||||
- '*'
|
||||
pull_request:
|
||||
@@ -101,12 +102,12 @@ jobs:
|
||||
package: DEB
|
||||
|
||||
- distro: Fedora
|
||||
version: 40
|
||||
version: 41
|
||||
package: RPM
|
||||
test: skip # Running tests on all distros is superfluous
|
||||
|
||||
- distro: Fedora
|
||||
version: 41
|
||||
version: 42
|
||||
package: RPM
|
||||
|
||||
- distro: Ubuntu
|
||||
@@ -210,7 +211,6 @@ jobs:
|
||||
make_package: 1
|
||||
|
||||
- target: 14
|
||||
soc: Apple
|
||||
os: macos-14
|
||||
xcode: "15.4"
|
||||
type: Release
|
||||
@@ -218,17 +218,15 @@ jobs:
|
||||
make_package: 1
|
||||
|
||||
- target: 15
|
||||
soc: Apple
|
||||
os: macos-15
|
||||
xcode: "16.2"
|
||||
xcode: "16.3"
|
||||
type: Release
|
||||
core_count: 3
|
||||
make_package: 1
|
||||
|
||||
- target: 15
|
||||
soc: Apple
|
||||
os: macos-15
|
||||
xcode: "16.2"
|
||||
xcode: "16.3"
|
||||
type: Debug
|
||||
core_count: 3
|
||||
|
||||
@@ -258,10 +256,10 @@ jobs:
|
||||
shell: bash
|
||||
id: build
|
||||
env:
|
||||
BUILDTYPE: '${{matrix.type}}'
|
||||
BUILDTYPE: ${{ matrix.type }}
|
||||
MAKE_TEST: 1
|
||||
MAKE_PACKAGE: '${{matrix.make_package}}'
|
||||
PACKAGE_SUFFIX: '-macOS${{matrix.target}}_${{matrix.soc}}'
|
||||
MAKE_PACKAGE: ${{ matrix.make_package }}
|
||||
PACKAGE_SUFFIX: -macOS${{ matrix.target }}${{ matrix.soc == 'Intel' && '_Intel' || '' }}
|
||||
MACOS_CERTIFICATE: ${{ secrets.PROD_MACOS_CERTIFICATE }}
|
||||
MACOS_CERTIFICATE_PWD: ${{ secrets.PROD_MACOS_CERTIFICATE_PWD }}
|
||||
MACOS_CERTIFICATE_NAME: ${{ secrets.PROD_MACOS_CERTIFICATE_NAME }}
|
||||
@@ -330,7 +328,7 @@ jobs:
|
||||
if: matrix.make_package
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: macOS${{matrix.target}}${{ matrix.soc == 'Intel' && '_Intel' || '' }}${{ matrix.type == 'Debug' && '_Debug' || '' }}-dmg
|
||||
name: macOS${{matrix.target}}${{ matrix.soc == 'Intel' && '_Intel' || '' }}${{ matrix.type == 'Debug' && '_Debug' || '' }}-package
|
||||
path: ${{steps.build.outputs.path}}
|
||||
if-no-files-found: error
|
||||
|
||||
@@ -349,13 +347,9 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- target: 7
|
||||
qt_version: 5.15.*
|
||||
qt_arch: msvc2019_64
|
||||
|
||||
- target: 10
|
||||
qt_version: 6.6.*
|
||||
qt_arch: msvc2019_64
|
||||
qt_arch: win64_msvc2019_64 # win64_msvc2022_64 is only available with Qt 6.8, which introduces a bug in game window
|
||||
qt_modules: "qtimageformats qtmultimedia qtwebsockets"
|
||||
|
||||
name: Windows ${{matrix.target}}
|
||||
@@ -380,20 +374,16 @@ jobs:
|
||||
uses: jurplel/install-qt-action@v4
|
||||
with:
|
||||
cache: true
|
||||
setup-python: false
|
||||
setup-python: true
|
||||
version: ${{matrix.qt_version}}
|
||||
arch: win64_${{matrix.qt_arch}}
|
||||
tools: ${{matrix.qt_tools}}
|
||||
arch: ${{matrix.qt_arch}}
|
||||
modules: ${{matrix.qt_modules}}
|
||||
|
||||
- name: Run vcpkg
|
||||
uses: lukka/run-vcpkg@v11
|
||||
- name: Setup vcpkg cache
|
||||
id: vcpkg-cache
|
||||
uses: TAServers/vcpkg-cache@v3
|
||||
with:
|
||||
runVcpkgInstall: true
|
||||
doNotCache: false
|
||||
env:
|
||||
VCPKG_DEFAULT_TRIPLET: 'x64-windows'
|
||||
VCPKG_DISABLE_METRICS: 1
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build Cockatrice
|
||||
id: build
|
||||
@@ -402,7 +392,8 @@ jobs:
|
||||
PACKAGE_SUFFIX: '-Win${{matrix.target}}'
|
||||
CMAKE_GENERATOR: '${{env.CMAKE_GENERATOR}}'
|
||||
CMAKE_GENERATOR_PLATFORM: 'x64'
|
||||
QTDIR: '${{github.workspace}}\Qt\${{matrix.qt_version}}\win64_${{matrix.qt_arch}}'
|
||||
QTDIR: '${{github.workspace}}\Qt\${{matrix.qt_version}}\${{matrix.qt_arch}}'
|
||||
VCPKG_BINARY_SOURCES: 'clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite'
|
||||
# No need for --parallel flag, MTT is added in the compile script to let cmake/msbuild manage core count,
|
||||
# project and process parallelism: https://devblogs.microsoft.com/cppblog/improved-parallelism-in-msbuild/
|
||||
run: .ci/compile.sh --server --release --test --package
|
||||
@@ -414,13 +405,14 @@ jobs:
|
||||
path: ${{steps.build.outputs.path}}
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload pdb database
|
||||
- name: Upload PDBs (Program Databases)
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Windows${{matrix.target}}-debug-pdbs
|
||||
name: Windows${{matrix.target}}-Release-PDBs
|
||||
path: |
|
||||
build/cockatrice/Release/*.pdb
|
||||
build/servatrice/Release/*.pdb
|
||||
build/oracle/Release/*.pdb
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload to release
|
||||
|
||||
1
.github/workflows/desktop-lint.yml
vendored
@@ -7,6 +7,7 @@ on:
|
||||
- 'webclient/**'
|
||||
- '.github/workflows/web-*.yml'
|
||||
- '.github/workflows/translations-*.yml'
|
||||
- '.github/workflows/docker-release.yml'
|
||||
|
||||
jobs:
|
||||
format:
|
||||
|
||||
71
.github/workflows/docker-release.yml
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
name: Build Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*Release*'
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '.github/workflows/docker-release.yml'
|
||||
- 'CMakeLists.txt'
|
||||
- 'Dockerfile'
|
||||
- 'servatrice/**'
|
||||
- 'common/**'
|
||||
- 'cmake/**'
|
||||
- '!**.md'
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
name: amd64 & arm64
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Docker metadata
|
||||
id: metadata
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
ghcr.io/cockatrice/servatrice
|
||||
labels: |
|
||||
org.opencontainers.image.title=Servatrice
|
||||
org.opencontainers.image.url=https://cockatrice.github.io/
|
||||
org.opencontainers.image.description=Server for Cockatrice, a cross-platform virtual tabletop for multiplayer card games
|
||||
annotations: |
|
||||
org.opencontainers.image.title=Servatrice
|
||||
org.opencontainers.image.url=https://cockatrice.github.io/
|
||||
org.opencontainers.image.description=Server for Cockatrice, a cross-platform virtual tabletop for multiplayer card games
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
if: github.ref_type == 'tag'
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ github.token }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: ${{ github.ref_type == 'tag' }}
|
||||
tags: ${{ steps.metadata.outputs.tags }}
|
||||
labels: ${{ steps.metadata.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
@@ -74,11 +74,11 @@ endif()
|
||||
|
||||
# A project name is needed for CPack
|
||||
# Version can be overriden by git tags, see cmake/getversion.cmake
|
||||
project("Cockatrice" VERSION 2.10.0)
|
||||
project("Cockatrice" VERSION 2.11.0)
|
||||
|
||||
# Set release name if not provided via env/cmake var
|
||||
if(NOT DEFINED GIT_TAG_RELEASENAME)
|
||||
set(GIT_TAG_RELEASENAME "Rings of the Wild")
|
||||
set(GIT_TAG_RELEASENAME "Omenpath")
|
||||
endif()
|
||||
|
||||
# Use c++20 for all targets
|
||||
|
||||
@@ -16,7 +16,11 @@ RUN apt-get update && apt-get install -y\
|
||||
qt6-tools-dev \
|
||||
qt6-tools-dev-tools
|
||||
|
||||
COPY . /home/servatrice/code/
|
||||
COPY ./CMakeLists.txt ./LICENSE ./README.md /home/servatrice/code/
|
||||
COPY ./cmake /home/servatrice/code/cmake
|
||||
COPY ./common /home/servatrice/code/common
|
||||
COPY ./servatrice /home/servatrice/code/servatrice
|
||||
|
||||
WORKDIR /home/servatrice/code
|
||||
|
||||
WORKDIR build
|
||||
@@ -26,6 +30,6 @@ RUN cmake .. -DWITH_SERVER=1 -DWITH_CLIENT=0 -DWITH_ORACLE=0 -DWITH_DBCONVERTER=
|
||||
|
||||
WORKDIR /home/servatrice
|
||||
|
||||
EXPOSE 4747 4748
|
||||
EXPOSE 4748
|
||||
|
||||
ENTRYPOINT [ "servatrice", "--log-to-console" ]
|
||||
|
||||
211
README.md
@@ -5,154 +5,155 @@
|
||||
<p align='center'>
|
||||
<a href="#cockatrice"><b>Cockatrice</b></a> <b>|</b>
|
||||
<a href="#download-">Download</a> <b>|</b>
|
||||
<a href="#get-involved-">Get Involved</a> <b>|</b>
|
||||
<a href="#community-resources">Community</a> <b>|</b>
|
||||
<a href="#translations-">Translations</a> <b>|</b>
|
||||
<a href="#build--">Build</a> <b>|</b>
|
||||
<a href="#run">Run</a> <b>|</b>
|
||||
<a href="#license-">License</a>
|
||||
<a href="#related-repositories">Related</a> <b>|</b>
|
||||
<a href="#community-resources-">Community</a> <b>|</b>
|
||||
<a href="#contribute">Contribute</a> <b>|</b>
|
||||
<a href="#build---">Build</a> <b>|</b>
|
||||
<a href="#run">Run</a>
|
||||
</p>
|
||||
|
||||
---
|
||||
|
||||
<br><pre>
|
||||
<b>To get started, ⇢ [view our webpage](https://cockatrice.github.io/)</b><br>
|
||||
<b>To get support or suggest changes ⇢ [file an issue](https://github.com/Cockatrice/Cockatrice/issues) ([How?](https://github.com/Cockatrice/Cockatrice/wiki/How-to-Create-a-GitHub-Ticket-Regarding-Cockatrice))</b>
|
||||
<b>To help with development, see how to [get involved](#get-involved-)</b>
|
||||
</pre><br>
|
||||
<br><pre><p align='center'>
|
||||
<b>To get started with Cockatrice ⇢ [view our webpage](https://cockatrice.github.io/)</b><br>
|
||||
<b>To get support, or suggest changes to the app ⇢ [file an issue](https://github.com/Cockatrice/Cockatrice/issues) ([How?](https://github.com/Cockatrice/Cockatrice/wiki/How-to-Create-a-GitHub-Ticket-Regarding-Cockatrice))</b>
|
||||
<b>To help with development ⇢ learn [how to contribute](#contribute-)</b>
|
||||
</pre><p><br>
|
||||
|
||||
|
||||
# Cockatrice
|
||||
|
||||
Cockatrice is an open-source, multiplatform program for playing tabletop card games over a network. The program's server design prevents users from manipulating the game for unfair advantage. The client also provides a single-player mode, which allows users to brew while offline. This project uses C++ and the Qt5 libraries.<br>
|
||||
Cockatrice is an open-source, multiplatform application for playing tabletop card games over a network. The program's server design prevents users from manipulating the game for unfair advantage. The client also provides a single-player mode, which allows users to brew while offline.<br><br>
|
||||
This project uses <kbd>C++</kbd> and the <kbd>Qt</kbd> libraries.<br>
|
||||
First work on a webclient with <kbd>Typescript</kbd> was started as well.<br>
|
||||
|
||||
|
||||
# Download [](https://tooomm.github.io/github-release-stats/?username=Cockatrice&repository=Cockatrice)
|
||||
# Download [](https://tooomm.github.io/github-release-stats/?username=Cockatrice&repository=Cockatrice&search=0)
|
||||
|
||||
Downloads are available for full releases and the current beta version in development. There is no strict release schedule for either of them.
|
||||
Downloads are available for **stable releases** and the current **beta version** in development.
|
||||
There is no strict release schedule for either of them.
|
||||
<br><pre>
|
||||
Latest <kbd>stable</kbd> release:
|
||||
[](https://github.com/cockatrice/cockatrice/releases/latest)  [](https://tooomm.github.io/github-release-stats/?username=Cockatrice&repository=Cockatrice&search=0)
|
||||
</pre><pre>
|
||||
Latest <kbd>beta</kbd> version:
|
||||
[](https://github.com/cockatrice/cockatrice/releases)  [](https://tooomm.github.io/github-release-stats/?username=Cockatrice&repository=Cockatrice&search=0) [](https://github.com/Cockatrice/Cockatrice/pulls?q=is%3Apr+is%3Aclosed)
|
||||
<sub><i>While incorporating the latest fixes and features, beta builds may not be stable or contain new bugs!</i></sub>
|
||||
<sub><b><i>Please report any findings and open new issues when testing them!</i></b></sub>
|
||||
</pre>
|
||||
|
||||
- Latest `stable` release: [](https://github.com/cockatrice/cockatrice/releases/latest) [](https://tooomm.github.io/github-release-stats/?username=Cockatrice&repository=Cockatrice)<br>
|
||||
- Stable versions are checkpoints featuring major feature and UI enhancements.
|
||||
- **Recommended for most users!**
|
||||
# Related Repositories
|
||||
|
||||
- Latest `beta` release: [](https://github.com/cockatrice/cockatrice/releases) [](https://tooomm.github.io/github-release-stats/?username=Cockatrice&repository=Cockatrice)
|
||||
- Beta versions include the most recently added features and bugfixes, but can be unstable.
|
||||
- To be a Cockatrice Beta Tester, use this version. Find more information [here](https://github.com/Cockatrice/Cockatrice/wiki/Release-Channels)!
|
||||
|
||||
|
||||
# Get Involved [](https://discord.gg/3Z9yzmA)
|
||||
|
||||
Join our [Discord community](https://discord.gg/3Z9yzmA) to connect with the project, contributors or fellow users of the app. Come here to talk about the application, features, or just to hang out.<br>
|
||||
For support regarding specific servers, please contact that server's admin or forum for support rather than asking here.<br>
|
||||
|
||||
To contribute code to the project, please review [the guidelines](https://github.com/Cockatrice/Cockatrice/blob/master/.github/CONTRIBUTING.md).
|
||||
We maintain two tags for contributors to find issues to work on:
|
||||
- [Good first issue](https://github.com/Cockatrice/Cockatrice/issues?utf8=%E2%9C%93&q=is%3Aopen%20is%3Aissue%20label%3A%22Good%20first%20issue%22%20): issues tagged in this way provide a simple way to get started. They don't require much experience to be worked on.
|
||||
- [Help wanted](https://github.com/Cockatrice/Cockatrice/issues?utf8=%E2%9C%93&q=is%3Aopen%20is%3Aissue%20label%3A%22Help%20Wanted%22%20): This tag is used for issues that we are looking for a contributor to work on. Often this is for feature suggestions we are willing to accept, but don't have the time to work on ourselves.
|
||||
|
||||
For both tags, we're willing to provide help to contributors in showing them where and how they can make changes, as well as code review for changes they submit.
|
||||
|
||||
We try to be responsive to new issues. We'll provide advice on how best to implement a feature; alternately, we can show you where the codebase is doing something similar before you get too far along.
|
||||
|
||||
Cockatrice uses the [Google Developer Documentation Style Guide](https://developers.google.com/style/) to ensure consistent documentation. We encourage you to improve the documentation by suggesting edits based on this guide.
|
||||
- [Magic-Token](https://github.com/Cockatrice/Magic-Token): MtG token data to use in Cockatrice
|
||||
- [Magic-Spoiler](https://github.com/Cockatrice/Magic-Spoiler): Script to generate MtG spoiler data from [MTGJSON](https://github.com/mtgjson/mtgjson) to use in Cockatrice
|
||||
- [cockatrice.github.io](https://github.com/Cockatrice/cockatrice.github.io): Code of the official webpage of the Cockatrice project
|
||||
|
||||
|
||||
# Community Resources
|
||||
# Community Resources [](https://discord.gg/3Z9yzmA)
|
||||
|
||||
- [Cockatrice Official Site](https://cockatrice.github.io)
|
||||
- [Cockatrice Official Wiki](https://github.com/Cockatrice/Cockatrice/wiki)
|
||||
- [Cockatrice Official Discord](https://discord.gg/3Z9yzmA)
|
||||
Join our [Discord community](https://discord.gg/3Z9yzmA) to connect with other projet contributors (`#dev` channel) or fellow users of the app. Come here to talk about the application, features, or just to hang out.
|
||||
- [Official Website](https://cockatrice.github.io)
|
||||
- [Official Wiki](https://github.com/Cockatrice/Cockatrice/wiki)
|
||||
- [Official Discord](https://discord.gg/3Z9yzmA)
|
||||
- [reddit r/Cockatrice](https://reddit.com/r/cockatrice)
|
||||
|
||||
|
||||
# Translations [](https://transifex.com/cockatrice/cockatrice/)
|
||||
|
||||
Cockatrice uses Transifex for translations. You can help us bring Cockatrice, Oracle and Webatrice to your language or just adjust single wordings right from within your browser by visiting our [Transifex project page](https://transifex.com/cockatrice/cockatrice/).<br>
|
||||
|
||||
Check out our [Translator FAQ](https://github.com/Cockatrice/Cockatrice/wiki/Translation-FAQ) for more information about contributing!<br>
|
||||
>[!IMPORTANT]
|
||||
>For support regarding specific servers, please contact that server's admin/mods and use their dedicated communication channels rather than contacting the team building the software.
|
||||
|
||||
|
||||
# Build [](https://github.com/Cockatrice/Cockatrice/actions/workflows/desktop-build.yml?query=branch%3Amaster+event%3Apush) [](https://github.com/Cockatrice/Cockatrice/actions/workflows/web-build.yml?query=branch%3Amaster+event%3Apush)
|
||||
# Contribute
|
||||
|
||||
**Detailed compiling instructions can be found on the Cockatrice wiki under [Compiling Cockatrice](https://github.com/Cockatrice/Cockatrice/wiki/Compiling-Cockatrice)**
|
||||
### Code
|
||||
|
||||
Dependencies: *(for minimum requirements search our [CMake file](https://github.com/Cockatrice/Cockatrice/blob/master/CMakeLists.txt))*
|
||||
To contribute code to the project, please review our [guidelines](https://github.com/Cockatrice/Cockatrice/blob/master/.github/CONTRIBUTING.md) first.<br>
|
||||
We maintain two tags for contributors to easier find issues to potentially work on:
|
||||
- [](https://github.com/Cockatrice/Cockatrice/issues?utf8=%E2%9C%93&q=is%3Aopen%20is%3Aissue%20label%3A%22Good%20first%20issue%22%20)<br>
|
||||
Issues tagged in this way provide a simple way to get started. They don't require much experience to be worked on.
|
||||
- [](https://github.com/Cockatrice/Cockatrice/issues?utf8=%E2%9C%93&q=is%3Aopen%20is%3Aissue%20label%3A%22Help%20Wanted%22%20)<br>
|
||||
This tag is used for issues that we are looking for somebody to pick up. Often this is for feature suggestions we support, but don't have the time to work on ourselves.
|
||||
|
||||
For both tags, we're willing to provide help to contributors in showing them where and how they can make changes, as well as code reviews for submitted changes.<br>
|
||||
We'll happily advice on how best to implement a feature, or we can show you where the codebase is doing something similar before you get too far along - put a note on an issue you want to discuss more on!
|
||||
|
||||
Cockatrice tries to use the [Google Developer Documentation Style Guide](https://developers.google.com/style/) to ensure consistent documentation. We encourage you to improve the documentation by suggesting edits based on this guide.
|
||||
|
||||
<details>
|
||||
<summary><b>Kudos to our amazing contributors ❤️</b></summary>
|
||||
<br>
|
||||
<a href="https://github.com/Cockatrice/Cockatrice/graphs/contributors">
|
||||
<img src="https://contrib.rocks/image?repo=Cockatrice/Cockatrice" />
|
||||
</a><br>
|
||||
<sub><i>Made with <a href="https://contrib.rocks">contrib.rocks</a></i></sub>
|
||||
</details>
|
||||
|
||||
### Translations [](https://transifex.com/cockatrice/cockatrice/)
|
||||
|
||||
Cockatrice uses Transifex to manage translations. You can help us bring <kbd>Cockatrice</kbd>, <kbd>Oracle</kbd> and <kbd>Webatrice</kbd> to your language and just adjust single wordings right from within your browser by visiting our [Transifex project page](https://transifex.com/cockatrice/cockatrice/).<br>
|
||||
|
||||
Check out our [Translator FAQ](https://github.com/Cockatrice/Cockatrice/wiki/Translation-FAQ) for more information about getting invovled, and join a group of hundreds of others!<br>
|
||||
|
||||
|
||||
# Build [](https://github.com/Cockatrice/Cockatrice/actions/workflows/desktop-build.yml?query=branch%3Amaster+event%3Apush) [](https://github.com/Cockatrice/Cockatrice/actions/workflows/docker-release.yml?query=branch%3Amaster+event%3Apush) [](https://github.com/Cockatrice/Cockatrice/actions/workflows/web-build.yml?query=branch%3Amaster+event%3Apush)
|
||||
|
||||
Dependencies: *(for minimum versions search our [CMake file](https://github.com/Cockatrice/Cockatrice/blob/master/CMakeLists.txt))*
|
||||
- [Qt](https://www.qt.io/developers/)
|
||||
- [protobuf](https://github.com/protocolbuffers/protobuf)
|
||||
- [CMake](https://www.cmake.org/)
|
||||
|
||||
Oracle can optionally use zlib and xz to load compressed files:
|
||||
Oracle can *optionally* use some packages to load compressed card files:
|
||||
- [xz](https://tukaani.org/xz/)
|
||||
- [zlib](https://www.zlib.net/)
|
||||
|
||||
To compile:
|
||||
<br>
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make
|
||||
|
||||
You can then run
|
||||
**Basic compilation steps:**
|
||||
```bash
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make
|
||||
```
|
||||
|
||||
You can then
|
||||
- Create a Cockatrice installation inside the `release` folder:
|
||||
```bash
|
||||
make install
|
||||
|
||||
to get a cockatrice installation inside the `release` folder, or:
|
||||
|
||||
```
|
||||
- Or make an installation package specific to your system:
|
||||
```bash
|
||||
make package
|
||||
```
|
||||
|
||||
to create a system-specific installation package.
|
||||
>[!NOTE]
|
||||
>Detailed compiling instructions can be found in the Cockatrice wiki at [Compiling Cockatrice](https://github.com/Cockatrice/Cockatrice/wiki/Compiling-Cockatrice)
|
||||
|
||||
The following flags can be passed to `cmake`:
|
||||
<br>
|
||||
|
||||
- `-DWITH_SERVER=1` Whether to build the server (default 0 = no).
|
||||
- `-DWITH_CLIENT=0` Whether to build the client (default 1 = yes).
|
||||
- `-DWITH_ORACLE=0` Whether to build oracle (default 1 = yes).
|
||||
- `-DCMAKE_BUILD_TYPE=Debug` Compile in debug mode. Enables extra logging output, debug symbols, and much more verbose compiler warnings (default `Release`).
|
||||
- `-DWARNING_AS_ERROR=0` Whether to treat compilation warnings as errors in debug mode (default 1 = yes).
|
||||
- `-DUPDATE_TRANSLATIONS=1` Configure `make` to update the translation .ts files for new strings in the source code. Note: Running `make clean` will remove the .ts files (default 0 = no).
|
||||
- `-DTEST=1` Enable regression tests (default 0 = no). Note: needs googletest, will be downloaded on the fly if unavailable. To run tests: ```make test```.
|
||||
- `-DFORCE_USE_QT5=1` Skip looking for Qt6 before trying to find Qt5
|
||||
The following flags (with their non-default values) can be passed to `cmake`:
|
||||
| Flag | Description |
|
||||
| --- | --- |
|
||||
| `-DWITH_SERVER=1` | Build <kbd>Servatrice</kbd> server |
|
||||
| `-DWITH_CLIENT=0` | Don't build <kbd>Cockatrice</kbd> client |
|
||||
| `-DWITH_ORACLE=0` | Don't build <kbd>Oracle</kbd> card database tool |
|
||||
| `-DCMAKE_BUILD_TYPE=Debug` | Compile in debug mode<br> Enables extra logging output, debug symbols, and much more verbose compiler warnings |
|
||||
| `-DWARNING_AS_ERROR=0` | Don't treat compilation warnings as errors in debug mode |
|
||||
| `-DUPDATE_TRANSLATIONS=1` | Configure `make` to update the translation .ts files for new strings in the source code<br> **Note:** `make clean` will remove the .ts files |
|
||||
| `-DTEST=1` | Enable regression tests<br> **Note:** `make test` to run tests, *googletest* will be downloaded if not available |
|
||||
| `-DFORCE_USE_QT5=1` | Skip looking for Qt6 before trying to find Qt5 |
|
||||
|
||||
|
||||
# Run
|
||||
|
||||
`Cockatrice` is the game client<br>
|
||||
`Oracle` fetches card data<br>
|
||||
`Servatrice` is the server<br>
|
||||
<kbd>Cockatrice</kbd> is the game client<br>
|
||||
<kbd>Oracle</kbd> fetches card data<br>
|
||||
<kbd>Servatrice</kbd> is the server<br>
|
||||
|
||||
**Servatrice Docker container**
|
||||
#### Docker
|
||||
|
||||
You can run an instance of Servatrice (the Cockatrice server) using [Docker](https://www.docker.com/what-docker) and the Cockatrice Dockerfile.<br>
|
||||
You can build an image & deploy a <kbd>Servatrice</kbd> (Cockatrice server) container using [Docker](https://www.docker.com/resources/what-container/) and our Dockerfile yourself.<br>
|
||||
|
||||
First, create an image from the Dockerfile<br>
|
||||
`cd /path/to/Cockatrice-Repo/`
|
||||
`docker build -t servatrice .`<br>
|
||||
And then run it<br>
|
||||
`docker run -i -p 4747:4747/tcp -t servatrice:latest`<br>
|
||||
|
||||
>Note: Running this command exposes the TCP port 4747 of the docker container<br>
|
||||
to permit connections to the server.
|
||||
|
||||
Find more information on how to use Servatrice with Docker in our [wiki](https://github.com/Cockatrice/Cockatrice/wiki/Setting-up-Servatrice#using-docker).
|
||||
|
||||
**Docker compose**
|
||||
|
||||
There is also a docker-compose file available which will configure and run both a MySQL server and Servatrice. The docker-compose setup scripts can be found in the `servatrice/docker` folder and vary only slightly from the default sql and server .ini files. The setup scripts can either be modified in place, or docker-compose can mount alternative files into the images, as you prefer.
|
||||
|
||||
To run Servatrice via docker-compose, first install docker-compose following the [install instructions](https://docs.docker.com/compose/install/). Once installed, run the following from the root of the repository:
|
||||
```bash
|
||||
docker-compose build # Build the Servatrice image using the same Dockerfile as above.
|
||||
docker-compose up # Setup and run both the MySQL server and Servatrice.
|
||||
```
|
||||
|
||||
>Note: Similar to the above Docker setup, this will expose TCP ports 4747 and 4748.
|
||||
|
||||
>Note: The first time running the docker-compose setup, the MySQL server will take a little time to run the initial setup scripts. Due to this, the Servatrice instance may fail the first few attempts to connect to the database. Servatrice is set to `restart: always` in the docker-compose.yml, which will allow it to continue attempting to start up. Once the MySQL scripts have completed, Servatrice should then connect automatically on the next attempt.
|
||||
|
||||
**Docker compose in Windows**
|
||||
A out of box working docker-compose file has been added to help setup in Windows.
|
||||
|
||||
Docker in Windows requires additional steps in form of using Docker Desktop to allow resource sharing from the drive the volumes are mapped from, as well as potential workarounds needed to get file sharing working in Windows. This [StackOverflow discussion sheds some light on it](https://stackoverflow.com/questions/42203488/settings-to-windows-firewall-to-allow-docker-for-windows-to-share-drive)
|
||||
For more details, look into our wiki section on [Setting up Servatrice](https://github.com/Cockatrice/Cockatrice/wiki/Setting-up-Servatrice#using-docker).<br>
|
||||
You'll also find more hints on our **pre-build image** there, or the **docker-compose** file which will configure and run both a MySQL server and Servatrice.
|
||||
|
||||
|
||||
# License [](https://github.com/Cockatrice/Cockatrice/blob/master/LICENSE)
|
||||
|
||||
@@ -5,139 +5,45 @@
|
||||
project(Cockatrice VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
|
||||
|
||||
set(cockatrice_SOURCES
|
||||
src/game/cards/abstract_card_drag_item.cpp
|
||||
src/game/cards/abstract_card_item.cpp
|
||||
${VERSION_STRING_CPP}
|
||||
# sort by alphabetical order, so that there is no debate about where to add new sources to the list
|
||||
src/client/game_logic/abstract_client.cpp
|
||||
src/game/board/abstract_counter.cpp
|
||||
src/game/board/abstract_graphics_item.cpp
|
||||
src/game/board/arrow_item.cpp
|
||||
src/game/board/arrow_target.cpp
|
||||
src/game/cards/card_database.cpp
|
||||
src/game/cards/card_database_manager.cpp
|
||||
src/game/cards/card_database_model.cpp
|
||||
src/game/cards/card_database_parser/card_database_parser.cpp
|
||||
src/game/cards/card_database_parser/cockatrice_xml_3.cpp
|
||||
src/game/cards/card_database_parser/cockatrice_xml_4.cpp
|
||||
src/game/cards/card_drag_item.cpp
|
||||
src/game/filters/filter_card.cpp
|
||||
src/client/ui/widgets/cards/card_info_frame_widget.cpp
|
||||
src/client/ui/widgets/cards/card_info_picture_widget.cpp
|
||||
src/client/ui/widgets/cards/card_info_text_widget.cpp
|
||||
src/client/ui/widgets/cards/card_info_display_widget.cpp
|
||||
src/client/ui/widgets/cards/card_size_widget.cpp
|
||||
src/game/cards/card_item.cpp
|
||||
src/game/cards/card_list.cpp
|
||||
src/game/zones/card_zone.cpp
|
||||
src/server/chat_view/chat_view.cpp
|
||||
src/game/board/counter_general.cpp
|
||||
src/deck/custom_line_edit.cpp
|
||||
src/deck/deck_loader.cpp
|
||||
src/deck/deck_list_model.cpp
|
||||
src/deck/deck_stats_interface.cpp
|
||||
src/dialogs/dlg_connect.cpp
|
||||
src/dialogs/dlg_convert_deck_to_cod_format.cpp
|
||||
src/dialogs/dlg_create_token.cpp
|
||||
src/dialogs/dlg_create_game.cpp
|
||||
src/dialogs/dlg_edit_avatar.cpp
|
||||
src/dialogs/dlg_edit_password.cpp
|
||||
src/dialogs/dlg_edit_tokens.cpp
|
||||
src/dialogs/dlg_edit_user.cpp
|
||||
src/dialogs/dlg_filter_games.cpp
|
||||
src/dialogs/dlg_forgot_password_challenge.cpp
|
||||
src/dialogs/dlg_forgot_password_request.cpp
|
||||
src/dialogs/dlg_forgot_password_reset.cpp
|
||||
src/dialogs/dlg_load_deck_from_clipboard.cpp
|
||||
src/dialogs/dlg_load_remote_deck.cpp
|
||||
src/dialogs/dlg_manage_sets.cpp
|
||||
src/dialogs/dlg_move_top_cards_until.cpp
|
||||
src/dialogs/dlg_register.cpp
|
||||
src/dialogs/dlg_roll_dice.cpp
|
||||
src/dialogs/dlg_settings.cpp
|
||||
src/dialogs/dlg_tip_of_the_day.cpp
|
||||
src/dialogs/dlg_update.cpp
|
||||
src/dialogs/dlg_view_log.cpp
|
||||
src/dialogs/dlg_load_deck.cpp
|
||||
src/game/deckview/deck_view.cpp
|
||||
src/game/deckview/deck_view_container.cpp
|
||||
src/game/filters/filter_string.cpp
|
||||
src/game/filters/filter_builder.cpp
|
||||
src/game/filters/filter_tree.cpp
|
||||
src/game/filters/filter_tree_model.cpp
|
||||
src/client/ui/layouts/flow_layout.cpp
|
||||
src/client/ui/widgets/general/layout_containers/flow_widget.cpp
|
||||
src/game/game_scene.cpp
|
||||
src/game/game_selector.cpp
|
||||
src/game/games_model.cpp
|
||||
src/game/game_view.cpp
|
||||
src/client/get_text_with_max.cpp
|
||||
src/game/hand_counter.cpp
|
||||
src/server/handle_public_servers.cpp
|
||||
src/game/zones/hand_zone.cpp
|
||||
src/client/game_logic/key_signals.cpp
|
||||
src/client/ui/line_edit_completer.cpp
|
||||
src/server/local_client.cpp
|
||||
src/server/local_server.cpp
|
||||
src/server/local_server_interface.cpp
|
||||
src/utility/logger.cpp
|
||||
src/client/ui/widgets/cards/card_info_picture_enlarged_widget.cpp
|
||||
src/client/ui/widgets/cards/card_info_picture_with_text_overlay_widget.cpp
|
||||
src/client/ui/widgets/general/display/banner_widget.cpp
|
||||
src/client/ui/widgets/general/display/labeled_input.cpp
|
||||
src/client/ui/widgets/general/display/dynamic_font_size_label.cpp
|
||||
src/client/ui/widgets/general/display/dynamic_font_size_push_button.cpp
|
||||
src/client/ui/widgets/general/display/shadow_background_label.cpp
|
||||
src/main.cpp
|
||||
src/server/message_log_widget.cpp
|
||||
src/client/ui/layouts/overlap_layout.cpp
|
||||
src/client/ui/widgets/general/layout_containers/overlap_widget.cpp
|
||||
src/client/ui/widgets/general/layout_containers/overlap_control_widget.cpp
|
||||
src/server/pending_command.cpp
|
||||
src/game/phase.cpp
|
||||
src/client/ui/phases_toolbar.cpp
|
||||
src/client/ui/picture_loader/picture_loader.cpp
|
||||
src/client/ui/picture_loader/picture_loader_worker.cpp
|
||||
src/client/ui/picture_loader/picture_to_load.cpp
|
||||
src/game/zones/pile_zone.cpp
|
||||
src/client/ui/pixel_map_generator.cpp
|
||||
src/game/player/player.cpp
|
||||
src/game/player/player_list_widget.cpp
|
||||
src/game/player/player_target.cpp
|
||||
src/client/ui/widgets/printing_selector/all_zones_card_amount_widget.cpp
|
||||
src/client/ui/widgets/printing_selector/card_amount_widget.cpp
|
||||
src/client/ui/widgets/printing_selector/printing_selector.cpp
|
||||
src/client/ui/widgets/printing_selector/printing_selector_card_display_widget.cpp
|
||||
src/client/ui/widgets/printing_selector/printing_selector_card_overlay_widget.cpp
|
||||
src/client/ui/widgets/printing_selector/printing_selector_card_search_widget.cpp
|
||||
src/client/ui/widgets/printing_selector/printing_selector_card_selection_widget.cpp
|
||||
src/client/ui/widgets/printing_selector/printing_selector_card_sorting_widget.cpp
|
||||
src/client/ui/widgets/printing_selector/printing_selector_view_options_toolbar_widget.cpp
|
||||
src/client/ui/widgets/printing_selector/printing_selector_view_options_widget.cpp
|
||||
src/client/ui/widgets/printing_selector/set_name_and_collectors_number_display_widget.cpp
|
||||
src/client/network/release_channel.cpp
|
||||
src/client/get_text_with_max.cpp
|
||||
src/client/menus/deck_editor/deck_editor_menu.cpp
|
||||
src/client/network/client_update_checker.cpp
|
||||
src/server/remote/remote_client.cpp
|
||||
src/server/remote/remote_decklist_tree_widget.cpp
|
||||
src/server/remote/remote_replay_list_tree_widget.cpp
|
||||
src/client/network/release_channel.cpp
|
||||
src/client/network/replay_timeline_widget.cpp
|
||||
src/game/zones/select_zone.cpp
|
||||
src/utility/sequence_edit.cpp
|
||||
src/client/network/sets_model.cpp
|
||||
src/settings/card_database_settings.cpp
|
||||
src/settings/download_settings.cpp
|
||||
src/settings/game_filters_settings.cpp
|
||||
src/settings/layouts_settings.cpp
|
||||
src/settings/message_settings.cpp
|
||||
src/settings/recents_settings.cpp
|
||||
src/settings/servers_settings.cpp
|
||||
src/settings/settings_manager.cpp
|
||||
src/settings/cache_settings.cpp
|
||||
src/settings/shortcuts_settings.cpp
|
||||
src/settings/shortcut_treeview.cpp
|
||||
src/settings/card_override_settings.cpp
|
||||
src/settings/debug_settings.cpp
|
||||
src/client/sound_engine.cpp
|
||||
src/client/network/spoiler_background_updater.cpp
|
||||
src/game/zones/stack_zone.cpp
|
||||
src/client/sound_engine.cpp
|
||||
src/client/tabs/abstract_tab_deck_editor.cpp
|
||||
src/client/tabs/api/edhrec/tab_edhrec.cpp
|
||||
src/client/tabs/api/edhrec/tab_edhrec_main.cpp
|
||||
src/client/tabs/api/edhrec/display/commander/edhrec_commander_api_response_display_widget.cpp
|
||||
src/client/tabs/api/edhrec/display/commander/edhrec_commander_api_response_navigation_widget.cpp
|
||||
src/client/tabs/api/edhrec/display/card_prices/edhrec_api_response_card_prices_display_widget.cpp
|
||||
src/client/tabs/api/edhrec/display/cards/edhrec_api_response_card_details_display_widget.cpp
|
||||
src/client/tabs/api/edhrec/display/cards/edhrec_api_response_card_inclusion_display_widget.cpp
|
||||
src/client/tabs/api/edhrec/display/cards/edhrec_api_response_card_list_display_widget.cpp
|
||||
src/client/tabs/api/edhrec/display/cards/edhrec_api_response_card_synergy_display_widget.cpp
|
||||
src/client/tabs/api/edhrec/display/commander/edhrec_api_response_commander_details_display_widget.cpp
|
||||
src/client/tabs/api/edhrec/display/top_cards/edhrec_top_cards_api_response_display_widget.cpp
|
||||
src/client/tabs/api/edhrec/display/top_commander/edhrec_top_commanders_api_response_display_widget.cpp
|
||||
src/client/tabs/api/edhrec/display/top_tags/edhrec_top_tags_api_response_display_widget.cpp
|
||||
src/client/tabs/api/edhrec/api_response/archidekt_links/edhrec_api_response_archidekt_links.cpp
|
||||
src/client/tabs/api/edhrec/api_response/commander/edhrec_commander_api_response_average_deck_statistics.cpp
|
||||
src/client/tabs/api/edhrec/api_response/cards/edhrec_api_response_card_details.cpp
|
||||
src/client/tabs/api/edhrec/api_response/cards/edhrec_api_response_card_list.cpp
|
||||
src/client/tabs/api/edhrec/api_response/cards/edhrec_api_response_card_container.cpp
|
||||
src/client/tabs/api/edhrec/api_response/card_prices/edhrec_api_response_card_prices.cpp
|
||||
src/client/tabs/api/edhrec/api_response/cards/edhrec_commander_api_response_commander_details.cpp
|
||||
src/client/tabs/api/edhrec/api_response/commander/edhrec_commander_api_response.cpp
|
||||
src/client/tabs/api/edhrec/api_response/average_deck/edhrec_average_deck_api_response.cpp
|
||||
src/client/tabs/api/edhrec/api_response/average_deck/edhrec_deck_api_response.cpp
|
||||
src/client/tabs/api/edhrec/api_response/top_cards/edhrec_top_cards_api_response.cpp
|
||||
src/client/tabs/api/edhrec/api_response/top_commanders/edhrec_top_commanders_api_response.cpp
|
||||
src/client/tabs/api/edhrec/api_response/top_tags/edhrec_top_tags_api_response.cpp
|
||||
src/client/tabs/tab.cpp
|
||||
src/client/tabs/tab_account.cpp
|
||||
src/client/tabs/tab_admin.cpp
|
||||
@@ -150,49 +56,196 @@ set(cockatrice_SOURCES
|
||||
src/client/tabs/tab_room.cpp
|
||||
src/client/tabs/tab_server.cpp
|
||||
src/client/tabs/tab_supervisor.cpp
|
||||
src/client/tabs/api/edhrec/tab_edhrec.cpp
|
||||
src/client/tabs/api/edhrec/edhrec_commander_api_response_display_widget.cpp
|
||||
src/client/tabs/api/edhrec/edhrec_commander_api_response_card_details_display_widget.cpp
|
||||
src/client/tabs/api/edhrec/edhrec_commander_api_response_card_list_display_widget.cpp
|
||||
src/client/tabs/api/edhrec/edhrec_commander_api_response_commander_details_display_widget.cpp
|
||||
src/client/tabs/api/edhrec/api_response/edhrec_commander_api_response_archidekt_links.cpp
|
||||
src/client/tabs/api/edhrec/api_response/edhrec_commander_api_response_average_deck_statistics.cpp
|
||||
src/client/tabs/api/edhrec/api_response/edhrec_commander_api_response_card_details.cpp
|
||||
src/client/tabs/api/edhrec/api_response/edhrec_commander_api_response_card_list.cpp
|
||||
src/client/tabs/api/edhrec/api_response/edhrec_commander_api_response_card_container.cpp
|
||||
src/client/tabs/api/edhrec/api_response/edhrec_commander_api_response_card_prices.cpp
|
||||
src/client/tabs/api/edhrec/api_response/edhrec_commander_api_response_commander_details.cpp
|
||||
src/client/tabs/api/edhrec/api_response/edhrec_commander_api_response.cpp
|
||||
src/game/zones/table_zone.cpp
|
||||
src/client/tabs/tab_visual_database_display.cpp
|
||||
src/client/tabs/visual_deck_editor/tab_deck_editor_visual.cpp
|
||||
src/client/tabs/visual_deck_editor/tab_deck_editor_visual_tab_widget.cpp
|
||||
src/client/tabs/visual_deck_storage/tab_deck_storage_visual.cpp
|
||||
src/client/tapped_out_interface.cpp
|
||||
src/client/translate_counter_name.cpp
|
||||
src/client/ui/layouts/flow_layout.cpp
|
||||
src/client/ui/layouts/overlap_layout.cpp
|
||||
src/client/ui/line_edit_completer.cpp
|
||||
src/client/ui/phases_toolbar.cpp
|
||||
src/client/ui/picture_loader/picture_loader.cpp
|
||||
src/client/ui/picture_loader/picture_loader_worker.cpp
|
||||
src/client/ui/picture_loader/picture_to_load.cpp
|
||||
src/client/ui/pixel_map_generator.cpp
|
||||
src/client/ui/theme_manager.cpp
|
||||
src/client/ui/tip_of_the_day.cpp
|
||||
src/client/translate_counter_name.cpp
|
||||
src/client/update_downloader.cpp
|
||||
src/server/user/user_context_menu.cpp
|
||||
src/server/user/user_info_connection.cpp
|
||||
src/server/user/user_info_box.cpp
|
||||
src/server/user/user_list_manager.cpp
|
||||
src/server/user/user_list_widget.cpp
|
||||
src/client/ui/window_main.cpp
|
||||
src/game/zones/view_zone_widget.cpp
|
||||
src/game/zones/view_zone.cpp
|
||||
src/client/tabs/visual_deck_storage/tab_deck_storage_visual.cpp
|
||||
src/client/ui/widgets/cards/additional_info/color_identity_widget.cpp
|
||||
src/client/ui/widgets/cards/additional_info/mana_cost_widget.cpp
|
||||
src/client/ui/widgets/cards/additional_info/mana_symbol_widget.cpp
|
||||
src/client/ui/widgets/cards/card_group_display_widgets/card_group_display_widget.cpp
|
||||
src/client/ui/widgets/cards/card_group_display_widgets/flat_card_group_display_widget.cpp
|
||||
src/client/ui/widgets/cards/card_group_display_widgets/overlapped_card_group_display_widget.cpp
|
||||
src/client/ui/widgets/cards/card_info_display_widget.cpp
|
||||
src/client/ui/widgets/cards/card_info_frame_widget.cpp
|
||||
src/client/ui/widgets/cards/card_info_picture_enlarged_widget.cpp
|
||||
src/client/ui/widgets/cards/card_info_picture_widget.cpp
|
||||
src/client/ui/widgets/cards/card_info_picture_with_text_overlay_widget.cpp
|
||||
src/client/ui/widgets/cards/card_info_text_widget.cpp
|
||||
src/client/ui/widgets/cards/card_size_widget.cpp
|
||||
src/client/ui/widgets/cards/deck_card_zone_display_widget.cpp
|
||||
src/client/ui/widgets/cards/deck_preview_card_picture_widget.cpp
|
||||
src/client/ui/widgets/visual_deck_storage/deck_preview/deck_preview_color_identity_widget.cpp
|
||||
src/client/ui/widgets/deck_analytics/deck_analytics_widget.cpp
|
||||
src/client/ui/widgets/deck_analytics/mana_base_widget.cpp
|
||||
src/client/ui/widgets/deck_analytics/mana_curve_widget.cpp
|
||||
src/client/ui/widgets/deck_analytics/mana_devotion_widget.cpp
|
||||
src/client/ui/widgets/deck_editor/deck_editor_card_info_dock_widget.cpp
|
||||
src/client/ui/widgets/deck_editor/deck_editor_database_display_widget.cpp
|
||||
src/client/ui/widgets/deck_editor/deck_editor_deck_dock_widget.cpp
|
||||
src/client/ui/widgets/deck_editor/deck_editor_filter_dock_widget.cpp
|
||||
src/client/ui/widgets/deck_editor/deck_editor_printing_selector_dock_widget.cpp
|
||||
src/client/ui/widgets/general/display/banner_widget.cpp
|
||||
src/client/ui/widgets/general/display/bar_widget.cpp
|
||||
src/client/ui/widgets/general/display/dynamic_font_size_label.cpp
|
||||
src/client/ui/widgets/general/display/dynamic_font_size_push_button.cpp
|
||||
src/client/ui/widgets/general/display/labeled_input.cpp
|
||||
src/client/ui/widgets/general/display/percent_bar_widget.cpp
|
||||
src/client/ui/widgets/general/display/shadow_background_label.cpp
|
||||
src/client/ui/widgets/general/layout_containers/flow_widget.cpp
|
||||
src/client/ui/widgets/general/layout_containers/overlap_control_widget.cpp
|
||||
src/client/ui/widgets/general/layout_containers/overlap_widget.cpp
|
||||
src/client/ui/widgets/printing_selector/all_zones_card_amount_widget.cpp
|
||||
src/client/ui/widgets/printing_selector/card_amount_widget.cpp
|
||||
src/client/ui/widgets/printing_selector/printing_selector.cpp
|
||||
src/client/ui/widgets/printing_selector/printing_selector_card_display_widget.cpp
|
||||
src/client/ui/widgets/printing_selector/printing_selector_card_overlay_widget.cpp
|
||||
src/client/ui/widgets/printing_selector/printing_selector_card_search_widget.cpp
|
||||
src/client/ui/widgets/printing_selector/printing_selector_card_selection_widget.cpp
|
||||
src/client/ui/widgets/printing_selector/printing_selector_card_sorting_widget.cpp
|
||||
src/client/ui/widgets/printing_selector/set_name_and_collectors_number_display_widget.cpp
|
||||
src/client/ui/widgets/quick_settings/settings_button_widget.cpp
|
||||
src/client/ui/widgets/quick_settings/settings_popup_widget.cpp
|
||||
src/client/ui/widgets/visual_database_display/visual_database_display_widget.cpp
|
||||
src/client/ui/widgets/visual_database_display/visual_database_display_color_filter_widget.cpp
|
||||
src/client/ui/widgets/visual_database_display/visual_database_display_sub_type_filter_widget.cpp
|
||||
src/client/ui/widgets/visual_database_display/visual_database_display_name_filter_widget.cpp
|
||||
src/client/ui/widgets/visual_database_display/visual_database_display_main_type_filter_widget.cpp
|
||||
src/client/ui/widgets/visual_database_display/visual_database_display_set_filter_widget.cpp
|
||||
src/client/ui/widgets/visual_database_display/visual_database_display_filter_save_load_widget.cpp
|
||||
src/client/ui/widgets/visual_database_display/visual_database_filter_display_widget.cpp
|
||||
src/client/ui/widgets/visual_deck_editor/visual_deck_editor_widget.cpp
|
||||
src/client/ui/widgets/visual_deck_editor/visual_deck_editor_sample_hand_widget.cpp
|
||||
src/client/ui/widgets/visual_deck_storage/deck_preview/deck_preview_color_identity_filter_widget.cpp
|
||||
src/client/ui/widgets/visual_deck_storage/deck_preview/deck_preview_tag_addition_widget.cpp
|
||||
src/client/ui/widgets/visual_deck_storage/deck_preview/deck_preview_tag_display_widget.cpp
|
||||
src/client/ui/widgets/visual_deck_storage/deck_preview/deck_preview_tag_dialog.cpp
|
||||
src/client/ui/widgets/visual_deck_storage/deck_preview/deck_preview_tag_item_widget.cpp
|
||||
src/client/ui/widgets/visual_deck_storage/deck_preview/deck_preview_deck_tags_display_widget.cpp
|
||||
src/client/ui/widgets/visual_deck_storage/deck_preview/deck_preview_tag_addition_widget.cpp
|
||||
src/client/ui/widgets/visual_deck_storage/deck_preview/deck_preview_tag_dialog.cpp
|
||||
src/client/ui/widgets/visual_deck_storage/deck_preview/deck_preview_tag_display_widget.cpp
|
||||
src/client/ui/widgets/visual_deck_storage/deck_preview/deck_preview_tag_item_widget.cpp
|
||||
src/client/ui/widgets/visual_deck_storage/deck_preview/deck_preview_widget.cpp
|
||||
src/client/ui/widgets/visual_deck_storage/visual_deck_storage_widget.cpp
|
||||
src/client/ui/widgets/visual_deck_storage/visual_deck_storage_folder_display_widget.cpp
|
||||
src/client/ui/widgets/visual_deck_storage/visual_deck_storage_quick_settings_widget.cpp
|
||||
src/client/ui/widgets/visual_deck_storage/visual_deck_storage_search_widget.cpp
|
||||
src/client/ui/widgets/visual_deck_storage/visual_deck_storage_sort_widget.cpp
|
||||
src/client/ui/widgets/visual_deck_storage/visual_deck_storage_tag_filter_widget.cpp
|
||||
${VERSION_STRING_CPP}
|
||||
src/client/ui/widgets/visual_deck_storage/visual_deck_storage_widget.cpp
|
||||
src/client/ui/window_main.cpp
|
||||
src/client/update_downloader.cpp
|
||||
src/deck/custom_line_edit.cpp
|
||||
src/deck/deck_list_model.cpp
|
||||
src/deck/deck_loader.cpp
|
||||
src/deck/deck_stats_interface.cpp
|
||||
src/dialogs/dlg_connect.cpp
|
||||
src/dialogs/dlg_convert_deck_to_cod_format.cpp
|
||||
src/dialogs/dlg_create_game.cpp
|
||||
src/dialogs/dlg_create_token.cpp
|
||||
src/dialogs/dlg_edit_avatar.cpp
|
||||
src/dialogs/dlg_edit_password.cpp
|
||||
src/dialogs/dlg_edit_tokens.cpp
|
||||
src/dialogs/dlg_edit_user.cpp
|
||||
src/dialogs/dlg_filter_games.cpp
|
||||
src/dialogs/dlg_forgot_password_challenge.cpp
|
||||
src/dialogs/dlg_forgot_password_request.cpp
|
||||
src/dialogs/dlg_forgot_password_reset.cpp
|
||||
src/dialogs/dlg_load_deck.cpp
|
||||
src/dialogs/dlg_load_deck_from_clipboard.cpp
|
||||
src/dialogs/dlg_load_remote_deck.cpp
|
||||
src/dialogs/dlg_manage_sets.cpp
|
||||
src/dialogs/dlg_move_top_cards_until.cpp
|
||||
src/dialogs/dlg_register.cpp
|
||||
src/dialogs/dlg_roll_dice.cpp
|
||||
src/dialogs/dlg_settings.cpp
|
||||
src/dialogs/dlg_tip_of_the_day.cpp
|
||||
src/dialogs/dlg_update.cpp
|
||||
src/dialogs/dlg_view_log.cpp
|
||||
src/game/board/abstract_card_drag_item.cpp
|
||||
src/game/board/abstract_card_item.cpp
|
||||
src/game/board/abstract_counter.cpp
|
||||
src/game/board/abstract_graphics_item.cpp
|
||||
src/game/board/arrow_item.cpp
|
||||
src/game/board/arrow_target.cpp
|
||||
src/game/board/card_drag_item.cpp
|
||||
src/game/board/card_item.cpp
|
||||
src/game/board/card_list.cpp
|
||||
src/game/board/counter_general.cpp
|
||||
src/game/cards/card_completer_proxy_model.cpp
|
||||
src/game/cards/card_database.cpp
|
||||
src/game/cards/card_database_manager.cpp
|
||||
src/game/cards/card_database_model.cpp
|
||||
src/game/cards/card_database_parser/card_database_parser.cpp
|
||||
src/game/cards/card_database_parser/cockatrice_xml_3.cpp
|
||||
src/game/cards/card_database_parser/cockatrice_xml_4.cpp
|
||||
src/game/cards/card_info.cpp
|
||||
src/game/cards/card_search_model.cpp
|
||||
src/game/deckview/deck_view.cpp
|
||||
src/game/deckview/deck_view_container.cpp
|
||||
src/game/filters/filter_builder.cpp
|
||||
src/game/filters/filter_card.cpp
|
||||
src/game/filters/filter_string.cpp
|
||||
src/game/filters/filter_tree.cpp
|
||||
src/game/filters/filter_tree_model.cpp
|
||||
src/game/filters/syntax_help.cpp
|
||||
src/game/game_scene.cpp
|
||||
src/game/game_selector.cpp
|
||||
src/game/game_view.cpp
|
||||
src/game/games_model.cpp
|
||||
src/game/hand_counter.cpp
|
||||
src/game/phase.cpp
|
||||
src/game/player/player.cpp
|
||||
src/game/player/player_list_widget.cpp
|
||||
src/game/player/player_target.cpp
|
||||
src/game/zones/card_zone.cpp
|
||||
src/game/zones/hand_zone.cpp
|
||||
src/game/zones/pile_zone.cpp
|
||||
src/game/zones/select_zone.cpp
|
||||
src/game/zones/stack_zone.cpp
|
||||
src/game/zones/table_zone.cpp
|
||||
src/game/zones/view_zone.cpp
|
||||
src/game/zones/view_zone_widget.cpp
|
||||
src/main.cpp
|
||||
src/server/chat_view/chat_view.cpp
|
||||
src/server/handle_public_servers.cpp
|
||||
src/server/local_client.cpp
|
||||
src/server/local_server.cpp
|
||||
src/server/local_server_interface.cpp
|
||||
src/server/message_log_widget.cpp
|
||||
src/server/pending_command.cpp
|
||||
src/server/remote/remote_client.cpp
|
||||
src/server/remote/remote_decklist_tree_widget.cpp
|
||||
src/server/remote/remote_replay_list_tree_widget.cpp
|
||||
src/server/user/user_context_menu.cpp
|
||||
src/server/user/user_info_box.cpp
|
||||
src/server/user/user_info_connection.cpp
|
||||
src/server/user/user_list_manager.cpp
|
||||
src/server/user/user_list_widget.cpp
|
||||
src/settings/cache_settings.cpp
|
||||
src/settings/card_database_settings.cpp
|
||||
src/settings/card_override_settings.cpp
|
||||
src/settings/debug_settings.cpp
|
||||
src/settings/download_settings.cpp
|
||||
src/settings/game_filters_settings.cpp
|
||||
src/settings/layouts_settings.cpp
|
||||
src/settings/message_settings.cpp
|
||||
src/settings/recents_settings.cpp
|
||||
src/settings/servers_settings.cpp
|
||||
src/settings/settings_manager.cpp
|
||||
src/settings/shortcut_treeview.cpp
|
||||
src/settings/shortcuts_settings.cpp
|
||||
src/utility/card_info_comparator.cpp
|
||||
src/utility/levenshtein.cpp
|
||||
src/utility/logger.cpp
|
||||
src/utility/sequence_edit.cpp
|
||||
)
|
||||
|
||||
add_subdirectory(sounds)
|
||||
@@ -338,6 +391,13 @@ if(APPLE)
|
||||
PATTERN "tls/*.dylib"
|
||||
)
|
||||
|
||||
install(
|
||||
DIRECTORY "${CMAKE_BINARY_DIR}/cockatrice/"
|
||||
DESTINATION ${qtconf_dest_dir}/
|
||||
FILES_MATCHING
|
||||
PATTERN "*.ini"
|
||||
)
|
||||
|
||||
install(
|
||||
CODE "
|
||||
file(WRITE \"\${CMAKE_INSTALL_PREFIX}/${qtconf_dest_dir}/qt.conf\" \"[Paths]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<RCC>
|
||||
<qresource prefix="/" >
|
||||
<qresource prefix="/">
|
||||
<file>resources/cardback.svg</file>
|
||||
<file>resources/cockatrice.svg</file>
|
||||
<file>resources/hand.svg</file>
|
||||
@@ -13,9 +13,12 @@
|
||||
<file>resources/icons/arrow_top_green.svg</file>
|
||||
<file>resources/icons/arrow_up_green.svg</file>
|
||||
<file>resources/icons/clearsearch.svg</file>
|
||||
<file>resources/icons/cogwheel.svg</file>
|
||||
<file>resources/icons/conceded.svg</file>
|
||||
<file>resources/icons/decrement.svg</file>
|
||||
<file>resources/icons/delete.svg</file>
|
||||
<file>resources/icons/dropdown_collapsed.svg</file>
|
||||
<file>resources/icons/dropdown_expanded.svg</file>
|
||||
<file>resources/icons/forgot_password.svg</file>
|
||||
<file>resources/icons/increment.svg</file>
|
||||
<file>resources/icons/info.svg</file>
|
||||
@@ -24,7 +27,9 @@
|
||||
<file>resources/icons/pencil.svg</file>
|
||||
<file>resources/icons/player.svg</file>
|
||||
<file>resources/icons/ready_start.svg</file>
|
||||
<file>resources/icons/reload.svg</file>
|
||||
<file>resources/icons/remove_row.svg</file>
|
||||
<file>resources/icons/rename.svg</file>
|
||||
<file>resources/icons/scales.svg</file>
|
||||
<file>resources/icons/search.svg</file>
|
||||
<file>resources/icons/settings.svg</file>
|
||||
@@ -35,6 +40,12 @@
|
||||
<file>resources/icons/update.png</file>
|
||||
<file>resources/icons/view.svg</file>
|
||||
|
||||
<file>resources/icons/mana/B.svg</file>
|
||||
<file>resources/icons/mana/G.svg</file>
|
||||
<file>resources/icons/mana/R.svg</file>
|
||||
<file>resources/icons/mana/U.svg</file>
|
||||
<file>resources/icons/mana/W.svg</file>
|
||||
|
||||
<file>resources/config/general.svg</file>
|
||||
<file>resources/config/appearance.svg</file>
|
||||
<file>resources/config/interface.svg</file>
|
||||
@@ -342,19 +353,29 @@
|
||||
|
||||
<!-- ADD TIP OF THE DAY IMAGES HERE -->
|
||||
<file>resources/tips/images/accounts_tab.png</file>
|
||||
<file>resources/tips/images/add_card.png</file>
|
||||
<file>resources/tips/images/arrows.png</file>
|
||||
<file>resources/tips/images/card_select.png</file>
|
||||
<file>resources/tips/images/cockatrice_register.png</file>
|
||||
<file>resources/tips/images/cockatrice_wiki.png</file>
|
||||
<file>resources/tips/images/coin_flip.png</file>
|
||||
<file>resources/tips/images/counter_expression.png</file>
|
||||
<file>resources/tips/images/discord.png</file>
|
||||
<file>resources/tips/images/edhrec.png</file>
|
||||
<file>resources/tips/images/expand_card_view.png</file>
|
||||
<file>resources/tips/images/face_down.png</file>
|
||||
<file>resources/tips/images/filter_games.png</file>
|
||||
<file>resources/tips/images/github_logo.png</file>
|
||||
<file>resources/tips/images/highlight_cards.png</file>
|
||||
<file>resources/tips/images/pawns.png</file>
|
||||
<file>resources/tips/images/setpt.png</file>
|
||||
<file>resources/tips/images/shortcuts.png</file>
|
||||
<file>resources/tips/images/syntax_help.png</file>
|
||||
<file>resources/tips/images/themes.png</file>
|
||||
<file>resources/tips/images/tip_of_the_day.png</file>
|
||||
<file>resources/tips/images/token.png</file>
|
||||
<file>resources/tips/images/updates.png</file>
|
||||
<file>resources/tips/images/visual_deck_tags.png</file>
|
||||
<file>resources/tips/tips_of_the_day.xml</file>
|
||||
|
||||
<file>resources/help/search.md</file>
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
[Rules]
|
||||
# Uncomment a rule to disable logging for that category
|
||||
# The default log level is info
|
||||
*.debug = false
|
||||
|
||||
# Uncomment a rule to disable logging for that category,
|
||||
# or set .debug = true for that category to see debug level logs
|
||||
|
||||
# main = false
|
||||
# qt_translator = false
|
||||
@@ -23,6 +27,7 @@
|
||||
# servers_settings = false
|
||||
# shortcuts_settings = false
|
||||
|
||||
# local_client = false
|
||||
# remote_client = false
|
||||
|
||||
# player = false
|
||||
@@ -44,12 +49,15 @@
|
||||
# cockatrice_xml.* = false
|
||||
# cockatrice_xml.xml_3_parser = false
|
||||
# cockatrice_xml.xml_4_parser = false
|
||||
# card_info = false
|
||||
# card_list = false
|
||||
|
||||
flow_layout.debug = false
|
||||
flow_widget.debug = false
|
||||
flow_widget.size.debug = false
|
||||
#flow_layout = false
|
||||
#flow_widget = false
|
||||
#flow_widget.size = false
|
||||
|
||||
# card_info_picture_widget = false
|
||||
|
||||
# pixel_map_generator = false
|
||||
|
||||
# filter_string = false
|
||||
# filter_string = false
|
||||
|
||||
29
cockatrice/resources/icons/cogwheel.svg
Normal file
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
<svg xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" width="102.5024mm" height="102.24421mm"
|
||||
viewBox="0 0 102.5024 102.24421" version="1.1"
|
||||
id="svg1"
|
||||
inkscape:version="1.4 (e7c3feb100, 2024-10-09)" sodipodi:docname="cog_wheel.svg"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview id="namedview1" pagecolor="#ffffff" bordercolor="#000000" borderopacity="0.25"
|
||||
inkscape:showpageshadow="2" inkscape:pageopacity="0.0" inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#d1d1d1" inkscape:document-units="mm" inkscape:zoom="0.66101291"
|
||||
inkscape:cx="146.74449" inkscape:cy="193.64221" inkscape:window-width="1829"
|
||||
inkscape:window-height="951" inkscape:window-x="0" inkscape:window-y="0"
|
||||
inkscape:window-maximized="1" inkscape:current-layer="layer1"/>
|
||||
<defs id="defs1"/>
|
||||
<g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" transform="translate(-66.148059,-97.377896)">
|
||||
<g id="g1" transform="translate(-165.09777,-82.009607)">
|
||||
<g id="g2" transform="matrix(0.26458333,0,0,0.26458333,64.983323,161.37858)">
|
||||
<path style="fill:#333333;stroke-width:94.4882"
|
||||
d="m 721.34301,94.413051 40.00966,29.763289 29.51933,-9.27053 14.63768,-46.840589 36.83817,0.48792 13.41787,46.108699 28.29952,9.5145 40.74155,-28.299519 29.0314,21.468599 -15.85748,47.08454 16.58937,23.66426 48.30432,-2.68358 12.93,34.88648 -41.71741,27.07971 -0.48792,29.27536 40.49763,26.10387 -10.2464,34.15459 -48.54834,-0.97584 -18.78502,23.42029 15.85749,45.37681 -28.29952,21.71256 -41.22947,-29.27536 -28.54348,9.75846 -13.66184,47.57246 -38.30194,-0.73188 -14.63768,-48.30435 -27.07971,-9.27054 -40.00966,29.27537 -30.25121,-20.49276 17.32125,-46.35266 -17.80918,-24.64009 -49.76812,3.17149 -11.22222,-34.64251 40.74155,-27.07971 0.48792,-30.00725 -41.71739,-27.32367 12.19807,-32.93479 48.30435,2.68358 20.24879,-24.6401 -17.32126,-47.08455 z"
|
||||
id="path1"/>
|
||||
<circle style="fill:#f9f9f9;stroke-width:72.1317" id="path2" cx="822.09906" cy="261.28262"
|
||||
r="83.434792"/>
|
||||
<circle style="fill:#4d4d4d;stroke-width:40.5147" id="circle2" cx="822.09906" cy="261.28262"
|
||||
r="46.863361"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.5 KiB |
10
cockatrice/resources/icons/dropdown_collapsed.svg
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
|
||||
<!ENTITY ns_svg "http://www.w3.org/2000/svg">
|
||||
<!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
|
||||
]>
|
||||
<svg version="1.1" id="Layer_1" xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="460.5" height="531.74"
|
||||
viewBox="0 0 460.5 531.74" overflow="visible" enable-background="new 0 0 460.5 531.74" xml:space="preserve">
|
||||
<polygon fill="#918d8d" points="0.5,0.866 459.5,265.87 0.5,530.874 "/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 657 B |
10
cockatrice/resources/icons/dropdown_expanded.svg
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
|
||||
<!ENTITY ns_svg "http://www.w3.org/2000/svg">
|
||||
<!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
|
||||
]>
|
||||
<svg version="1.1" id="Layer_1" xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="531.74" height="460.5"
|
||||
viewBox="0 0 531.74 460.5" overflow="visible" enable-background="new 0 0 531.74 460.5" xml:space="preserve">
|
||||
<polygon fill="#918d8d" points="530.874,0.5 265.87,459.5 0.866,0.5 "/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 657 B |
47
cockatrice/resources/icons/mana/B.svg
Normal file
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
width="169.34801mm"
|
||||
height="169.34801mm"
|
||||
viewBox="0 0 600 600"
|
||||
version="1.1"
|
||||
id="svg1"
|
||||
sodipodi:docname="B.svg"
|
||||
inkscape:export-filename="B.svg"
|
||||
inkscape:export-xdpi="96"
|
||||
inkscape:export-ydpi="96"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<defs
|
||||
id="defs1"/>
|
||||
<sodipodi:namedview
|
||||
id="namedview1"
|
||||
pagecolor="#505050"
|
||||
bordercolor="#eeeeee"
|
||||
borderopacity="1"
|
||||
inkscape:showpageshadow="0"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#505050"
|
||||
inkscape:document-units="mm">
|
||||
<inkscape:page
|
||||
x="0"
|
||||
y="0"
|
||||
width="600"
|
||||
height="600"
|
||||
id="page2"
|
||||
margin="0"
|
||||
bleed="0"/>
|
||||
</sodipodi:namedview>
|
||||
<path
|
||||
id="Selection"
|
||||
fill="none"
|
||||
stroke="#000000"
|
||||
stroke-width="1"
|
||||
d="m 275,0.21 c 0,0 42,0 42,0 0,0 19,1.51 19,1.51 29.13,3.58 56.99,10.83 84,22.43 33.64,14.45 59.89,32.91 86.91,57.41 17.38,15.76 34.67,37.56 47.14,57.44 22.78,36.31 37.1,74.56 43.22,117 1.28,8.88 2.72,19.08 2.73,28 0,0 0,34 0,34 0,0 -0.91,10 -0.91,10 -2.36,32.29 -11.93,67.59 -25.4,97 -27.01,58.98 -70.49,105.42 -126.69,137.57 -34.3,19.63 -79.56,33.64 -119,36.52 0,0 -12,0.91 -12,0.91 0,0 -34,0 -34,0 0,0 -10,-0.91 -10,-0.91 -26.57,-1.94 -53.09,-8.27 -78,-17.67 C 163.49,569.9 134.12,553.46 109,532.57 79.87,508.33 54.41,478.39 36.31,445 -5.08,368.65 -11.86,276.57 18.05,195 47.85,113.75 113.21,48.92 194,18.42 213.55,11.04 236.32,5.43 257,2.43 Z"
|
||||
style="display:inline;fill:#ababab;fill-opacity:1"/>
|
||||
<path
|
||||
d="m 299.67889,84.945431 c -118.26949,0 -214.122988,83.892719 -214.122988,187.357619 0,58.63289 30.863828,110.90901 79.041488,145.28579 8.02961,5.77129 12.71356,15.13917 11.29165,25.0089 l -7.86234,55.37086 c -1.17098,8.02962 5.01851,15.22281 13.13176,15.22281 h 64.98968 v -46.83939 c 0,-3.68025 3.01111,-6.69135 6.69135,-6.69135 h 13.38268 c 3.68024,0 6.69135,3.0111 6.69135,6.69135 v 46.83939 h 53.53075 v -46.83939 c 0,-3.68025 3.01111,-6.69135 6.69134,-6.69135 h 13.38269 c 3.68023,0 6.69134,3.0111 6.69134,6.69135 v 46.83939 h 64.98967 c 8.11327,0 14.30275,-7.19319 13.13177,-15.22281 l -7.86234,-55.37086 c -1.4219,-9.78609 3.1784,-19.23761 11.29165,-25.0089 48.17767,-34.37678 79.0415,-86.6529 79.0415,-145.28579 0,-103.4649 -95.8535,-187.357619 -214.123,-187.357619 z M 219.38277,352.59917 c -29.52555,0 -53.53075,-24.0052 -53.53075,-53.53075 0,-29.52555 24.0052,-53.53075 53.53075,-53.53075 29.52555,0 53.53075,24.0052 53.53075,53.53075 0,29.52555 -24.0052,53.53075 -53.53075,53.53075 z m 160.59225,0 c -29.52555,0 -53.53075,-24.0052 -53.53075,-53.53075 0,-29.52555 24.0052,-53.53075 53.53075,-53.53075 29.52555,0 53.53075,24.0052 53.53075,53.53075 0,29.52555 -24.0052,53.53075 -53.53075,53.53075 z"
|
||||
id="path1"
|
||||
style="fill:#4d4d4d;fill-opacity:1;stroke:#000000;stroke-width:0.836419;stroke-opacity:1"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.2 KiB |
47
cockatrice/resources/icons/mana/G.svg
Normal file
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
width="169.34801mm"
|
||||
height="169.34801mm"
|
||||
viewBox="0 0 600 600"
|
||||
version="1.1"
|
||||
id="svg1"
|
||||
sodipodi:docname="B.svg"
|
||||
inkscape:export-filename="U.svg"
|
||||
inkscape:export-xdpi="96"
|
||||
inkscape:export-ydpi="96"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<defs
|
||||
id="defs1"/>
|
||||
<sodipodi:namedview
|
||||
id="namedview1"
|
||||
pagecolor="#505050"
|
||||
bordercolor="#eeeeee"
|
||||
borderopacity="1"
|
||||
inkscape:showpageshadow="0"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#505050"
|
||||
inkscape:document-units="mm">
|
||||
<inkscape:page
|
||||
x="0"
|
||||
y="0"
|
||||
width="600"
|
||||
height="600"
|
||||
id="page2"
|
||||
margin="0"
|
||||
bleed="0"/>
|
||||
</sodipodi:namedview>
|
||||
<path
|
||||
id="Selection"
|
||||
fill="none"
|
||||
stroke="#000000"
|
||||
stroke-width="1"
|
||||
d="m 275,0.21 c 0,0 42,0 42,0 0,0 19,1.51 19,1.51 29.13,3.58 56.99,10.83 84,22.43 33.64,14.45 59.89,32.91 86.91,57.41 17.38,15.76 34.67,37.56 47.14,57.44 22.78,36.31 37.1,74.56 43.22,117 1.28,8.88 2.72,19.08 2.73,28 0,0 0,34 0,34 0,0 -0.91,10 -0.91,10 -2.36,32.29 -11.93,67.59 -25.4,97 -27.01,58.98 -70.49,105.42 -126.69,137.57 -34.3,19.63 -79.56,33.64 -119,36.52 0,0 -12,0.91 -12,0.91 0,0 -34,0 -34,0 0,0 -10,-0.91 -10,-0.91 -26.57,-1.94 -53.09,-8.27 -78,-17.67 C 163.49,569.9 134.12,553.46 109,532.57 79.87,508.33 54.41,478.39 36.31,445 -5.08,368.65 -11.86,276.57 18.05,195 47.85,113.75 113.21,48.92 194,18.42 213.55,11.04 236.32,5.43 257,2.43 Z"
|
||||
style="display:inline;fill:#5f9f56;fill-opacity:1"/>
|
||||
<path
|
||||
d="m 488.52401,428.04591 -80.36527,-83.50228 h 30.81218 c 9.06362,0 17.08104,-4.61393 20.90363,-12.05153 3.82262,-7.41912 2.56521,-15.92714 -3.29949,-22.19282 l -78.59482,-83.87142 h 29.06188 c 9.15413,0 17.40291,-4.93688 20.98411,-12.55902 3.54092,-7.50219 1.87106,-16.23169 -4.26525,-22.22053 L 312.83499,83.240199 c -6.06588,-5.951919 -17.38282,-5.951919 -23.45873,0 L 178.44019,191.64831 c -6.13629,5.98884 -7.79612,14.71834 -4.26523,22.22053 3.58119,7.62214 11.84001,12.55902 20.99414,12.55902 h 29.06189 l -78.60489,83.88987 c -5.84454,6.25645 -7.10199,14.75525 -3.28944,22.18361 3.82262,7.42836 11.82996,12.04229 20.90363,12.04229 h 30.81222 l -80.36527,83.50228 c -6.03569,6.26567 -7.40379,14.84754 -3.58117,22.38663 3.7723,7.42839 12.07138,12.22682 21.13497,12.22682 h 129.63669 c 0,0 -36.12127,66.38546 0,62.75824 h 80.45578 c 33.50708,5.78651 0,-62.75824 0,-62.75824 h 129.63668 c 9.06361,0 17.36266,-4.79843 21.13499,-12.22682 3.82262,-7.53909 2.45452,-16.12096 -3.58117,-22.38663 z"
|
||||
id="ENVIR"
|
||||
style="fill:#3f6e3a;fill-opacity:1;stroke:#000000;stroke-width:1.09833;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.1 KiB |
47
cockatrice/resources/icons/mana/R.svg
Normal file
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
width="169.34801mm"
|
||||
height="169.34801mm"
|
||||
viewBox="0 0 600 600"
|
||||
version="1.1"
|
||||
id="svg1"
|
||||
sodipodi:docname="B.svg"
|
||||
inkscape:export-filename="B.svg"
|
||||
inkscape:export-xdpi="96"
|
||||
inkscape:export-ydpi="96"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<defs
|
||||
id="defs1"/>
|
||||
<sodipodi:namedview
|
||||
id="namedview1"
|
||||
pagecolor="#505050"
|
||||
bordercolor="#eeeeee"
|
||||
borderopacity="1"
|
||||
inkscape:showpageshadow="0"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#505050"
|
||||
inkscape:document-units="mm">
|
||||
<inkscape:page
|
||||
x="0"
|
||||
y="0"
|
||||
width="600"
|
||||
height="600"
|
||||
id="page2"
|
||||
margin="0"
|
||||
bleed="0"/>
|
||||
</sodipodi:namedview>
|
||||
<path
|
||||
id="Selection"
|
||||
fill="none"
|
||||
stroke="#000000"
|
||||
stroke-width="1"
|
||||
d="m 275,0.21 c 0,0 42,0 42,0 0,0 19,1.51 19,1.51 29.13,3.58 56.99,10.83 84,22.43 33.64,14.45 59.89,32.91 86.91,57.41 17.38,15.76 34.67,37.56 47.14,57.44 22.78,36.31 37.1,74.56 43.22,117 1.28,8.88 2.72,19.08 2.73,28 0,0 0,34 0,34 0,0 -0.91,10 -0.91,10 -2.36,32.29 -11.93,67.59 -25.4,97 -27.01,58.98 -70.49,105.42 -126.69,137.57 -34.3,19.63 -79.56,33.64 -119,36.52 0,0 -12,0.91 -12,0.91 0,0 -34,0 -34,0 0,0 -10,-0.91 -10,-0.91 -26.57,-1.94 -53.09,-8.27 -78,-17.67 C 163.49,569.9 134.12,553.46 109,532.57 79.87,508.33 54.41,478.39 36.31,445 -5.08,368.65 -11.86,276.57 18.05,195 47.85,113.75 113.21,48.92 194,18.42 213.55,11.04 236.32,5.43 257,2.43 Z"
|
||||
style="display:inline;fill:#c95e46;fill-opacity:1"/>
|
||||
<path
|
||||
style="display:inline;fill:#7e3525;fill-opacity:1;stroke:#000000;stroke-width:0.999129;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 278.25473,537.27772 c -22.36635,-1.29637 -48.78648,-8.31223 -69.74195,-18.51997 -47.30139,-23.04123 -75.19872,-59.72004 -85.45343,-112.35234 -2.77041,-14.21911 -2.51753,-48.32296 0.4755,-64.1246 4.84373,-25.57244 17.23939,-55.03329 30.65191,-72.85059 3.74877,-4.97991 16.33133,-18.11906 30.23479,-31.57223 13.09764,-12.67346 26.64745,-26.67202 30.11069,-31.10792 16.66894,-21.35045 26.46602,-44.71272 29.68313,-70.78286 1.93489,-15.67951 0.37962,-45.867231 -3.5802,-69.491071 -0.58906,-3.51428 0.36584,-3.52724 11.47726,-0.15583 36.51454,11.0792 67.37028,34.791071 89.32423,68.643431 9.96686,15.36862 20.07787,39.31263 24.78919,58.70364 2.23257,9.18886 2.53252,44.73878 0.46396,54.98571 -0.75708,3.75024 -1.10086,7.09425 -0.76396,7.43114 1.5021,1.5021 14.63666,-6.65479 21.98002,-13.65016 10.59844,-10.09621 14.32693,-17.61354 15.94714,-32.15254 l 1.16788,-10.47988 3.4626,3.95724 c 26.80954,30.6392 41.75268,56.11528 54.11775,92.26358 11.02075,32.21825 14.93902,62.79297 12.47422,97.33768 -1.88493,26.41774 -10.16486,50.6958 -24.95555,73.17369 -6.31625,9.59901 -30.86306,34.05172 -40.40914,40.25423 -23.44452,15.23295 -50.15355,25.25695 -77.26806,28.99903 -12.48732,1.72336 -38.04339,2.42637 -54.18798,1.49062 z m 48.34948,-30.34196 c 30.78066,-8.0491 53.53846,-30.12825 59.69792,-57.9177 2.48916,-11.23027 2.26087,-34.25269 -0.43747,-44.11787 -5.3998,-19.74181 -9.72931,-26.61651 -30.6237,-48.62658 -16.92925,-17.8332 -21.73398,-24.64464 -25.45673,-36.0889 -2.38622,-7.33554 -2.63126,-9.53814 -2.57644,-23.15876 0.0334,-8.27872 0.486,-17.4607 1.00593,-20.40441 0.75887,-4.29636 0.66928,-5.45812 -0.45409,-5.88919 -2.12997,-0.81736 -16.25071,4.45522 -21.90917,8.1807 -25.69349,16.91641 -42.62753,52.30879 -40.22917,84.07948 0.39046,5.17228 0.2831,8.79277 -0.26071,8.79277 -1.78935,0 -13.49435,-13.46378 -15.34792,-17.65406 -1.03171,-2.33236 -2.15967,-6.42651 -2.50657,-9.09812 -1.00143,-7.71233 -1.60778,-8.14619 -5.46339,-3.90915 -13.31687,14.63425 -24.58113,35.69359 -29.53283,55.21379 -11.75615,46.34414 2.14731,84.38956 37.55813,102.77397 16.56338,8.59931 29.2427,11.25369 51.26679,10.73261 12.58064,-0.29766 17.41119,-0.85366 25.26942,-2.90858 z"
|
||||
id="path8"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.2 KiB |
48
cockatrice/resources/icons/mana/U.svg
Normal file
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
width="169.34801mm"
|
||||
height="169.34801mm"
|
||||
viewBox="0 0 600 600"
|
||||
version="1.1"
|
||||
id="svg1"
|
||||
sodipodi:docname="U.svg"
|
||||
inkscape:export-filename="U.png"
|
||||
inkscape:export-xdpi="96"
|
||||
inkscape:export-ydpi="96"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<defs
|
||||
id="defs1"/>
|
||||
<sodipodi:namedview
|
||||
id="namedview1"
|
||||
pagecolor="#505050"
|
||||
bordercolor="#eeeeee"
|
||||
borderopacity="1"
|
||||
inkscape:showpageshadow="0"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#505050"
|
||||
inkscape:document-units="mm">
|
||||
<inkscape:page
|
||||
x="0"
|
||||
y="0"
|
||||
width="600"
|
||||
height="600"
|
||||
id="page2"
|
||||
margin="0"
|
||||
bleed="0"/>
|
||||
</sodipodi:namedview>
|
||||
<path
|
||||
id="Selection"
|
||||
fill="none"
|
||||
stroke="#000000"
|
||||
stroke-width="1"
|
||||
d="m 275,0.21 c 0,0 42,0 42,0 0,0 19,1.51 19,1.51 29.13,3.58 56.99,10.83 84,22.43 33.64,14.45 59.89,32.91 86.91,57.41 17.38,15.76 34.67,37.56 47.14,57.44 22.78,36.31 37.1,74.56 43.22,117 1.28,8.88 2.72,19.08 2.73,28 0,0 0,34 0,34 0,0 -0.91,10 -0.91,10 -2.36,32.29 -11.93,67.59 -25.4,97 -27.01,58.98 -70.49,105.42 -126.69,137.57 -34.3,19.63 -79.56,33.64 -119,36.52 0,0 -12,0.91 -12,0.91 0,0 -34,0 -34,0 0,0 -10,-0.91 -10,-0.91 -26.57,-1.94 -53.09,-8.27 -78,-17.67 C 163.49,569.9 134.12,553.46 109,532.57 79.87,508.33 54.41,478.39 36.31,445 -5.08,368.65 -11.86,276.57 18.05,195 47.85,113.75 113.21,48.92 194,18.42 213.55,11.04 236.32,5.43 257,2.43 Z"
|
||||
style="display:inline;fill:#4a8fd8;fill-opacity:1"/>
|
||||
<path
|
||||
style="display:inline;fill:#3266af;fill-opacity:1;stroke:#000000;stroke-width:1.06525;stroke-opacity:1"
|
||||
d="m 275.20608,536.5693 c -58.69596,-9.5447 -107.01545,-50.69962 -125.66779,-107.0344 -9.25532,-27.95342 -10.39669,-58.82111 -3.22092,-87.1088 5.31307,-20.94475 9.06296,-28.00552 81.87785,-154.17 38.54798,-66.79109 70.40461,-121.77997 70.79251,-122.19751 1.00535,-1.08215 140.3595,240.63696 145.26785,251.97682 8.6735,20.03855 12.6923,39.82747 12.6923,62.49805 0,44.25387 -16.70161,83.24077 -48.85852,114.0514 -21.46938,20.57055 -45.69209,33.39124 -76.46586,40.47213 -12.83139,2.95245 -42.64639,3.75165 -56.41742,1.51231 z"
|
||||
id="path2"
|
||||
sodipodi:nodetypes="ssssssssss"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.7 KiB |
47
cockatrice/resources/icons/mana/W.svg
Normal file
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
width="169.34801mm"
|
||||
height="169.34801mm"
|
||||
viewBox="0 0 600 600"
|
||||
version="1.1"
|
||||
id="svg1"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
inkscape:export-xdpi="96"
|
||||
inkscape:export-ydpi="96"
|
||||
sodipodi:docname="W.svg"
|
||||
inkscape:export-filename="W.png"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<defs
|
||||
id="defs1"/>
|
||||
<sodipodi:namedview
|
||||
id="namedview1"
|
||||
pagecolor="#505050"
|
||||
bordercolor="#eeeeee"
|
||||
borderopacity="1"
|
||||
inkscape:showpageshadow="0"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#505050"
|
||||
inkscape:document-units="mm">
|
||||
<inkscape:page
|
||||
x="0"
|
||||
y="0"
|
||||
width="600"
|
||||
height="600"
|
||||
id="page2"
|
||||
margin="0"
|
||||
bleed="0"/>
|
||||
</sodipodi:namedview>
|
||||
<path
|
||||
id="Selection"
|
||||
fill="none"
|
||||
stroke="#000000"
|
||||
stroke-width="1"
|
||||
d="m 275,0.21 c 0,0 42,0 42,0 0,0 19,1.51 19,1.51 29.13,3.58 56.99,10.83 84,22.43 33.64,14.45 59.89,32.91 86.91,57.41 17.38,15.76 34.67,37.56 47.14,57.44 22.78,36.31 37.1,74.56 43.22,117 1.28,8.88 2.72,19.08 2.73,28 0,0 0,34 0,34 0,0 -0.91,10 -0.91,10 -2.36,32.29 -11.93,67.59 -25.4,97 -27.01,58.98 -70.49,105.42 -126.69,137.57 -34.3,19.63 -79.56,33.64 -119,36.52 0,0 -12,0.91 -12,0.91 0,0 -34,0 -34,0 0,0 -10,-0.91 -10,-0.91 -26.57,-1.94 -53.09,-8.27 -78,-17.67 C 163.49,569.9 134.12,553.46 109,532.57 79.87,508.33 54.41,478.39 36.31,445 -5.08,368.65 -11.86,276.57 18.05,195 47.85,113.75 113.21,48.92 194,18.42 213.55,11.04 236.32,5.43 257,2.43 Z"
|
||||
style="display:inline;fill:#ffefb3;fill-opacity:1"/>
|
||||
<path
|
||||
id="circle8"
|
||||
d="M 387.28106,302.711 A 85.962512,85.962512 0 0 1 301.31852,388.67353 85.962512,85.962512 0 0 1 215.35597,302.711 85.962512,85.962512 0 0 1 301.31852,216.74844 85.962512,85.962512 0 0 1 387.28106,302.711 Z M 191.75349,358.6114 143.05798,460.97151 245.4181,412.27601 A 121.73882,121.73882 0 0 1 191.75349,358.6114 Z M 178.33753,302.711 c 0,-13.16763 2.23687,-25.83857 5.96271,-38.01232 L 77.71657,302.711 184.30024,340.7233 a 119.25435,119.25435 0 0 1 -5.96271,-38.0123 z m 178.8814,109.56501 102.36011,48.6955 -48.6955,-102.36011 a 121.73882,121.73882 0 0 1 -53.66461,53.66461 z m -55.90041,13.41595 c -13.16762,0 -26.0869,-2.23687 -38.01232,-5.9627 l 38.01232,106.58368 38.01231,-106.58368 a 119.25435,119.25435 0 0 1 -38.01231,5.9627 z m 109.56502,-178.88139 48.6955,-102.36012 -102.36011,48.69551 a 122.98106,122.98106 0 0 1 53.66461,53.66461 z M 245.66643,193.14596 143.30658,144.45045 192.00209,246.81057 a 121.73882,121.73882 0 0 1 53.66434,-53.66461 z M 524.92046,302.711 418.33679,264.69868 a 119.25435,119.25435 0 0 1 0,76.02462 z M 301.31852,179.73 c 13.16761,0 26.0869,2.23688 38.01231,5.96271 L 301.31852,79.109036 263.3062,185.69271 A 119.25435,119.25435 0 0 1 301.31852,179.73 Z"
|
||||
style="fill:#b4a35e;fill-opacity:1;stroke:#000000;stroke-width:1.09833;stroke-dasharray:none;stroke-opacity:1"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.3 KiB |
7
cockatrice/resources/icons/reload.svg
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
|
||||
viewBox="0 0 1000 1000" enable-background="new 0 0 1000 1000" xml:space="preserve">
|
||||
<metadata> Svg Vector Icons : http://www.onlinewebfonts.com/icon </metadata>
|
||||
<g><path d="M586.9,373.6l95.6-84.4c-49.6-39.2-129.4-79.1-198.2-79.1c-134.9,0-248.2,90.5-280.2,212.8L10.6,374.5C64.4,168.3,255.2,15.8,482.5,15.8c126.7,0,258.8,63.7,345.4,141.4l90.8-80.1L990,479.6L586.9,373.6z M317.5,710.8c49.6,39.2,129.4,79.1,198.2,79.1c134.9,0,248.2-90.5,280.2-212.8l193.5,48.5c-53.7,206.2-244.6,358.7-471.9,358.7c-126.7,0-258.8-63.7-345.4-141.4l-90.8,80.1L10,520.4l403.1,106L317.5,710.8z"/></g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 797 B |
10
cockatrice/resources/icons/rename.svg
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="1200pt" height="1200pt" version="1.1" viewBox="0 0 1200 1200" xmlns="http://www.w3.org/2000/svg">
|
||||
<path transform="scale(50)" d="m17 16h4v-8h-4" fill="none" stroke="#000" stroke-miterlimit="10" stroke-width="2"/>
|
||||
<path transform="scale(50)" d="m12 8h-9v8h9" fill="none" stroke="#000" stroke-miterlimit="10" stroke-width="2"/>
|
||||
<path transform="scale(50)" d="m6 12h5" fill="none" stroke="#000" stroke-miterlimit="10" stroke-width="2"/>
|
||||
<path transform="scale(50)" d="m20 4h-2c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h2" fill="none" stroke="#000"
|
||||
stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2"/>
|
||||
<path transform="scale(50)" d="m12 20h2c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2h-2" fill="none" stroke="#000"
|
||||
stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 875 B |
BIN
cockatrice/resources/tips/images/add_card.png
Normal file
|
After Width: | Height: | Size: 9.7 KiB |
BIN
cockatrice/resources/tips/images/card_select.png
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
cockatrice/resources/tips/images/edhrec.png
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
BIN
cockatrice/resources/tips/images/expand_card_view.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 227 KiB After Width: | Height: | Size: 70 KiB |
BIN
cockatrice/resources/tips/images/highlight_cards.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
cockatrice/resources/tips/images/pawns.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 39 KiB |
BIN
cockatrice/resources/tips/images/syntax_help.png
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
cockatrice/resources/tips/images/token.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
cockatrice/resources/tips/images/updates.png
Normal file
|
After Width: | Height: | Size: 6.0 KiB |
BIN
cockatrice/resources/tips/images/visual_deck_tags.png
Normal file
|
After Width: | Height: | Size: 136 KiB |
@@ -1,99 +1,222 @@
|
||||
<tips>
|
||||
<tip>
|
||||
<title>Tip of the Day</title>
|
||||
<text>Tip of the Day is a new feature to Cockatrice that allows users to get information about the newest features of the program and some of the most commonly asked questions!</text>
|
||||
<image>tip_of_the_day.png</image>
|
||||
<date>2018-03-01</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Suggesting New Tips</title>
|
||||
<text>You can suggest new Tips of the Day by reaching out to the development team on <a href="https://discord.gg/3Z9yzmA">Discord</a>!</text>
|
||||
<image>discord.png</image>
|
||||
<date>2023-10-18</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Reporting Bugs</title>
|
||||
<text>If you encounter a bug while using Cockatrice, you can report the bug to the development team via <a href="https://github.com/cockatrice/cockatrice/issues">GitHub<a></text>
|
||||
<image>github_logo.png</image>
|
||||
<date>2018-03-01</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>FAQ/Troubleshooting Wiki</title>
|
||||
<text>You can find answers to the most common questions and some helpful Cockatrice toubleshooting over on the <a href="https://github.com/cockatrice/cockatrice/wiki">GitHub wiki<a></text>
|
||||
<image>cockatrice_wiki.png</image>
|
||||
<date>2018-03-01</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Register for a Server</title>
|
||||
<text>Click on either Cockatrice (Windows) or Actions (Mac) and then Register to server... When the dialogue appears, fill out the desired server information.</text>
|
||||
<image>cockatrice_register.png</image>
|
||||
<date>2018-03-01</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Drawing Arrows</title>
|
||||
<text>You can draw arrows of different color by holding a combination of keys!
|
||||
Right Click: Red Arrow
|
||||
Shift + Right Click: Green Arrow
|
||||
Alt + Right Click: Blue Arrow
|
||||
Cmd + Right Click: Yellow Arrow
|
||||
</text>
|
||||
<image>arrows.png</image>
|
||||
<date>2018-03-01</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Filtering Games</title>
|
||||
<text>Don't see all the active games? Want to see a smaller selection? Use the Game Filters to change your horizon</text>
|
||||
<image>filter_games.png</image>
|
||||
<date>2018-03-01</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Upload Custom Avatar</title>
|
||||
<text>Want to show off your hippo avatar? Need to update your password? Check out the Accounts Tab for more info!</text>
|
||||
<image>accounts_tab.png</image>
|
||||
<date>2018-03-01</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Common Shortcuts</title>
|
||||
<text>You can find a full list of shortcuts <a href="https://github.com/Cockatrice/Cockatrice/wiki/Custom-Keyboard-Shortcuts">on the wiki</a>, but a short list:
|
||||
<br>Roll a die: CTRL + I
|
||||
<br>Mulligan: CTRL + M
|
||||
<br>Draw a card: CTRL + D
|
||||
<br>Undo a draw: CTRL + SHIFT + D
|
||||
<br>View Sideboard: CTRL + F3
|
||||
<br>Change Life: CTRL + L
|
||||
<br>All shortcuts can be customized via Settings->Shortcuts!
|
||||
</text>
|
||||
<image>shortcuts.png</image>
|
||||
<date>2018-03-01</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Changing Themes</title>
|
||||
<text>Did you know Cockatrice has custom themes? You can either <a href="https://github.com/Cockatrice/Cockatrice/wiki/Themes">create one yourself</a> or use one of the several pre-loaded ones! Go to Settings->Appearance and try them out!</text>
|
||||
<image>themes.png</image>
|
||||
<date>2018-03-01</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Flip of the Coin</title>
|
||||
<text>You can flip a coin instead of rolling a die by rolling a 2 sided die instead!</text>
|
||||
<image>coin_flip.png</image>
|
||||
<date>2018-03-01</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Face Down Cards</title>
|
||||
<text>You can hold Shift while dragging or clicking on a card to have it enter play face down</text>
|
||||
<image>face_down.png</image>
|
||||
<date>2018-03-01</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Counter expressions</title>
|
||||
<text>When setting a counter value, you can type a math expression in the box and the counter will be set to the result.<br>The "x" variable contains the current counter value.</text>
|
||||
<image>counter_expression.png</image>
|
||||
<date>2019-02-02</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Power and Toughness</title>
|
||||
<text>You can add and subtract to a creature's stats.<br>With a card selected, set the power and toughness ( default: ctrl + p ) and enter +3/-1 to increase power by three while decreasing toughness by one.<br>You can also reset it to the original value ( default: ctrl + alt + 0 ).</text>
|
||||
<image>setpt.png</image>
|
||||
<date>2019-03-02</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Tip of the Day</title>
|
||||
<text>Tip of the Day is a feature to Cockatrice that allows users to get information about the newest features of the program and some of the most commonly asked questions!
|
||||
Check back in with major updates for new tips to be added or old tips to be updated as features are added or expanded upon!
|
||||
</text>
|
||||
<image>tip_of_the_day.png</image>
|
||||
<date>2025-02-10</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Join the Community</title>
|
||||
<text>You can join the community to find games, interact with other players, suggest new 'Tips of the Day' and provide user feedback to the development or support teams on <a href="https://discord.gg/3Z9yzmA">Discord</a>!</text>
|
||||
<image>discord.png</image>
|
||||
<date>2025-02-09</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Reporting Bugs and Requesting Features</title>
|
||||
<text>If you encounter a bug while using Cockatrice, you can report the bug to and request the feature from the development team via <a href="https://github.com/cockatrice/cockatrice/issues">GitHub<a></text>
|
||||
<image>github_logo.png</image>
|
||||
<date>2025-02-09</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>FAQ/Troubleshooting Wiki</title>
|
||||
<text>You can find answers to the most common questions and some helpful Cockatrice troubleshooting over on the <a href="https://github.com/cockatrice/cockatrice/wiki">GitHub wiki<a></text>
|
||||
<image>cockatrice_wiki.png</image>
|
||||
<date>2018-03-01</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Register for a Server</title>
|
||||
<text>Click on either Cockatrice (Windows) or Actions (Mac) and then Register to server... When the dialogue appears, fill out the desired server information.</text>
|
||||
<image>cockatrice_register.png</image>
|
||||
<date>2018-03-01</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Filtering Games</title>
|
||||
<text>Don't see an open game or want to see a smaller selection? Use the Game Filters to change your horizon!</text>
|
||||
<image>filter_games.png</image>
|
||||
<date>2025-02-09</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Common Shortcuts</title>
|
||||
<text>You can find a full list of default shortcuts <a href="https://github.com/Cockatrice/Cockatrice/wiki/Custom-Keyboard-Shortcuts">on the wiki</a> or in Settings -> Shortcuts, but a short list:
|
||||
<ul>
|
||||
<li>Roll a die: CMD/CTRL + I</li>
|
||||
<li>Mulligan: CMD/CTRL + M</li>
|
||||
<li>Draw 1 / X card(s): CMD/CTRL + D / E</li>
|
||||
<li>Undo a draw: CMD/CTRL + SHIFT + D</li>
|
||||
<li>View Library / Sideboard: F3 / CMD/CTRL + F3</li>
|
||||
<li>Change Life: CMD/CTRL + L</li>
|
||||
<li>Show Card Info: Middle Mouse Click</li>
|
||||
</ul>
|
||||
All shortcuts can be customized via Cockatrice -> Settings -> Shortcuts!
|
||||
</text>
|
||||
<image>shortcuts.png</image>
|
||||
<date>2025-02-09</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Power and Toughness</title>
|
||||
<text>You can add and subtract to a creature's stats.
|
||||
With a card selected, with the following keybindings:
|
||||
|
||||
<ul>
|
||||
<li>Set P/T to any value: CTRL + P</li>
|
||||
<li>+1 or -1 to both to P/T: CMD/CTRL + ALT + '+' or '-'</li>
|
||||
<li>+1 or -1 to Power Only: CMD/CTRL + '+' or '-'</li>
|
||||
<li>+1 or -1 to Toughness Only: ALT + '+' or '-'</li>
|
||||
<li>Set P/T to Default: CMD/CTRL + ALT + 0</li>
|
||||
</ul>
|
||||
All shortcuts can be customized via Cockatrice -> Settings -> Shortcuts!
|
||||
</text>
|
||||
<image>setpt.png</image>
|
||||
<date>2025-02-09</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Drawing Arrows</title>
|
||||
<text>You can draw arrows of different color by holding a combination of keys!
|
||||
|
||||
<ul>
|
||||
<li>Right Click: Red Arrow</li>
|
||||
<li>SHIFT + Right Click: Green Arrow</li>
|
||||
<li>ALT + Right Click: Blue Arrow</li>
|
||||
<li>CMD/CTRL + Right Click: Yellow Arrow</li>
|
||||
</ul>
|
||||
</text>
|
||||
<image>arrows.png</image>
|
||||
<date>2018-03-01</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>General Etiquette</title>
|
||||
<text>When playing on Cockatrice there are general "rules of engagement" for a better play experience for all players.
|
||||
The following are some of the expectations a player should reasonably expect for how to operate smooth and enjoyable games:
|
||||
<ul>
|
||||
<li>Have a "Rule 0" conversation pre-game with your fellow players on the expectations of the game including deck strength, house rules (e.g. no take backs and "may is not must"), etc.</li>
|
||||
<li>When rolling your die for turn order, it is often best to create a token with the text of your roll (using CTRL + T and typing the number into "Name") and then tap this token when created to show that you have resolved your mulligans and are ready to start the game.</li>
|
||||
<li>Use the phases and steps trackers on the left of the client to show others where in the turn you are and announce when moving between them. (Double Click for the action of this button)</li>
|
||||
<li>When your turn is over leave it on your end step and DO NOT HIT PASS. Allow other players to respond if they can, and then if not, let the next player pass to themselves.</li>
|
||||
<li>Please treat others kindly and respect as per <a href="https://cockatrice.us/terms.php">our Terms of Service</a>.</li>
|
||||
</ul>
|
||||
</text>
|
||||
<image>token.png</image>
|
||||
<date>2025-02-10</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Flip of the Coin</title>
|
||||
<text>You can flip a coin instead of rolling a die by rolling a 2 sided die instead!</text>
|
||||
<image>coin_flip.png</image>
|
||||
<date>2018-03-01</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Upload Custom Avatar</title>
|
||||
<text>Want to show off your hippo avatar? Need to update your password? Check out the Accounts Tab for more info!</text>
|
||||
<image>accounts_tab.png</image>
|
||||
<date>2018-03-01</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Player Icon Key</title>
|
||||
<text>Besides your name is a player icon, this is a key for what they mean:
|
||||
<ul>
|
||||
<li>Flag: Country of Origin Player Selected</li>
|
||||
<li>Purple Heart: Donator (<a href="https://cockatrice.us/donate">Help support us and donate here!</a>)</li>
|
||||
<li>Gold Star: VIP (Special Admin Given Role)</li>
|
||||
<li>Brown Gavel (Hammer): Judge / Rule's Lawyer</li>
|
||||
<li>Black/White Pawn: Moderator (Support for Client Issues)</li>
|
||||
<li>Red: Administrator (Sever Operators)</li>
|
||||
</ul>
|
||||
</text>
|
||||
<image>pawns.png</image>
|
||||
<date>2025-02-09</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Changing Themes</title>
|
||||
<text>Did you know Cockatrice has custom themes? You can either <a href="https://github.com/Cockatrice/Cockatrice/wiki/Themes">create one yourself</a> or use one of the several preloaded ones! Go to Settings->Appearance and try them out!</text>
|
||||
<image>themes.png</image>
|
||||
<date>2018-03-01</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Face Down Cards</title>
|
||||
<text>You can hold Shift while dragging or clicking on a card to have it enter play face down.
|
||||
You can also hold CTRL + SHIFT and click and drag from your library to move bottom card face down as well!
|
||||
</text>
|
||||
<image>face_down.png</image>
|
||||
<date>2025-02-09</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Counter expressions</title>
|
||||
<text>When setting a counter value, you can type a math expression in the box and the counter will be set to the result.<br>The "x" variable contains the current counter value.</text>
|
||||
<image>counter_expression.png</image>
|
||||
<date>2019-02-02</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Select Multiple Cards</title>
|
||||
<text>You can click and drag in any zone in order to highlight all cards within the created box.
|
||||
You can also hold CMD/CTRL and clik or click and drag to maintain other previously selected cards while adding others!
|
||||
You can move, alter and attach multiple highlighted cards at the same time!
|
||||
Other useful multi-select keybindings:
|
||||
<ul>
|
||||
<li>Select All Cards in Zone: CMD/CTRL + A</li>
|
||||
<li>Select All Cards in Column: CMD/CTRL + SHIFT + C</li>
|
||||
<li>Select All Cards in Row: CMD/CTRL + SHIFT + X</li>
|
||||
</ul>
|
||||
</text>
|
||||
<image>highlight_cards.png</image>
|
||||
<date>2025-02-09</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Auto Cascade and Search Parameters</title>
|
||||
<text>You can use the default keybind of CMD/CTRL + SHIFT + Y in order to perform auto cascade or similar effects from your library using Scryfall search syntax.
|
||||
If you are unfamiliar with the syntax you may find it by opening a deck in deck editor and clicking the "i" next to the search bar in order to pull up a list of syntax commands.
|
||||
This same syntax can be used in the deck editor search bar as well to help you find the best cards for your decks!
|
||||
</text>
|
||||
<image>syntax_help.png</image>
|
||||
<date>2025-02-09</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Visual Deck Storage and Tags</title>
|
||||
<text>You can now view your saved decks visually with integrated folder,tags and filter support!
|
||||
Pro Tip: If you want to use emoji's press WinKey + '.' or CTRL + CMD + SPACE on Windows or Mac respectively!
|
||||
</text>
|
||||
<image>visual_deck_tags.png</image>
|
||||
<date>2025-02-09</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Card Selector And Card Preferences</title>
|
||||
<text>Cockatrice's deck editor now has the ability for players to bling out their decks by selecting the arts for cards on a per-card basis!
|
||||
You can also have multiple printings of the same card in your deck if you so choose!
|
||||
Not only that, other players will see the arts you have chosen by default!
|
||||
If you want to disable this feature for other players: Settings -> Appearance -> Select "Override all card art with personal set preference"
|
||||
</text>
|
||||
<image>card_select.png</image>
|
||||
<date>2025-02-10</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>EDHREC Integration</title>
|
||||
<text>We now have in-client integration for EDHREC, which allows you to right-click on any card name in the deck editor in order to bring up the contextual menu for the card.</text>
|
||||
<image>edhrec.png</image>
|
||||
<date>2025-02-10</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Add Cards to Deck</title>
|
||||
<text>You can now right-click anywhere on a card in any card info view in order to add it to any decks you have open in your tabs.</text>
|
||||
<image>add_card.png</image>
|
||||
<date>2025-02-10</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Update Client and Card Database</title>
|
||||
<text>You can update your client by going to Help and selecting whichever you wish to update.
|
||||
Client Update: Updates the client (if available) for new features, fixes and changes.
|
||||
Card Update: Updates card sources for spoilers and new card printings.
|
||||
Updating your card sources can often fix issues of cards not working or displaying properly, if not, go to Cockatrice -> Settings -> Card Sources -> Update Spoilers
|
||||
</text>
|
||||
<image>updates.png</image>
|
||||
<date>2025-02-10</date>
|
||||
</tip>
|
||||
<tip>
|
||||
<title>Expand Card View Window</title>
|
||||
<text>Double click on the title bar of the card view window to expand it! Double click again to shrink it back down.
|
||||
You can configure the initial and expanded heights of the window in the settings, under "Appearance".
|
||||
</text>
|
||||
<image>expand_card_view.png</image>
|
||||
<date>2025-02-27</date>
|
||||
</tip>
|
||||
</tips>
|
||||
|
||||
204
cockatrice/src/client/menus/deck_editor/deck_editor_menu.cpp
Normal file
@@ -0,0 +1,204 @@
|
||||
#include "deck_editor_menu.h"
|
||||
|
||||
#include "../../../settings/cache_settings.h"
|
||||
#include "../../../settings/shortcuts_settings.h"
|
||||
|
||||
DeckEditorMenu::DeckEditorMenu(AbstractTabDeckEditor *parent) : QMenu(parent), deckEditor(parent)
|
||||
{
|
||||
aNewDeck = new QAction(QString(), this);
|
||||
connect(aNewDeck, &QAction::triggered, deckEditor, &AbstractTabDeckEditor::actNewDeck);
|
||||
|
||||
aLoadDeck = new QAction(QString(), this);
|
||||
connect(aLoadDeck, &QAction::triggered, deckEditor, &AbstractTabDeckEditor::actLoadDeck);
|
||||
|
||||
loadRecentDeckMenu = new QMenu(this);
|
||||
connect(&SettingsCache::instance().recents(), &RecentsSettings::recentlyOpenedDeckPathsChanged, this,
|
||||
&DeckEditorMenu::updateRecentlyOpened);
|
||||
|
||||
aClearRecents = new QAction(QString(), this);
|
||||
connect(aClearRecents, &QAction::triggered, this, &DeckEditorMenu::actClearRecents);
|
||||
|
||||
updateRecentlyOpened();
|
||||
|
||||
aSaveDeck = new QAction(QString(), this);
|
||||
connect(aSaveDeck, &QAction::triggered, deckEditor, &AbstractTabDeckEditor::actSaveDeck);
|
||||
|
||||
aSaveDeckAs = new QAction(QString(), this);
|
||||
connect(aSaveDeckAs, &QAction::triggered, deckEditor, &AbstractTabDeckEditor::actSaveDeckAs);
|
||||
|
||||
aLoadDeckFromClipboard = new QAction(QString(), this);
|
||||
connect(aLoadDeckFromClipboard, &QAction::triggered, deckEditor, &AbstractTabDeckEditor::actLoadDeckFromClipboard);
|
||||
|
||||
aEditDeckInClipboard = new QAction(QString(), this);
|
||||
connect(aEditDeckInClipboard, &QAction::triggered, deckEditor, &AbstractTabDeckEditor::actEditDeckInClipboard);
|
||||
|
||||
aEditDeckInClipboardRaw = new QAction(QString(), this);
|
||||
connect(aEditDeckInClipboardRaw, &QAction::triggered, deckEditor,
|
||||
&AbstractTabDeckEditor::actEditDeckInClipboardRaw);
|
||||
|
||||
aSaveDeckToClipboard = new QAction(QString(), this);
|
||||
connect(aSaveDeckToClipboard, &QAction::triggered, deckEditor, &AbstractTabDeckEditor::actSaveDeckToClipboard);
|
||||
|
||||
aSaveDeckToClipboardNoSetInfo = new QAction(QString(), this);
|
||||
connect(aSaveDeckToClipboardNoSetInfo, &QAction::triggered, deckEditor,
|
||||
&AbstractTabDeckEditor::actSaveDeckToClipboardNoSetInfo);
|
||||
|
||||
aSaveDeckToClipboardRaw = new QAction(QString(), this);
|
||||
connect(aSaveDeckToClipboardRaw, &QAction::triggered, deckEditor,
|
||||
&AbstractTabDeckEditor::actSaveDeckToClipboardRaw);
|
||||
|
||||
aSaveDeckToClipboardRawNoSetInfo = new QAction(QString(), this);
|
||||
connect(aSaveDeckToClipboardRawNoSetInfo, &QAction::triggered, deckEditor,
|
||||
&AbstractTabDeckEditor::actSaveDeckToClipboardRawNoSetInfo);
|
||||
|
||||
aPrintDeck = new QAction(QString(), this);
|
||||
connect(aPrintDeck, &QAction::triggered, deckEditor, &AbstractTabDeckEditor::actPrintDeck);
|
||||
|
||||
aExportDeckDecklist = new QAction(QString(), this);
|
||||
connect(aExportDeckDecklist, &QAction::triggered, deckEditor, &AbstractTabDeckEditor::actExportDeckDecklist);
|
||||
|
||||
aExportDeckDecklistXyz = new QAction(QString(), this);
|
||||
connect(aExportDeckDecklistXyz, &QAction::triggered, deckEditor, &AbstractTabDeckEditor::actExportDeckDecklistXyz);
|
||||
|
||||
aAnalyzeDeckDeckstats = new QAction(QString(), this);
|
||||
connect(aAnalyzeDeckDeckstats, &QAction::triggered, deckEditor, &AbstractTabDeckEditor::actAnalyzeDeckDeckstats);
|
||||
|
||||
aAnalyzeDeckTappedout = new QAction(QString(), this);
|
||||
connect(aAnalyzeDeckTappedout, &QAction::triggered, deckEditor, &AbstractTabDeckEditor::actAnalyzeDeckTappedout);
|
||||
|
||||
analyzeDeckMenu = new QMenu(this);
|
||||
analyzeDeckMenu->addAction(aExportDeckDecklist);
|
||||
analyzeDeckMenu->addAction(aExportDeckDecklistXyz);
|
||||
analyzeDeckMenu->addSeparator();
|
||||
analyzeDeckMenu->addAction(aAnalyzeDeckDeckstats);
|
||||
analyzeDeckMenu->addAction(aAnalyzeDeckTappedout);
|
||||
|
||||
aClose = new QAction(QString(), this);
|
||||
connect(aClose, &QAction::triggered, deckEditor, &AbstractTabDeckEditor::closeRequest);
|
||||
|
||||
editDeckInClipboardMenu = new QMenu(this);
|
||||
editDeckInClipboardMenu->addAction(aEditDeckInClipboard);
|
||||
editDeckInClipboardMenu->addAction(aEditDeckInClipboardRaw);
|
||||
|
||||
saveDeckToClipboardMenu = new QMenu(this);
|
||||
saveDeckToClipboardMenu->addAction(aSaveDeckToClipboard);
|
||||
saveDeckToClipboardMenu->addAction(aSaveDeckToClipboardNoSetInfo);
|
||||
saveDeckToClipboardMenu->addAction(aSaveDeckToClipboardRaw);
|
||||
saveDeckToClipboardMenu->addAction(aSaveDeckToClipboardRawNoSetInfo);
|
||||
|
||||
addAction(aNewDeck);
|
||||
addAction(aLoadDeck);
|
||||
addMenu(loadRecentDeckMenu);
|
||||
addAction(aSaveDeck);
|
||||
addAction(aSaveDeckAs);
|
||||
addSeparator();
|
||||
addAction(aLoadDeckFromClipboard);
|
||||
addMenu(editDeckInClipboardMenu);
|
||||
addMenu(saveDeckToClipboardMenu);
|
||||
addSeparator();
|
||||
addAction(aPrintDeck);
|
||||
addMenu(analyzeDeckMenu);
|
||||
addSeparator();
|
||||
addAction(deckEditor->filterDockWidget->aClearFilterOne);
|
||||
addAction(deckEditor->filterDockWidget->aClearFilterAll);
|
||||
addSeparator();
|
||||
addAction(aClose);
|
||||
|
||||
retranslateUi();
|
||||
connect(&SettingsCache::instance().shortcuts(), &ShortcutsSettings::shortCutChanged, this,
|
||||
&DeckEditorMenu::refreshShortcuts);
|
||||
refreshShortcuts();
|
||||
}
|
||||
|
||||
void DeckEditorMenu::setSaveStatus(bool newStatus)
|
||||
{
|
||||
aSaveDeck->setEnabled(newStatus);
|
||||
aSaveDeckAs->setEnabled(newStatus);
|
||||
aSaveDeckToClipboard->setEnabled(newStatus);
|
||||
aSaveDeckToClipboardNoSetInfo->setEnabled(newStatus);
|
||||
aSaveDeckToClipboardRaw->setEnabled(newStatus);
|
||||
aSaveDeckToClipboardRawNoSetInfo->setEnabled(newStatus);
|
||||
saveDeckToClipboardMenu->setEnabled(newStatus);
|
||||
aPrintDeck->setEnabled(newStatus);
|
||||
analyzeDeckMenu->setEnabled(newStatus);
|
||||
}
|
||||
|
||||
void DeckEditorMenu::updateRecentlyOpened()
|
||||
{
|
||||
loadRecentDeckMenu->clear();
|
||||
for (const auto &deckPath : SettingsCache::instance().recents().getRecentlyOpenedDeckPaths()) {
|
||||
QAction *aRecentlyOpenedDeck = new QAction(deckPath, this);
|
||||
loadRecentDeckMenu->addAction(aRecentlyOpenedDeck);
|
||||
connect(aRecentlyOpenedDeck, &QAction::triggered, deckEditor,
|
||||
[=, this] { deckEditor->actOpenRecent(aRecentlyOpenedDeck->text()); });
|
||||
}
|
||||
loadRecentDeckMenu->addSeparator();
|
||||
loadRecentDeckMenu->addAction(aClearRecents);
|
||||
aClearRecents->setEnabled(SettingsCache::instance().recents().getRecentlyOpenedDeckPaths().length() > 0);
|
||||
}
|
||||
|
||||
void DeckEditorMenu::actClearRecents()
|
||||
{
|
||||
SettingsCache::instance().recents().clearRecentlyOpenedDeckPaths();
|
||||
}
|
||||
|
||||
void DeckEditorMenu::retranslateUi()
|
||||
{
|
||||
setTitle(tr("&Deck Editor"));
|
||||
aNewDeck->setText(tr("&New deck"));
|
||||
aLoadDeck->setText(tr("&Load deck..."));
|
||||
loadRecentDeckMenu->setTitle(tr("Load recent deck..."));
|
||||
aClearRecents->setText(tr("Clear"));
|
||||
aSaveDeck->setText(tr("&Save deck"));
|
||||
aSaveDeckAs->setText(tr("Save deck &as..."));
|
||||
|
||||
aLoadDeckFromClipboard->setText(tr("Load deck from cl&ipboard..."));
|
||||
|
||||
editDeckInClipboardMenu->setTitle(tr("Edit deck in clipboard"));
|
||||
aEditDeckInClipboard->setText(tr("Annotated"));
|
||||
aEditDeckInClipboardRaw->setText(tr("Not Annotated"));
|
||||
|
||||
saveDeckToClipboardMenu->setTitle(tr("Save deck to clipboard"));
|
||||
aSaveDeckToClipboard->setText(tr("Annotated"));
|
||||
aSaveDeckToClipboardNoSetInfo->setText(tr("Annotated (No set info)"));
|
||||
aSaveDeckToClipboardRaw->setText(tr("Not Annotated"));
|
||||
aSaveDeckToClipboardRawNoSetInfo->setText(tr("Not Annotated (No set info)"));
|
||||
|
||||
aPrintDeck->setText(tr("&Print deck..."));
|
||||
|
||||
analyzeDeckMenu->setTitle(tr("&Send deck to online service"));
|
||||
aExportDeckDecklist->setText(tr("Create decklist (decklist.org)"));
|
||||
aExportDeckDecklistXyz->setText(tr("Create decklist (decklist.xyz)"));
|
||||
aAnalyzeDeckDeckstats->setText(tr("Analyze deck (deckstats.net)"));
|
||||
aAnalyzeDeckTappedout->setText(tr("Analyze deck (tappedout.net)"));
|
||||
|
||||
aClose->setText(tr("&Close"));
|
||||
}
|
||||
|
||||
void DeckEditorMenu::refreshShortcuts()
|
||||
{
|
||||
ShortcutsSettings &shortcuts = SettingsCache::instance().shortcuts();
|
||||
aNewDeck->setShortcuts(shortcuts.getShortcut("TabDeckEditor/aNewDeck"));
|
||||
aLoadDeck->setShortcuts(shortcuts.getShortcut("TabDeckEditor/aLoadDeck"));
|
||||
aSaveDeck->setShortcuts(shortcuts.getShortcut("TabDeckEditor/aSaveDeck"));
|
||||
aSaveDeckAs->setShortcuts(shortcuts.getShortcut("TabDeckEditor/aSaveDeckAs"));
|
||||
aLoadDeckFromClipboard->setShortcuts(shortcuts.getShortcut("TabDeckEditor/aLoadDeckFromClipboard"));
|
||||
aEditDeckInClipboard->setShortcuts(shortcuts.getShortcut("TabDeckEditor/aEditDeckInClipboard"));
|
||||
aEditDeckInClipboardRaw->setShortcuts(shortcuts.getShortcut("TabDeckEditor/aEditDeckInClipboardRaw"));
|
||||
aPrintDeck->setShortcuts(shortcuts.getShortcut("TabDeckEditor/aPrintDeck"));
|
||||
|
||||
aExportDeckDecklist->setShortcuts(shortcuts.getShortcut("TabDeckEditor/aExportDeckDecklist"));
|
||||
aExportDeckDecklistXyz->setShortcuts(shortcuts.getShortcut("TabDeckEditor/aExportDeckDecklistXyz"));
|
||||
aAnalyzeDeckDeckstats->setShortcuts(shortcuts.getShortcut("TabDeckEditor/aAnalyzeDeck"));
|
||||
aAnalyzeDeckTappedout->setShortcuts(shortcuts.getShortcut("TabDeckEditor/aAnalyzeDeckTappedout"));
|
||||
|
||||
aClose->setShortcuts(shortcuts.getShortcut("TabDeckEditor/aClose"));
|
||||
|
||||
aSaveDeckToClipboard->setShortcuts(shortcuts.getShortcut("TabDeckEditor/aSaveDeckToClipboard"));
|
||||
aSaveDeckToClipboardNoSetInfo->setShortcuts(shortcuts.getShortcut("TabDeckEditor/aSaveDeckToClipboardNoSetInfo"));
|
||||
aSaveDeckToClipboardRaw->setShortcuts(shortcuts.getShortcut("TabDeckEditor/aSaveDeckToClipboardRaw"));
|
||||
aSaveDeckToClipboardRawNoSetInfo->setShortcuts(
|
||||
shortcuts.getShortcut("TabDeckEditor/aSaveDeckToClipboardRawNoSetInfo"));
|
||||
|
||||
aClose->setShortcuts(shortcuts.getShortcut("TabDeckEditor/aClose"));
|
||||
}
|
||||
32
cockatrice/src/client/menus/deck_editor/deck_editor_menu.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef DECK_EDITOR_MENU_H
|
||||
#define DECK_EDITOR_MENU_H
|
||||
|
||||
#include "../../tabs/abstract_tab_deck_editor.h"
|
||||
|
||||
#include <QMenu>
|
||||
|
||||
class AbstractTabDeckEditor;
|
||||
class DeckEditorMenu : public QMenu
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DeckEditorMenu(AbstractTabDeckEditor *parent);
|
||||
|
||||
AbstractTabDeckEditor *deckEditor;
|
||||
|
||||
QAction *aNewDeck, *aLoadDeck, *aClearRecents, *aSaveDeck, *aSaveDeckAs, *aLoadDeckFromClipboard,
|
||||
*aEditDeckInClipboard, *aEditDeckInClipboardRaw, *aSaveDeckToClipboard, *aSaveDeckToClipboardNoSetInfo,
|
||||
*aSaveDeckToClipboardRaw, *aSaveDeckToClipboardRawNoSetInfo, *aPrintDeck, *aExportDeckDecklist,
|
||||
*aExportDeckDecklistXyz, *aAnalyzeDeckDeckstats, *aAnalyzeDeckTappedout, *aClose;
|
||||
QMenu *loadRecentDeckMenu, *analyzeDeckMenu, *editDeckInClipboardMenu, *saveDeckToClipboardMenu;
|
||||
|
||||
void setSaveStatus(bool newStatus);
|
||||
|
||||
public slots:
|
||||
void updateRecentlyOpened();
|
||||
void actClearRecents();
|
||||
void retranslateUi();
|
||||
void refreshShortcuts();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -11,6 +11,11 @@
|
||||
#include <QSysInfo>
|
||||
#include <QtGlobal>
|
||||
|
||||
#if defined(Q_OS_MACOS)
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#define STABLERELEASE_URL "https://api.github.com/repos/Cockatrice/Cockatrice/releases/latest"
|
||||
#define STABLEMANUALDOWNLOAD_URL "https://github.com/Cockatrice/Cockatrice/releases/latest"
|
||||
#define STABLETAG_URL "https://api.github.com/repos/Cockatrice/Cockatrice/git/refs/tags/"
|
||||
@@ -33,31 +38,42 @@ ReleaseChannel::~ReleaseChannel()
|
||||
void ReleaseChannel::checkForUpdates()
|
||||
{
|
||||
QString releaseChannelUrl = getReleaseChannelUrl();
|
||||
qCDebug(ReleaseChannelLog) << "Searching for updates on the channel: " << releaseChannelUrl;
|
||||
qCInfo(ReleaseChannelLog) << "Searching for updates on the channel: " << releaseChannelUrl;
|
||||
response = netMan->get(QNetworkRequest(releaseChannelUrl));
|
||||
connect(response, &QNetworkReply::finished, this, &ReleaseChannel::releaseListFinished);
|
||||
}
|
||||
|
||||
// Different release channel checking functions for different operating systems
|
||||
#if defined(Q_OS_MACOS)
|
||||
bool ReleaseChannel::downloadMatchesCurrentOS(const QString &fileName)
|
||||
{
|
||||
static QRegularExpression version_regex("macOS-(\\d+)\\.(\\d+)");
|
||||
#if defined(Q_OS_MACOS)
|
||||
static QRegularExpression version_regex("macOS(\\d+)");
|
||||
auto match = version_regex.match(fileName);
|
||||
if (!match.hasMatch()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto getSystemVersion = [] {
|
||||
// QSysInfo does not go through translation layers
|
||||
// We need to use sysctl to reliably detect the underlying architecture
|
||||
char arch[255];
|
||||
size_t len = sizeof(arch);
|
||||
if (sysctlbyname("machdep.cpu.brand_string", arch, &len, nullptr, 0) == 0) {
|
||||
// Intel mac is only supported on macOS 13 versions
|
||||
if (QString::fromUtf8(arch).contains("Intel")) {
|
||||
return 13;
|
||||
}
|
||||
}
|
||||
|
||||
return QSysInfo::productVersion().split(".")[0].toInt();
|
||||
};
|
||||
|
||||
// older(smaller) releases are compatible with a newer or the same system version
|
||||
int sys_maj = QSysInfo::productVersion().split(".")[0].toInt();
|
||||
int sys_min = QSysInfo::productVersion().split(".")[1].toInt();
|
||||
int sys_maj = getSystemVersion();
|
||||
int rel_maj = match.captured(1).toInt();
|
||||
int rel_min = match.captured(2).toInt();
|
||||
return rel_maj < sys_maj || (rel_maj == sys_maj && rel_min <= sys_min);
|
||||
}
|
||||
return rel_maj == sys_maj;
|
||||
|
||||
#elif defined(Q_OS_WIN)
|
||||
bool ReleaseChannel::downloadMatchesCurrentOS(const QString &fileName)
|
||||
{
|
||||
#if Q_PROCESSOR_WORDSIZE == 4
|
||||
return fileName.contains("32bit");
|
||||
#elif Q_PROCESSOR_WORDSIZE == 8
|
||||
@@ -68,16 +84,15 @@ bool ReleaseChannel::downloadMatchesCurrentOS(const QString &fileName)
|
||||
return fileName.contains("Win10");
|
||||
}
|
||||
#else
|
||||
Q_UNUSED(fileName);
|
||||
return false;
|
||||
#endif
|
||||
|
||||
#else // If the OS doesn't fit one of the above #defines, then it will never match
|
||||
Q_UNUSED(fileName);
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
bool ReleaseChannel::downloadMatchesCurrentOS(const QString &)
|
||||
{
|
||||
// If the OS doesn't fit one of the above #defines, then it will never match
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
QString StableReleaseChannel::getManualDownloadUrl() const
|
||||
{
|
||||
@@ -101,7 +116,7 @@ void StableReleaseChannel::releaseListFinished()
|
||||
QJsonDocument jsonResponse = QJsonDocument::fromJson(reply->readAll(), &parseError);
|
||||
reply->deleteLater();
|
||||
if (parseError.error != QJsonParseError::NoError) {
|
||||
qWarning() << "No reply received from the release update server.";
|
||||
qCWarning(ReleaseChannelLog) << "No reply received from the release update server.";
|
||||
emit error(tr("No reply received from the release update server."));
|
||||
return;
|
||||
}
|
||||
@@ -109,7 +124,7 @@ void StableReleaseChannel::releaseListFinished()
|
||||
QVariantMap resultMap = jsonResponse.toVariant().toMap();
|
||||
if (!(resultMap.contains("name") && resultMap.contains("html_url") && resultMap.contains("tag_name") &&
|
||||
resultMap.contains("published_at"))) {
|
||||
qWarning() << "Invalid received from the release update server:" << resultMap;
|
||||
qCWarning(ReleaseChannelLog) << "Invalid received from the release update server:" << resultMap;
|
||||
emit error(tr("Invalid reply received from the release update server."));
|
||||
return;
|
||||
}
|
||||
@@ -123,37 +138,29 @@ void StableReleaseChannel::releaseListFinished()
|
||||
|
||||
if (resultMap.contains("assets")) {
|
||||
auto rawAssets = resultMap["assets"].toList();
|
||||
// [(name, url)]
|
||||
QVector<std::pair<QString, QString>> assets;
|
||||
std::transform(rawAssets.begin(), rawAssets.end(), std::back_inserter(assets), [](QVariant _asset) {
|
||||
QVariantMap asset = _asset.toMap();
|
||||
for (const auto &rawAsset : rawAssets) {
|
||||
QVariantMap asset = rawAsset.toMap();
|
||||
QString name = asset["name"].toString();
|
||||
QString url = asset["browser_download_url"].toString();
|
||||
return std::make_pair(name, url);
|
||||
});
|
||||
|
||||
auto _releaseAsset = std::find_if(assets.begin(), assets.end(), [](std::pair<QString, QString> nameAndUrl) {
|
||||
return downloadMatchesCurrentOS(nameAndUrl.first);
|
||||
});
|
||||
|
||||
if (_releaseAsset != assets.end()) {
|
||||
std::pair<QString, QString> releaseAsset = *_releaseAsset;
|
||||
auto releaseUrl = releaseAsset.second;
|
||||
lastRelease->setDownloadUrl(releaseUrl);
|
||||
if (downloadMatchesCurrentOS(name)) {
|
||||
lastRelease->setDownloadUrl(url);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QString shortHash = lastRelease->getCommitHash().left(GIT_SHORT_HASH_LEN);
|
||||
QString myHash = QString(VERSION_COMMIT);
|
||||
qCDebug(ReleaseChannelLog) << "Current hash=" << myHash << "update hash=" << shortHash;
|
||||
qCInfo(ReleaseChannelLog) << "Current hash=" << myHash << "update hash=" << shortHash;
|
||||
|
||||
qCDebug(ReleaseChannelLog) << "Got reply from release server, name=" << lastRelease->getName()
|
||||
<< "desc=" << lastRelease->getDescriptionUrl()
|
||||
<< "date=" << lastRelease->getPublishDate() << "url=" << lastRelease->getDownloadUrl();
|
||||
qCInfo(ReleaseChannelLog) << "Got reply from release server, name=" << lastRelease->getName()
|
||||
<< "desc=" << lastRelease->getDescriptionUrl() << "date=" << lastRelease->getPublishDate()
|
||||
<< "url=" << lastRelease->getDownloadUrl();
|
||||
|
||||
const QString &tagName = resultMap["tag_name"].toString();
|
||||
QString url = QString(STABLETAG_URL) + tagName;
|
||||
qCDebug(ReleaseChannelLog) << "Searching for commit hash corresponding to stable channel tag: " << tagName;
|
||||
qCInfo(ReleaseChannelLog) << "Searching for commit hash corresponding to stable channel tag: " << tagName;
|
||||
response = netMan->get(QNetworkRequest(url));
|
||||
connect(response, &QNetworkReply::finished, this, &StableReleaseChannel::tagListFinished);
|
||||
}
|
||||
@@ -165,24 +172,24 @@ void StableReleaseChannel::tagListFinished()
|
||||
QJsonDocument jsonResponse = QJsonDocument::fromJson(reply->readAll(), &parseError);
|
||||
reply->deleteLater();
|
||||
if (parseError.error != QJsonParseError::NoError) {
|
||||
qWarning() << "No reply received from the tag update server.";
|
||||
qCWarning(ReleaseChannelLog) << "No reply received from the tag update server.";
|
||||
emit error(tr("No reply received from the tag update server."));
|
||||
return;
|
||||
}
|
||||
|
||||
QVariantMap resultMap = jsonResponse.toVariant().toMap();
|
||||
if (!(resultMap.contains("object") && resultMap["object"].toMap().contains("sha"))) {
|
||||
qWarning() << "Invalid received from the tag update server.";
|
||||
qCWarning(ReleaseChannelLog) << "Invalid received from the tag update server.";
|
||||
emit error(tr("Invalid reply received from the tag update server."));
|
||||
return;
|
||||
}
|
||||
|
||||
lastRelease->setCommitHash(resultMap["object"].toMap()["sha"].toString());
|
||||
qCDebug(ReleaseChannelLog) << "Got reply from tag server, commit=" << lastRelease->getCommitHash();
|
||||
qCInfo(ReleaseChannelLog) << "Got reply from tag server, commit=" << lastRelease->getCommitHash();
|
||||
|
||||
QString shortHash = lastRelease->getCommitHash().left(GIT_SHORT_HASH_LEN);
|
||||
QString myHash = QString(VERSION_COMMIT);
|
||||
qCDebug(ReleaseChannelLog) << "Current hash=" << myHash << "update hash=" << shortHash;
|
||||
qCInfo(ReleaseChannelLog) << "Current hash=" << myHash << "update hash=" << shortHash;
|
||||
const bool needToUpdate = (QString::compare(shortHash, myHash, Qt::CaseInsensitive) != 0);
|
||||
|
||||
emit finishedCheck(needToUpdate, lastRelease->isCompatibleVersionFound(), lastRelease);
|
||||
@@ -225,7 +232,7 @@ void BetaReleaseChannel::releaseListFinished()
|
||||
QVariantMap resultMap = array.at(0).toObject().toVariantMap();
|
||||
|
||||
if (array.empty() || resultMap.empty()) {
|
||||
qWarning() << "No reply received from the release update server:" << QString(jsonData);
|
||||
qCWarning(ReleaseChannelLog) << "No reply received from the release update server:" << QString(jsonData);
|
||||
emit error(tr("No reply received from the release update server."));
|
||||
return;
|
||||
}
|
||||
@@ -234,7 +241,7 @@ void BetaReleaseChannel::releaseListFinished()
|
||||
if (!resultMap.contains("assets") || !resultMap.contains("author") || !resultMap.contains("tag_name") ||
|
||||
!resultMap.contains("target_commitish") || !resultMap.contains("assets_url") ||
|
||||
!resultMap.contains("published_at")) {
|
||||
qWarning() << "Invalid received from the release update server:" << resultMap;
|
||||
qCWarning(ReleaseChannelLog) << "Invalid received from the release update server:" << resultMap;
|
||||
emit error(tr("Invalid reply received from the release update server."));
|
||||
return;
|
||||
}
|
||||
@@ -249,13 +256,13 @@ void BetaReleaseChannel::releaseListFinished()
|
||||
lastRelease->setName(QString("%1 (%2)").arg(resultMap["tag_name"].toString()).arg(shortHash));
|
||||
lastRelease->setDescriptionUrl(QString(BETARELEASE_CHANGESURL).arg(VERSION_COMMIT, shortHash));
|
||||
|
||||
qCDebug(ReleaseChannelLog) << "Got reply from release server, size=" << resultMap.size()
|
||||
<< "name=" << lastRelease->getName() << "desc=" << lastRelease->getDescriptionUrl()
|
||||
<< "commit=" << lastRelease->getCommitHash() << "date=" << lastRelease->getPublishDate();
|
||||
qCInfo(ReleaseChannelLog) << "Got reply from release server, size=" << resultMap.size()
|
||||
<< "name=" << lastRelease->getName() << "desc=" << lastRelease->getDescriptionUrl()
|
||||
<< "commit=" << lastRelease->getCommitHash() << "date=" << lastRelease->getPublishDate();
|
||||
|
||||
QString betaBuildDownloadUrl = resultMap["assets_url"].toString();
|
||||
|
||||
qCDebug(ReleaseChannelLog) << "Searching for a corresponding file on the beta channel: " << betaBuildDownloadUrl;
|
||||
qCInfo(ReleaseChannelLog) << "Searching for a corresponding file on the beta channel: " << betaBuildDownloadUrl;
|
||||
response = netMan->get(QNetworkRequest(betaBuildDownloadUrl));
|
||||
connect(response, &QNetworkReply::finished, this, &BetaReleaseChannel::fileListFinished);
|
||||
}
|
||||
@@ -267,7 +274,7 @@ void BetaReleaseChannel::fileListFinished()
|
||||
QJsonDocument jsonResponse = QJsonDocument::fromJson(reply->readAll(), &parseError);
|
||||
reply->deleteLater();
|
||||
if (parseError.error != QJsonParseError::NoError) {
|
||||
qWarning() << "No reply received from the file update server.";
|
||||
qCWarning(ReleaseChannelLog) << "No reply received from the file update server.";
|
||||
emit error(tr("No reply received from the file update server."));
|
||||
return;
|
||||
}
|
||||
@@ -275,7 +282,7 @@ void BetaReleaseChannel::fileListFinished()
|
||||
QVariantList resultList = jsonResponse.toVariant().toList();
|
||||
QString shortHash = lastRelease->getCommitHash().left(GIT_SHORT_HASH_LEN);
|
||||
QString myHash = QString(VERSION_COMMIT);
|
||||
qCDebug(ReleaseChannelLog) << "Current hash=" << myHash << "update hash=" << shortHash;
|
||||
qCInfo(ReleaseChannelLog) << "Current hash=" << myHash << "update hash=" << shortHash;
|
||||
|
||||
bool needToUpdate = (QString::compare(shortHash, myHash, Qt::CaseInsensitive) != 0);
|
||||
bool compatibleVersion = false;
|
||||
@@ -292,7 +299,7 @@ void BetaReleaseChannel::fileListFinished()
|
||||
if (downloadMatchesCurrentOS(*url)) {
|
||||
compatibleVersion = true;
|
||||
lastRelease->setDownloadUrl(*url);
|
||||
qCDebug(ReleaseChannelLog) << "Found compatible version url=" << *url;
|
||||
qCInfo(ReleaseChannelLog) << "Found compatible version url=" << *url;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ SpoilerBackgroundUpdater::SpoilerBackgroundUpdater(QObject *apParent) : QObject(
|
||||
// File exists means we're in spoiler season
|
||||
startSpoilerDownloadProcess(SPOILERS_STATUS_URL, false);
|
||||
} else {
|
||||
qCDebug(SpoilerBackgroundUpdaterLog) << "Spoilers Disabled";
|
||||
qCInfo(SpoilerBackgroundUpdaterLog) << "Spoilers Disabled";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ void SpoilerBackgroundUpdater::actDownloadFinishedSpoilersFile()
|
||||
reply->deleteLater();
|
||||
emit spoilerCheckerDone();
|
||||
} else {
|
||||
qCDebug(SpoilerBackgroundUpdaterLog) << "Error downloading spoilers file" << errorCode;
|
||||
qCWarning(SpoilerBackgroundUpdaterLog) << "Error downloading spoilers file" << errorCode;
|
||||
emit spoilerCheckerDone();
|
||||
}
|
||||
}
|
||||
@@ -81,11 +81,11 @@ bool SpoilerBackgroundUpdater::deleteSpoilerFile()
|
||||
|
||||
// Delete the spoiler.xml file
|
||||
if (file.exists() && file.remove()) {
|
||||
qCDebug(SpoilerBackgroundUpdaterLog) << "Deleting spoiler.xml";
|
||||
qCInfo(SpoilerBackgroundUpdaterLog) << "Deleting spoiler.xml";
|
||||
return true;
|
||||
}
|
||||
|
||||
qCDebug(SpoilerBackgroundUpdaterLog) << "Error: Spoiler.xml not found or not deleted";
|
||||
qCInfo(SpoilerBackgroundUpdaterLog) << "Error: Spoiler.xml not found or not deleted";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -101,24 +101,24 @@ void SpoilerBackgroundUpdater::actCheckIfSpoilerSeasonEnabled()
|
||||
trayIcon->showMessage(tr("Spoilers season has ended"), tr("Deleting spoiler.xml. Please run Oracle"));
|
||||
}
|
||||
|
||||
qCDebug(SpoilerBackgroundUpdaterLog) << "Spoiler Season Offline";
|
||||
qCInfo(SpoilerBackgroundUpdaterLog) << "Spoiler Season Offline";
|
||||
emit spoilerCheckerDone();
|
||||
} else if (errorCode == QNetworkReply::NoError) {
|
||||
qCDebug(SpoilerBackgroundUpdaterLog) << "Spoiler Service Online";
|
||||
qCInfo(SpoilerBackgroundUpdaterLog) << "Spoiler Service Online";
|
||||
startSpoilerDownloadProcess(SPOILERS_URL, true);
|
||||
} else if (errorCode == QNetworkReply::HostNotFoundError) {
|
||||
if (trayIcon) {
|
||||
trayIcon->showMessage(tr("Spoilers download failed"), tr("No internet connection"));
|
||||
}
|
||||
|
||||
qCDebug(SpoilerBackgroundUpdaterLog) << "Spoiler download failed due to no internet connection";
|
||||
qCWarning(SpoilerBackgroundUpdaterLog) << "Spoiler download failed due to no internet connection";
|
||||
emit spoilerCheckerDone();
|
||||
} else {
|
||||
if (trayIcon) {
|
||||
trayIcon->showMessage(tr("Spoilers download failed"), tr("Error") + " " + (short)errorCode);
|
||||
}
|
||||
|
||||
qCDebug(SpoilerBackgroundUpdaterLog) << "Spoiler download failed with reason" << errorCode;
|
||||
qCWarning(SpoilerBackgroundUpdaterLog) << "Spoiler download failed with reason" << errorCode;
|
||||
emit spoilerCheckerDone();
|
||||
}
|
||||
}
|
||||
@@ -139,19 +139,19 @@ bool SpoilerBackgroundUpdater::saveDownloadedFile(QByteArray data)
|
||||
trayIcon->showMessage(tr("Spoilers already up to date"), tr("No new spoilers added"));
|
||||
}
|
||||
|
||||
qCDebug(SpoilerBackgroundUpdaterLog) << "Spoilers Up to Date";
|
||||
qCInfo(SpoilerBackgroundUpdaterLog) << "Spoilers Up to Date";
|
||||
return false;
|
||||
}
|
||||
|
||||
QFile file(fileName);
|
||||
if (!file.open(QIODevice::WriteOnly)) {
|
||||
qCDebug(SpoilerBackgroundUpdaterLog) << "Spoiler Service Error: File open (w) failed for" << fileName;
|
||||
qCWarning(SpoilerBackgroundUpdaterLog) << "Spoiler Service Error: File open (w) failed for" << fileName;
|
||||
file.close();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (file.write(data) == -1) {
|
||||
qCDebug(SpoilerBackgroundUpdaterLog) << "Spoiler Service Error: File write (w) failed for" << fileName;
|
||||
qCWarning(SpoilerBackgroundUpdaterLog) << "Spoiler Service Error: File write (w) failed for" << fileName;
|
||||
file.close();
|
||||
return false;
|
||||
}
|
||||
@@ -159,7 +159,7 @@ bool SpoilerBackgroundUpdater::saveDownloadedFile(QByteArray data)
|
||||
file.close();
|
||||
|
||||
// Data written, so reload the card database
|
||||
qCDebug(SpoilerBackgroundUpdaterLog) << "Spoiler Service Data Written";
|
||||
qCInfo(SpoilerBackgroundUpdaterLog) << "Spoiler Service Data Written";
|
||||
const auto reloadOk = QtConcurrent::run([] { CardDatabaseManager::getInstance()->loadCardDatabases(); });
|
||||
|
||||
// If the user has notifications enabled, let them know
|
||||
@@ -202,12 +202,12 @@ QByteArray SpoilerBackgroundUpdater::getHash(const QString fileName)
|
||||
QCryptographicHash hash(QCryptographicHash::Algorithm::Md5);
|
||||
hash.addData(bytes);
|
||||
|
||||
qCDebug(SpoilerBackgroundUpdaterLog) << "File Hash =" << hash.result();
|
||||
qCInfo(SpoilerBackgroundUpdaterLog) << "File Hash =" << hash.result();
|
||||
|
||||
file.close();
|
||||
return hash.result();
|
||||
} else {
|
||||
qCDebug(SpoilerBackgroundUpdaterLog) << "getHash ReadOnly failed!";
|
||||
qCWarning(SpoilerBackgroundUpdaterLog) << "getHash ReadOnly failed!";
|
||||
file.close();
|
||||
return QByteArray();
|
||||
}
|
||||
@@ -221,7 +221,7 @@ QByteArray SpoilerBackgroundUpdater::getHash(QByteArray data)
|
||||
QCryptographicHash hash(QCryptographicHash::Algorithm::Md5);
|
||||
hash.addData(bytes);
|
||||
|
||||
qCDebug(SpoilerBackgroundUpdaterLog) << "Data Hash =" << hash.result();
|
||||
qCInfo(SpoilerBackgroundUpdaterLog) << "Data Hash =" << hash.result();
|
||||
|
||||
return hash.result();
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ SoundEngine::~SoundEngine()
|
||||
void SoundEngine::soundEnabledChanged()
|
||||
{
|
||||
if (SettingsCache::instance().getSoundEnabled()) {
|
||||
qCDebug(SoundEngineLog) << "SoundEngine: enabling sound with" << audioData.size() << "sounds";
|
||||
qCInfo(SoundEngineLog) << "SoundEngine: enabling sound with" << audioData.size() << "sounds";
|
||||
if (!player) {
|
||||
player = new QMediaPlayer;
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||
@@ -46,7 +46,7 @@ void SoundEngine::soundEnabledChanged()
|
||||
#endif
|
||||
}
|
||||
} else {
|
||||
qCDebug(SoundEngineLog) << "SoundEngine: disabling sound";
|
||||
qCInfo(SoundEngineLog) << "SoundEngine: disabling sound";
|
||||
if (player) {
|
||||
player->stop();
|
||||
player->deleteLater();
|
||||
@@ -90,7 +90,7 @@ void SoundEngine::ensureThemeDirectoryExists()
|
||||
{
|
||||
if (SettingsCache::instance().getSoundThemeName().isEmpty() ||
|
||||
!getAvailableThemes().contains(SettingsCache::instance().getSoundThemeName())) {
|
||||
qCDebug(SoundEngineLog) << "Sounds theme name not set, setting default value";
|
||||
qCInfo(SoundEngineLog) << "Sounds theme name not set, setting default value";
|
||||
SettingsCache::instance().setSoundThemeName(DEFAULT_THEME_NAME);
|
||||
}
|
||||
}
|
||||
@@ -131,7 +131,7 @@ QStringMap &SoundEngine::getAvailableThemes()
|
||||
void SoundEngine::themeChangedSlot()
|
||||
{
|
||||
QString themeName = SettingsCache::instance().getSoundThemeName();
|
||||
qCDebug(SoundEngineLog) << "Sound theme changed:" << themeName;
|
||||
qCInfo(SoundEngineLog) << "Sound theme changed:" << themeName;
|
||||
|
||||
QDir dir = getAvailableThemes().value(themeName);
|
||||
|
||||
|
||||
581
cockatrice/src/client/tabs/abstract_tab_deck_editor.cpp
Normal file
@@ -0,0 +1,581 @@
|
||||
#include "abstract_tab_deck_editor.h"
|
||||
|
||||
#include "../../client/game_logic/abstract_client.h"
|
||||
#include "../../client/tapped_out_interface.h"
|
||||
#include "../../client/ui/widgets/cards/card_info_frame_widget.h"
|
||||
#include "../../deck/deck_stats_interface.h"
|
||||
#include "../../dialogs/dlg_load_deck.h"
|
||||
#include "../../dialogs/dlg_load_deck_from_clipboard.h"
|
||||
#include "../../game/cards/card_database_manager.h"
|
||||
#include "../../game/cards/card_database_model.h"
|
||||
#include "../../server/pending_command.h"
|
||||
#include "../../settings/cache_settings.h"
|
||||
#include "../ui/picture_loader/picture_loader.h"
|
||||
#include "../ui/pixel_map_generator.h"
|
||||
#include "pb/command_deck_upload.pb.h"
|
||||
#include "pb/response.pb.h"
|
||||
#include "tab_supervisor.h"
|
||||
#include "trice_limits.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
#include <QCloseEvent>
|
||||
#include <QDebug>
|
||||
#include <QDesktopServices>
|
||||
#include <QDir>
|
||||
#include <QFileDialog>
|
||||
#include <QHeaderView>
|
||||
#include <QLineEdit>
|
||||
#include <QMenuBar>
|
||||
#include <QMessageBox>
|
||||
#include <QPrintPreviewDialog>
|
||||
#include <QPrinter>
|
||||
#include <QProcessEnvironment>
|
||||
#include <QPushButton>
|
||||
#include <QRegularExpression>
|
||||
#include <QSplitter>
|
||||
#include <QTextStream>
|
||||
#include <QTreeView>
|
||||
#include <QUrl>
|
||||
|
||||
AbstractTabDeckEditor::AbstractTabDeckEditor(TabSupervisor *_tabSupervisor) : Tab(_tabSupervisor)
|
||||
{
|
||||
setDockOptions(QMainWindow::AnimatedDocks | QMainWindow::AllowNestedDocks | QMainWindow::AllowTabbedDocks);
|
||||
|
||||
databaseDisplayDockWidget = new DeckEditorDatabaseDisplayWidget(this);
|
||||
deckDockWidget = new DeckEditorDeckDockWidget(this);
|
||||
cardInfoDockWidget = new DeckEditorCardInfoDockWidget(this);
|
||||
filterDockWidget = new DeckEditorFilterDockWidget(this);
|
||||
printingSelectorDockWidget = new DeckEditorPrintingSelectorDockWidget(this);
|
||||
|
||||
connect(deckDockWidget, &DeckEditorDeckDockWidget::deckChanged, this, &AbstractTabDeckEditor::onDeckChanged);
|
||||
connect(deckDockWidget, &DeckEditorDeckDockWidget::deckModified, this, &AbstractTabDeckEditor::onDeckModified);
|
||||
connect(deckDockWidget, &DeckEditorDeckDockWidget::cardChanged, this, &AbstractTabDeckEditor::updateCard);
|
||||
connect(this, &AbstractTabDeckEditor::decrementCard, deckDockWidget, &DeckEditorDeckDockWidget::actDecrementCard);
|
||||
connect(databaseDisplayDockWidget, &DeckEditorDatabaseDisplayWidget::cardChanged, this,
|
||||
&AbstractTabDeckEditor::updateCard);
|
||||
connect(databaseDisplayDockWidget, &DeckEditorDatabaseDisplayWidget::addCardToMainDeck, this,
|
||||
&AbstractTabDeckEditor::actAddCard);
|
||||
connect(databaseDisplayDockWidget, &DeckEditorDatabaseDisplayWidget::addCardToSideboard, this,
|
||||
&AbstractTabDeckEditor::actAddCardToSideboard);
|
||||
connect(databaseDisplayDockWidget, &DeckEditorDatabaseDisplayWidget::decrementCardFromMainDeck, this,
|
||||
&AbstractTabDeckEditor::actDecrementCard);
|
||||
connect(databaseDisplayDockWidget, &DeckEditorDatabaseDisplayWidget::decrementCardFromSideboard, this,
|
||||
&AbstractTabDeckEditor::actDecrementCardFromSideboard);
|
||||
|
||||
connect(filterDockWidget, &DeckEditorFilterDockWidget::clearAllDatabaseFilters, databaseDisplayDockWidget,
|
||||
&DeckEditorDatabaseDisplayWidget::clearAllDatabaseFilters);
|
||||
|
||||
connect(&SettingsCache::instance().shortcuts(), &ShortcutsSettings::shortCutChanged, this,
|
||||
&AbstractTabDeckEditor::refreshShortcuts);
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::updateCard(CardInfoPtr _card)
|
||||
{
|
||||
cardInfoDockWidget->updateCard(_card);
|
||||
printingSelectorDockWidget->printingSelector->setCard(_card, DECK_ZONE_MAIN);
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::onDeckChanged()
|
||||
{
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::onDeckModified()
|
||||
{
|
||||
setModified(!isBlankNewDeck());
|
||||
deckMenu->setSaveStatus(!isBlankNewDeck());
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::addCardHelper(const CardInfoPtr info, QString zoneName)
|
||||
{
|
||||
if (!info)
|
||||
return;
|
||||
if (info->getIsToken())
|
||||
zoneName = DECK_ZONE_TOKENS;
|
||||
|
||||
QModelIndex newCardIndex = deckDockWidget->deckModel->addPreferredPrintingCard(info->getName(), zoneName, false);
|
||||
// recursiveExpand(newCardIndex);
|
||||
deckDockWidget->deckView->clearSelection();
|
||||
deckDockWidget->deckView->setCurrentIndex(newCardIndex);
|
||||
setModified(true);
|
||||
databaseDisplayDockWidget->searchEdit->setSelection(0, databaseDisplayDockWidget->searchEdit->text().length());
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::actAddCard(CardInfoPtr info)
|
||||
{
|
||||
if (QApplication::keyboardModifiers() & Qt::ControlModifier)
|
||||
actAddCardToSideboard(info);
|
||||
else
|
||||
addCardHelper(info, DECK_ZONE_MAIN);
|
||||
deckMenu->setSaveStatus(true);
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::actAddCardToSideboard(CardInfoPtr info)
|
||||
{
|
||||
addCardHelper(info, DECK_ZONE_SIDE);
|
||||
deckMenu->setSaveStatus(true);
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::actDecrementCard(CardInfoPtr info)
|
||||
{
|
||||
emit decrementCard(info, DECK_ZONE_MAIN);
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::actDecrementCardFromSideboard(CardInfoPtr info)
|
||||
{
|
||||
emit decrementCard(info, DECK_ZONE_SIDE);
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::actSwapCard(CardInfoPtr info, QString zoneName)
|
||||
{
|
||||
QString providerId = CardDatabaseManager::getInstance()->getSetInfoForCard(info).getProperty("uuid");
|
||||
QString collectorNumber = CardDatabaseManager::getInstance()->getSetInfoForCard(info).getProperty("num");
|
||||
|
||||
QModelIndex foundCard = deckDockWidget->deckModel->findCard(info->getName(), zoneName, providerId, collectorNumber);
|
||||
if (!foundCard.isValid()) {
|
||||
foundCard = deckDockWidget->deckModel->findCard(info->getName(), zoneName);
|
||||
}
|
||||
|
||||
deckDockWidget->swapCard(foundCard);
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens the deck in this tab.
|
||||
* @param deck The deck. Takes ownership of the object
|
||||
*/
|
||||
void AbstractTabDeckEditor::openDeck(DeckLoader *deck)
|
||||
{
|
||||
setDeck(deck);
|
||||
|
||||
if (!deck->getLastFileName().isEmpty()) {
|
||||
SettingsCache::instance().recents().updateRecentlyOpenedDeckPaths(deck->getLastFileName());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the currently active deck for this tab
|
||||
* @param _deck The deck. Takes ownership of the object
|
||||
*/
|
||||
void AbstractTabDeckEditor::setDeck(DeckLoader *_deck)
|
||||
{
|
||||
deckDockWidget->setDeck(_deck);
|
||||
PictureLoader::cacheCardPixmaps(
|
||||
CardDatabaseManager::getInstance()->getCardsByNameAndProviderId(getDeckList()->getCardListWithProviderId()));
|
||||
setModified(false);
|
||||
|
||||
// If they load a deck, make the deck list appear
|
||||
aDeckDockVisible->setChecked(true);
|
||||
deckDockWidget->setVisible(aDeckDockVisible->isChecked());
|
||||
}
|
||||
|
||||
DeckLoader *AbstractTabDeckEditor::getDeckList() const
|
||||
{
|
||||
return deckDockWidget->getDeckList();
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::setModified(bool _modified)
|
||||
{
|
||||
modified = _modified;
|
||||
emit tabTextChanged(this, getTabText());
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns true if this tab is a blank newly opened tab, as if it was just created with the `New Deck` action.
|
||||
*/
|
||||
bool AbstractTabDeckEditor::isBlankNewDeck() const
|
||||
{
|
||||
DeckLoader *deck = getDeckList();
|
||||
return !modified && deck->hasNotBeenLoaded();
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::actNewDeck()
|
||||
{
|
||||
auto deckOpenLocation = confirmOpen(false);
|
||||
|
||||
if (deckOpenLocation == CANCELLED) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (deckOpenLocation == NEW_TAB) {
|
||||
emit openDeckEditor(nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
cleanDeckAndResetModified();
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::cleanDeckAndResetModified()
|
||||
{
|
||||
deckMenu->setSaveStatus(false);
|
||||
deckDockWidget->cleanDeck();
|
||||
setModified(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Displays the save confirmation dialogue that is shown before loading a deck, if required. Takes into
|
||||
* account the `openDeckInNewTab` settting.
|
||||
*
|
||||
* @param openInSameTabIfBlank Open the deck in the same tab instead of a new tab if the current tab is completely
|
||||
* blank. Only relevant when the `openDeckInNewTab` setting is enabled.
|
||||
*
|
||||
* @returns An enum that indicates if and where to load the deck
|
||||
*/
|
||||
AbstractTabDeckEditor::DeckOpenLocation AbstractTabDeckEditor::confirmOpen(const bool openInSameTabIfBlank)
|
||||
{
|
||||
// handle `openDeckInNewTab` setting
|
||||
if (SettingsCache::instance().getOpenDeckInNewTab()) {
|
||||
if (openInSameTabIfBlank && isBlankNewDeck()) {
|
||||
return SAME_TAB;
|
||||
} else {
|
||||
return NEW_TAB;
|
||||
}
|
||||
}
|
||||
|
||||
// early return if deck is unmodified
|
||||
if (!modified) {
|
||||
return SAME_TAB;
|
||||
}
|
||||
|
||||
// do the save confirmation dialogue
|
||||
tabSupervisor->setCurrentWidget(this);
|
||||
|
||||
QMessageBox *msgBox = createSaveConfirmationWindow();
|
||||
QPushButton *newTabButton = msgBox->addButton(tr("Open in new tab"), QMessageBox::ApplyRole);
|
||||
|
||||
int ret = msgBox->exec();
|
||||
|
||||
// `exec()` returns an opaque value if a non-standard button was clicked.
|
||||
// Directly check if newTabButton was clicked before switching over the standard buttons.
|
||||
if (msgBox->clickedButton() == newTabButton) {
|
||||
return NEW_TAB;
|
||||
}
|
||||
|
||||
switch (ret) {
|
||||
case QMessageBox::Save:
|
||||
return actSaveDeck() ? SAME_TAB : CANCELLED;
|
||||
case QMessageBox::Discard:
|
||||
return SAME_TAB;
|
||||
default:
|
||||
return CANCELLED;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Creates the base save confirmation dialogue box.
|
||||
*
|
||||
* @returns A QMessageBox that can be further modified
|
||||
*/
|
||||
QMessageBox *AbstractTabDeckEditor::createSaveConfirmationWindow()
|
||||
{
|
||||
QMessageBox *msgBox = new QMessageBox(this);
|
||||
msgBox->setIcon(QMessageBox::Warning);
|
||||
msgBox->setWindowTitle(tr("Are you sure?"));
|
||||
msgBox->setText(tr("The decklist has been modified.\nDo you want to save the changes?"));
|
||||
msgBox->setStandardButtons(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
|
||||
return msgBox;
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::actLoadDeck()
|
||||
{
|
||||
auto deckOpenLocation = confirmOpen();
|
||||
|
||||
if (deckOpenLocation == CANCELLED) {
|
||||
return;
|
||||
}
|
||||
|
||||
DlgLoadDeck dialog(this);
|
||||
if (!dialog.exec())
|
||||
return;
|
||||
|
||||
QString fileName = dialog.selectedFiles().at(0);
|
||||
openDeckFromFile(fileName, deckOpenLocation);
|
||||
deckDockWidget->updateBannerCardComboBox();
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::actOpenRecent(const QString &fileName)
|
||||
{
|
||||
auto deckOpenLocation = confirmOpen();
|
||||
|
||||
if (deckOpenLocation == CANCELLED) {
|
||||
return;
|
||||
}
|
||||
|
||||
openDeckFromFile(fileName, deckOpenLocation);
|
||||
}
|
||||
|
||||
/**
|
||||
* Actually opens the deck from file
|
||||
* @param fileName The path of the deck to open
|
||||
* @param deckOpenLocation Which tab to open the deck
|
||||
*/
|
||||
void AbstractTabDeckEditor::openDeckFromFile(const QString &fileName, DeckOpenLocation deckOpenLocation)
|
||||
{
|
||||
DeckLoader::FileFormat fmt = DeckLoader::getFormatFromName(fileName);
|
||||
|
||||
auto *l = new DeckLoader;
|
||||
if (l->loadFromFile(fileName, fmt, true)) {
|
||||
if (deckOpenLocation == NEW_TAB) {
|
||||
emit openDeckEditor(l);
|
||||
l->deleteLater();
|
||||
} else {
|
||||
deckMenu->setSaveStatus(false);
|
||||
openDeck(l);
|
||||
}
|
||||
} else {
|
||||
l->deleteLater();
|
||||
QMessageBox::critical(this, tr("Error"), tr("Could not open deck at %1").arg(fileName));
|
||||
}
|
||||
deckMenu->setSaveStatus(true);
|
||||
}
|
||||
|
||||
bool AbstractTabDeckEditor::actSaveDeck()
|
||||
{
|
||||
DeckLoader *const deck = getDeckList();
|
||||
if (deck->getLastRemoteDeckId() != -1) {
|
||||
QString deckString = deck->writeToString_Native();
|
||||
if (deckString.length() > MAX_FILE_LENGTH) {
|
||||
QMessageBox::critical(this, tr("Error"), tr("Could not save remote deck"));
|
||||
return false;
|
||||
}
|
||||
|
||||
Command_DeckUpload cmd;
|
||||
cmd.set_deck_id(static_cast<google::protobuf::uint32>(deck->getLastRemoteDeckId()));
|
||||
cmd.set_deck_list(deckString.toStdString());
|
||||
|
||||
PendingCommand *pend = AbstractClient::prepareSessionCommand(cmd);
|
||||
connect(pend, &PendingCommand::finished, this, &AbstractTabDeckEditor::saveDeckRemoteFinished);
|
||||
tabSupervisor->getClient()->sendCommand(pend);
|
||||
|
||||
return true;
|
||||
} else if (deck->getLastFileName().isEmpty())
|
||||
return actSaveDeckAs();
|
||||
else if (deck->saveToFile(deck->getLastFileName(), deck->getLastFileFormat())) {
|
||||
setModified(false);
|
||||
return true;
|
||||
}
|
||||
QMessageBox::critical(
|
||||
this, tr("Error"),
|
||||
tr("The deck could not be saved.\nPlease check that the directory is writable and try again."));
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AbstractTabDeckEditor::actSaveDeckAs()
|
||||
{
|
||||
QFileDialog dialog(this, tr("Save deck"));
|
||||
dialog.setDirectory(SettingsCache::instance().getDeckPath());
|
||||
dialog.setAcceptMode(QFileDialog::AcceptSave);
|
||||
dialog.setDefaultSuffix("cod");
|
||||
dialog.setNameFilters(DeckLoader::FILE_NAME_FILTERS);
|
||||
dialog.selectFile(getDeckList()->getName().trimmed());
|
||||
|
||||
if (!dialog.exec())
|
||||
return false;
|
||||
|
||||
QString fileName = dialog.selectedFiles().at(0);
|
||||
DeckLoader::FileFormat fmt = DeckLoader::getFormatFromName(fileName);
|
||||
|
||||
if (!getDeckList()->saveToFile(fileName, fmt)) {
|
||||
QMessageBox::critical(
|
||||
this, tr("Error"),
|
||||
tr("The deck could not be saved.\nPlease check that the directory is writable and try again."));
|
||||
return false;
|
||||
}
|
||||
setModified(false);
|
||||
|
||||
SettingsCache::instance().recents().updateRecentlyOpenedDeckPaths(fileName);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::saveDeckRemoteFinished(const Response &response)
|
||||
{
|
||||
if (response.response_code() != Response::RespOk)
|
||||
QMessageBox::critical(this, tr("Error"), tr("The deck could not be saved."));
|
||||
else
|
||||
setModified(false);
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::actLoadDeckFromClipboard()
|
||||
{
|
||||
auto deckOpenLocation = confirmOpen();
|
||||
|
||||
if (deckOpenLocation == CANCELLED) {
|
||||
return;
|
||||
}
|
||||
|
||||
DlgLoadDeckFromClipboard dlg(this);
|
||||
if (!dlg.exec())
|
||||
return;
|
||||
|
||||
if (deckOpenLocation == NEW_TAB) {
|
||||
emit openDeckEditor(dlg.getDeckList());
|
||||
} else {
|
||||
setDeck(dlg.getDeckList());
|
||||
setModified(true);
|
||||
}
|
||||
|
||||
deckMenu->setSaveStatus(true);
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::editDeckInClipboard(bool annotated)
|
||||
{
|
||||
DlgEditDeckInClipboard dlg(*getDeckList(), annotated, this);
|
||||
if (!dlg.exec())
|
||||
return;
|
||||
|
||||
setDeck(dlg.getDeckList());
|
||||
setModified(true);
|
||||
|
||||
deckMenu->setSaveStatus(true);
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::actEditDeckInClipboard()
|
||||
{
|
||||
editDeckInClipboard(true);
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::actEditDeckInClipboardRaw()
|
||||
{
|
||||
editDeckInClipboard(false);
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::actSaveDeckToClipboard()
|
||||
{
|
||||
getDeckList()->saveToClipboard(true, true);
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::actSaveDeckToClipboardNoSetInfo()
|
||||
{
|
||||
getDeckList()->saveToClipboard(true, false);
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::actSaveDeckToClipboardRaw()
|
||||
{
|
||||
getDeckList()->saveToClipboard(false, true);
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::actSaveDeckToClipboardRawNoSetInfo()
|
||||
{
|
||||
getDeckList()->saveToClipboard(false, false);
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::actPrintDeck()
|
||||
{
|
||||
auto *dlg = new QPrintPreviewDialog(this);
|
||||
connect(dlg, &QPrintPreviewDialog::paintRequested, deckDockWidget->deckModel, &DeckListModel::printDeckList);
|
||||
dlg->exec();
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::exportToDecklistWebsite(DeckLoader::DecklistWebsite website)
|
||||
{
|
||||
// check if deck is not null
|
||||
if (DeckLoader *const deck = getDeckList()) {
|
||||
// Get the decklist url string from the deck loader class.
|
||||
QString decklistUrlString = deck->exportDeckToDecklist(website);
|
||||
// Check to make sure the string isn't empty.
|
||||
if (QString::compare(decklistUrlString, "", Qt::CaseInsensitive) == 0) {
|
||||
// Show an error if the deck is empty, and return.
|
||||
QMessageBox::critical(this, tr("Error"), tr("There are no cards in your deck to be exported"));
|
||||
return;
|
||||
}
|
||||
// Encode the string recieved from the model to make sure all characters are encoded.
|
||||
// first we put it into a qurl object
|
||||
QUrl decklistUrl = QUrl(decklistUrlString);
|
||||
// we get the correctly encoded url.
|
||||
decklistUrlString = decklistUrl.toEncoded();
|
||||
// We open the url in the user's default browser
|
||||
QDesktopServices::openUrl(decklistUrlString);
|
||||
} else {
|
||||
// if there's no deck loader object, return an error
|
||||
QMessageBox::critical(this, tr("Error"), tr("No deck was selected to be exported."));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Exports the deck to www.decklist.org (the old website)
|
||||
*/
|
||||
void AbstractTabDeckEditor::actExportDeckDecklist()
|
||||
{
|
||||
exportToDecklistWebsite(DeckLoader::DecklistOrg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Exports the deck to www.decklist.xyz (the new website)
|
||||
*/
|
||||
void AbstractTabDeckEditor::actExportDeckDecklistXyz()
|
||||
{
|
||||
exportToDecklistWebsite(DeckLoader::DecklistXyz);
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::actAnalyzeDeckDeckstats()
|
||||
{
|
||||
auto *interface = new DeckStatsInterface(*databaseDisplayDockWidget->databaseModel->getDatabase(),
|
||||
this); // it deletes itself when done
|
||||
interface->analyzeDeck(getDeckList());
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::actAnalyzeDeckTappedout()
|
||||
{
|
||||
auto *interface = new TappedOutInterface(*databaseDisplayDockWidget->databaseModel->getDatabase(),
|
||||
this); // it deletes itself when done
|
||||
interface->analyzeDeck(getDeckList());
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::filterTreeChanged(FilterTree *filterTree)
|
||||
{
|
||||
databaseDisplayDockWidget->setFilterTree(filterTree);
|
||||
}
|
||||
|
||||
// Method uses to sync docks state with menu items state
|
||||
bool AbstractTabDeckEditor::eventFilter(QObject *o, QEvent *e)
|
||||
{
|
||||
if (e->type() == QEvent::Close) {
|
||||
if (o == cardInfoDockWidget) {
|
||||
aCardInfoDockVisible->setChecked(false);
|
||||
aCardInfoDockFloating->setEnabled(false);
|
||||
} else if (o == deckDockWidget) {
|
||||
aDeckDockVisible->setChecked(false);
|
||||
aDeckDockFloating->setEnabled(false);
|
||||
} else if (o == filterDockWidget) {
|
||||
aFilterDockVisible->setChecked(false);
|
||||
aFilterDockFloating->setEnabled(false);
|
||||
} else if (o == printingSelectorDockWidget) {
|
||||
aPrintingSelectorDockVisible->setChecked(false);
|
||||
aPrintingSelectorDockFloating->setEnabled(false);
|
||||
}
|
||||
}
|
||||
if (o == this && e->type() == QEvent::Hide) {
|
||||
LayoutsSettings &layouts = SettingsCache::instance().layouts();
|
||||
layouts.setDeckEditorLayoutState(saveState());
|
||||
layouts.setDeckEditorGeometry(saveGeometry());
|
||||
layouts.setDeckEditorCardSize(cardInfoDockWidget->size());
|
||||
layouts.setDeckEditorFilterSize(filterDockWidget->size());
|
||||
layouts.setDeckEditorDeckSize(deckDockWidget->size());
|
||||
layouts.setDeckEditorPrintingSelectorSize(printingSelectorDockWidget->size());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AbstractTabDeckEditor::confirmClose()
|
||||
{
|
||||
if (modified) {
|
||||
tabSupervisor->setCurrentWidget(this);
|
||||
int ret = createSaveConfirmationWindow()->exec();
|
||||
if (ret == QMessageBox::Save)
|
||||
return actSaveDeck();
|
||||
else if (ret == QMessageBox::Cancel)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void AbstractTabDeckEditor::closeRequest(bool forced)
|
||||
{
|
||||
if (!forced && !confirmClose()) {
|
||||
return;
|
||||
}
|
||||
|
||||
emit deckEditorClosing(this);
|
||||
close();
|
||||
}
|
||||
158
cockatrice/src/client/tabs/abstract_tab_deck_editor.h
Normal file
@@ -0,0 +1,158 @@
|
||||
#ifndef TAB_GENERIC_DECK_EDITOR_H
|
||||
#define TAB_GENERIC_DECK_EDITOR_H
|
||||
|
||||
#include "../../game/cards/card_info.h"
|
||||
#include "../menus/deck_editor/deck_editor_menu.h"
|
||||
#include "../ui/widgets/deck_editor/deck_editor_card_info_dock_widget.h"
|
||||
#include "../ui/widgets/deck_editor/deck_editor_database_display_widget.h"
|
||||
#include "../ui/widgets/deck_editor/deck_editor_deck_dock_widget.h"
|
||||
#include "../ui/widgets/deck_editor/deck_editor_filter_dock_widget.h"
|
||||
#include "../ui/widgets/deck_editor/deck_editor_printing_selector_dock_widget.h"
|
||||
#include "../ui/widgets/visual_deck_storage/deck_preview/deck_preview_deck_tags_display_widget.h"
|
||||
#include "tab.h"
|
||||
|
||||
class CardDatabaseModel;
|
||||
class CardDatabaseDisplayModel;
|
||||
|
||||
class CardInfoFrameWidget;
|
||||
class DeckLoader;
|
||||
class DeckEditorMenu;
|
||||
class DeckEditorCardInfoDockWidget;
|
||||
class DeckEditorDatabaseDisplayWidget;
|
||||
class DeckEditorDeckDockWidget;
|
||||
class DeckEditorFilterDockWidget;
|
||||
class DeckEditorPrintingSelectorDockWidget;
|
||||
class DeckPreviewDeckTagsDisplayWidget;
|
||||
class Response;
|
||||
class FilterTreeModel;
|
||||
class FilterBuilder;
|
||||
|
||||
class QTreeView;
|
||||
class QTextEdit;
|
||||
class QLabel;
|
||||
class QComboBox;
|
||||
class QGroupBox;
|
||||
class QMessageBox;
|
||||
class QHBoxLayout;
|
||||
class QVBoxLayout;
|
||||
class QPushButton;
|
||||
class QDockWidget;
|
||||
class QMenu;
|
||||
class QAction;
|
||||
|
||||
class AbstractTabDeckEditor : public Tab
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
friend class DeckEditorMenu;
|
||||
|
||||
public:
|
||||
explicit AbstractTabDeckEditor(TabSupervisor *_tabSupervisor);
|
||||
|
||||
// UI and Navigation
|
||||
virtual void createMenus() = 0;
|
||||
[[nodiscard]] virtual QString getTabText() const override = 0;
|
||||
bool confirmClose();
|
||||
virtual void retranslateUi() override = 0;
|
||||
|
||||
// Deck Management
|
||||
void openDeck(DeckLoader *deck);
|
||||
DeckLoader *getDeckList() const;
|
||||
void setModified(bool _windowModified);
|
||||
|
||||
// UI Elements
|
||||
DeckEditorMenu *deckMenu;
|
||||
DeckEditorDatabaseDisplayWidget *databaseDisplayDockWidget;
|
||||
DeckEditorCardInfoDockWidget *cardInfoDockWidget;
|
||||
DeckEditorDeckDockWidget *deckDockWidget;
|
||||
DeckEditorFilterDockWidget *filterDockWidget;
|
||||
DeckEditorPrintingSelectorDockWidget *printingSelectorDockWidget;
|
||||
|
||||
public slots:
|
||||
virtual void onDeckChanged();
|
||||
virtual void onDeckModified();
|
||||
void updateCard(CardInfoPtr _card);
|
||||
void actAddCard(CardInfoPtr info);
|
||||
void actAddCardToSideboard(CardInfoPtr info);
|
||||
void actDecrementCard(CardInfoPtr info);
|
||||
void actDecrementCardFromSideboard(CardInfoPtr info);
|
||||
void actOpenRecent(const QString &fileName);
|
||||
void filterTreeChanged(FilterTree *filterTree);
|
||||
void closeRequest(bool forced = false) override;
|
||||
virtual void showPrintingSelector() = 0;
|
||||
virtual void dockTopLevelChanged(bool topLevel) = 0;
|
||||
|
||||
signals:
|
||||
void openDeckEditor(const DeckLoader *deckLoader);
|
||||
void deckEditorClosing(AbstractTabDeckEditor *tab);
|
||||
void decrementCard(CardInfoPtr card, QString zoneName);
|
||||
|
||||
protected slots:
|
||||
// Deck Operations
|
||||
virtual void actNewDeck();
|
||||
void cleanDeckAndResetModified();
|
||||
virtual void actLoadDeck();
|
||||
bool actSaveDeck();
|
||||
virtual bool actSaveDeckAs();
|
||||
virtual void actLoadDeckFromClipboard();
|
||||
void actEditDeckInClipboard();
|
||||
void actEditDeckInClipboardRaw();
|
||||
void actSaveDeckToClipboard();
|
||||
void actSaveDeckToClipboardNoSetInfo();
|
||||
void actSaveDeckToClipboardRaw();
|
||||
void actSaveDeckToClipboardRawNoSetInfo();
|
||||
void actPrintDeck();
|
||||
void actExportDeckDecklist();
|
||||
void actExportDeckDecklistXyz();
|
||||
void actAnalyzeDeckDeckstats();
|
||||
void actAnalyzeDeckTappedout();
|
||||
|
||||
// Remote Save
|
||||
void saveDeckRemoteFinished(const Response &r);
|
||||
|
||||
// UI Layout Management
|
||||
virtual void loadLayout() = 0;
|
||||
virtual void restartLayout() = 0;
|
||||
virtual void freeDocksSize() = 0;
|
||||
virtual void refreshShortcuts() = 0;
|
||||
|
||||
bool eventFilter(QObject *o, QEvent *e) override;
|
||||
virtual void dockVisibleTriggered() = 0;
|
||||
virtual void dockFloatingTriggered() = 0;
|
||||
|
||||
private:
|
||||
virtual void setDeck(DeckLoader *_deck);
|
||||
void editDeckInClipboard(bool annotated);
|
||||
void exportToDecklistWebsite(DeckLoader::DecklistWebsite website);
|
||||
|
||||
protected:
|
||||
/**
|
||||
* @brief Enum for selecting deck open location
|
||||
*/
|
||||
enum DeckOpenLocation
|
||||
{
|
||||
CANCELLED,
|
||||
SAME_TAB,
|
||||
NEW_TAB
|
||||
};
|
||||
|
||||
DeckOpenLocation confirmOpen(bool openInSameTabIfBlank = true);
|
||||
QMessageBox *createSaveConfirmationWindow();
|
||||
bool isBlankNewDeck() const;
|
||||
|
||||
// Helper functions for card actions
|
||||
void addCardHelper(CardInfoPtr info, QString zoneName);
|
||||
void actSwapCard(CardInfoPtr info, QString zoneName);
|
||||
virtual void openDeckFromFile(const QString &fileName, DeckOpenLocation deckOpenLocation);
|
||||
|
||||
// UI Menu Elements
|
||||
QMenu *viewMenu, *cardInfoDockMenu, *deckDockMenu, *filterDockMenu, *printingSelectorDockMenu;
|
||||
|
||||
QAction *aResetLayout;
|
||||
QAction *aCardInfoDockVisible, *aCardInfoDockFloating, *aDeckDockVisible, *aDeckDockFloating;
|
||||
QAction *aFilterDockVisible, *aFilterDockFloating, *aPrintingSelectorDockVisible, *aPrintingSelectorDockFloating;
|
||||
|
||||
bool modified = false;
|
||||
};
|
||||
|
||||
#endif // TAB_GENERIC_DECK_EDITOR_H
|
||||
@@ -1,11 +1,11 @@
|
||||
#include "edhrec_commander_api_response_archidekt_links.h"
|
||||
#include "edhrec_api_response_archidekt_links.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
|
||||
void EdhrecCommanderApiResponseArchidektLink::fromJson(const QJsonObject &json)
|
||||
void EdhrecApiResponseArchidektLink::fromJson(const QJsonObject &json)
|
||||
{
|
||||
c = json.value("c").toString();
|
||||
f = json.value("f").toInt(0);
|
||||
@@ -13,7 +13,7 @@ void EdhrecCommanderApiResponseArchidektLink::fromJson(const QJsonObject &json)
|
||||
u = json.value("u").toString();
|
||||
}
|
||||
|
||||
void EdhrecCommanderApiResponseArchidektLink::debugPrint() const
|
||||
void EdhrecApiResponseArchidektLink::debugPrint() const
|
||||
{
|
||||
qDebug() << " C:" << c;
|
||||
qDebug() << " F:" << f;
|
||||
@@ -27,7 +27,7 @@ void EdhrecCommanderApiResponseArchidektLinks::fromJson(const QJsonArray &json)
|
||||
for (const QJsonValue &value : json) {
|
||||
if (value.isObject()) {
|
||||
QJsonObject entryJson = value.toObject();
|
||||
EdhrecCommanderApiResponseArchidektLink entry;
|
||||
EdhrecApiResponseArchidektLink entry;
|
||||
entry.fromJson(entryJson);
|
||||
entries.append(entry);
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <QVector>
|
||||
|
||||
// Represents a single Archidekt entry
|
||||
class EdhrecCommanderApiResponseArchidektLink
|
||||
class EdhrecApiResponseArchidektLink
|
||||
{
|
||||
public:
|
||||
QString c;
|
||||
@@ -23,7 +23,7 @@ public:
|
||||
class EdhrecCommanderApiResponseArchidektLinks
|
||||
{
|
||||
public:
|
||||
QVector<EdhrecCommanderApiResponseArchidektLink> entries;
|
||||
QVector<EdhrecApiResponseArchidektLink> entries;
|
||||
|
||||
void fromJson(const QJsonArray &json);
|
||||
void debugPrint() const;
|
||||
@@ -0,0 +1,47 @@
|
||||
#include "edhrec_average_deck_api_response.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QJsonArray>
|
||||
|
||||
void EdhrecAverageDeckApiResponse::fromJson(const QJsonObject &json)
|
||||
{
|
||||
// Parse the collapsed DeckStatistics
|
||||
deckStats.fromJson(json);
|
||||
|
||||
// Parse Archidekt section
|
||||
QJsonArray archidektJson = json.value("archidekt").toArray();
|
||||
archidekt.fromJson(archidektJson);
|
||||
|
||||
// Parse other fields
|
||||
similar = json.value("similar").toObject();
|
||||
header = json.value("header").toString();
|
||||
panels = json.value("panels").toObject();
|
||||
description = json.value("description").toString();
|
||||
QJsonObject containerJson = json.value("container").toObject();
|
||||
container.fromJson(containerJson);
|
||||
QJsonArray cardsJson = json.value("deck").toArray();
|
||||
deck.fromJson(cardsJson);
|
||||
}
|
||||
|
||||
void EdhrecAverageDeckApiResponse::debugPrint() const
|
||||
{
|
||||
qDebug() << "Deck Statistics:";
|
||||
qDebug() << " Creature:" << deckStats.creature;
|
||||
qDebug() << " Instant:" << deckStats.instant;
|
||||
qDebug() << " Sorcery:" << deckStats.sorcery;
|
||||
qDebug() << " Artifact:" << deckStats.artifact;
|
||||
qDebug() << " Enchantment:" << deckStats.enchantment;
|
||||
qDebug() << " Battle:" << deckStats.battle;
|
||||
qDebug() << " Planeswalker:" << deckStats.planeswalker;
|
||||
qDebug() << " Land:" << deckStats.land;
|
||||
qDebug() << " Basic:" << deckStats.basic;
|
||||
qDebug() << " Nonbasic:" << deckStats.nonbasic;
|
||||
|
||||
archidekt.debugPrint();
|
||||
|
||||
qDebug() << "Similar:" << similar;
|
||||
qDebug() << "Header:" << header;
|
||||
qDebug() << "Panels:" << panels;
|
||||
qDebug() << "Description:" << description;
|
||||
container.debugPrint();
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
#ifndef EDHREC_AVERAGE_DECK_API_RESPONSE_H
|
||||
#define EDHREC_AVERAGE_DECK_API_RESPONSE_H
|
||||
|
||||
#include "../archidekt_links/edhrec_api_response_archidekt_links.h"
|
||||
#include "../cards/edhrec_api_response_card_container.h"
|
||||
#include "../commander/edhrec_commander_api_response_average_deck_statistics.h"
|
||||
#include "edhrec_deck_api_response.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QJsonObject>
|
||||
#include <QString>
|
||||
|
||||
// Represents the main structure of the JSON
|
||||
class EdhrecAverageDeckApiResponse
|
||||
{
|
||||
public:
|
||||
EdhrecCommanderApiResponseAverageDeckStatistics deckStats;
|
||||
EdhrecCommanderApiResponseArchidektLinks archidekt;
|
||||
QJsonObject similar;
|
||||
QString header;
|
||||
QJsonObject panels;
|
||||
QString description;
|
||||
EdhrecApiResponseCardContainer container;
|
||||
EdhrecDeckApiResponse deck;
|
||||
|
||||
void fromJson(const QJsonObject &json);
|
||||
void debugPrint() const;
|
||||
};
|
||||
|
||||
#endif // EDHREC_AVERAGE_DECK_API_RESPONSE_H
|
||||
@@ -0,0 +1,27 @@
|
||||
#include "edhrec_deck_api_response.h"
|
||||
|
||||
#include "../../../../../../deck/deck_loader.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonObject>
|
||||
#include <QMainWindow>
|
||||
|
||||
void EdhrecDeckApiResponse::fromJson(const QJsonArray &json)
|
||||
{
|
||||
QString deckList;
|
||||
for (const QJsonValue &cardlistValue : json) {
|
||||
deckList += cardlistValue.toString() + "\n";
|
||||
}
|
||||
|
||||
deckLoader = new DeckLoader();
|
||||
|
||||
QTextStream stream(&deckList);
|
||||
deckLoader->loadFromStream_Plain(stream, true);
|
||||
}
|
||||
|
||||
void EdhrecDeckApiResponse::debugPrint() const
|
||||
{
|
||||
qDebug() << "Breadcrumb:";
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
#ifndef EDHREC_DECK_API_RESPONSE_H
|
||||
#define EDHREC_DECK_API_RESPONSE_H
|
||||
|
||||
#include "../../../../../../deck/deck_loader.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonObject>
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
|
||||
class EdhrecDeckApiResponse
|
||||
{
|
||||
public:
|
||||
// Constructor
|
||||
EdhrecDeckApiResponse() = default;
|
||||
|
||||
// Parse deck-related data from JSON
|
||||
void fromJson(const QJsonArray &json);
|
||||
|
||||
// Debug method for logging
|
||||
void debugPrint() const;
|
||||
|
||||
DeckLoader *deckLoader;
|
||||
};
|
||||
|
||||
#endif // EDHREC_DECK_API_RESPONSE_H
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "edhrec_commander_api_response_card_prices.h"
|
||||
#include "edhrec_api_response_card_prices.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
@@ -18,14 +18,14 @@ void CardPrices::fromJson(const QJsonObject &json)
|
||||
|
||||
void CardPrices::debugPrint() const
|
||||
{
|
||||
qDebug() << "Card Prices:";
|
||||
qDebug() << "Cardhoarder:" << cardhoarder;
|
||||
qDebug() << "Cardkingdom:" << cardkingdom;
|
||||
qDebug() << "Cardmarket:" << cardmarket;
|
||||
qDebug() << "Face2Face:" << face2face;
|
||||
qDebug() << "Manapool:" << manapool;
|
||||
qDebug() << "Mtgstocks:" << mtgstocks;
|
||||
qDebug() << "SCG:" << scg;
|
||||
qDebug() << "TCGL:" << tcgl;
|
||||
qDebug() << "Tcgplayer:" << tcgplayer;
|
||||
qInfo() << "Card Prices:";
|
||||
qInfo() << "Cardhoarder:" << cardhoarder;
|
||||
qInfo() << "Cardkingdom:" << cardkingdom;
|
||||
qInfo() << "Cardmarket:" << cardmarket;
|
||||
qInfo() << "Face2Face:" << face2face;
|
||||
qInfo() << "Manapool:" << manapool;
|
||||
qInfo() << "Mtgstocks:" << mtgstocks;
|
||||
qInfo() << "SCG:" << scg;
|
||||
qInfo() << "TCGL:" << tcgl;
|
||||
qInfo() << "Tcgplayer:" << tcgplayer;
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
#include "edhrec_commander_api_response_card_container.h"
|
||||
#include "edhrec_api_response_card_container.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonObject>
|
||||
|
||||
void EdhrecCommanderApiResponseCardContainer::fromJson(const QJsonObject &json)
|
||||
void EdhrecApiResponseCardContainer::fromJson(const QJsonObject &json)
|
||||
{
|
||||
// Parse breadcrumb
|
||||
QJsonArray breadcrumbArray = json.value("breadcrumb").toArray();
|
||||
@@ -20,7 +20,7 @@ void EdhrecCommanderApiResponseCardContainer::fromJson(const QJsonObject &json)
|
||||
for (const QJsonValue &cardlistValue : cardlistsArray) {
|
||||
QJsonObject cardlistObj = cardlistValue.toObject();
|
||||
QJsonArray cardviewsArray = cardlistObj.value("cardviews").toArray();
|
||||
EdhrecCommanderApiResponseCardList cardView;
|
||||
EdhrecApiResponseCardList cardView;
|
||||
cardView.fromJson(cardlistValue.toObject());
|
||||
cardlists.push_back(cardView);
|
||||
}
|
||||
@@ -29,7 +29,7 @@ void EdhrecCommanderApiResponseCardContainer::fromJson(const QJsonObject &json)
|
||||
title = json.value("title").toString();
|
||||
}
|
||||
|
||||
void EdhrecCommanderApiResponseCardContainer::debugPrint() const
|
||||
void EdhrecApiResponseCardContainer::debugPrint() const
|
||||
{
|
||||
qDebug() << "Breadcrumb:";
|
||||
for (const auto &breadcrumbEntry : breadcrumb) {
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef CONTAINER_ENTRY_H
|
||||
#define CONTAINER_ENTRY_H
|
||||
|
||||
#include "edhrec_commander_api_response_card_list.h"
|
||||
#include "edhrec_api_response_card_list.h"
|
||||
#include "edhrec_commander_api_response_commander_details.h"
|
||||
|
||||
#include <QDebug>
|
||||
@@ -10,11 +10,11 @@
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
|
||||
class EdhrecCommanderApiResponseCardContainer
|
||||
class EdhrecApiResponseCardContainer
|
||||
{
|
||||
public:
|
||||
// Constructor
|
||||
EdhrecCommanderApiResponseCardContainer() = default;
|
||||
EdhrecApiResponseCardContainer() = default;
|
||||
|
||||
// Parse deck-related data from JSON
|
||||
void fromJson(const QJsonObject &json);
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
{
|
||||
return card;
|
||||
}
|
||||
const QVector<EdhrecCommanderApiResponseCardList> &getCardlists() const
|
||||
const QVector<EdhrecApiResponseCardList> &getCardlists() const
|
||||
{
|
||||
return cardlists;
|
||||
}
|
||||
@@ -52,7 +52,7 @@ private:
|
||||
QString description;
|
||||
QVector<QJsonObject> breadcrumb;
|
||||
EdhrecCommanderApiResponseCommanderDetails card;
|
||||
QVector<EdhrecCommanderApiResponseCardList> cardlists;
|
||||
QVector<EdhrecApiResponseCardList> cardlists;
|
||||
QString keywords;
|
||||
QString title;
|
||||
};
|
||||
@@ -1,13 +1,13 @@
|
||||
#include "edhrec_commander_api_response_card_details.h"
|
||||
#include "edhrec_api_response_card_details.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
EdhrecCommanderApiResponseCardDetails::EdhrecCommanderApiResponseCardDetails()
|
||||
EdhrecApiResponseCardDetails::EdhrecApiResponseCardDetails()
|
||||
: synergy(0.0), inclusion(0), numDecks(0), potentialDecks(0)
|
||||
{
|
||||
}
|
||||
|
||||
void EdhrecCommanderApiResponseCardDetails::fromJson(const QJsonObject &json)
|
||||
void EdhrecApiResponseCardDetails::fromJson(const QJsonObject &json)
|
||||
{
|
||||
// Parse the fields from the JSON object
|
||||
name = json.value("name").toString();
|
||||
@@ -21,7 +21,7 @@ void EdhrecCommanderApiResponseCardDetails::fromJson(const QJsonObject &json)
|
||||
potentialDecks = json.value("potential_decks").toInt(0);
|
||||
}
|
||||
|
||||
void EdhrecCommanderApiResponseCardDetails::debugPrint() const
|
||||
void EdhrecApiResponseCardDetails::debugPrint() const
|
||||
{
|
||||
// Print out all the fields for debugging
|
||||
qDebug() << "Name:" << name;
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <QJsonObject>
|
||||
#include <QString>
|
||||
|
||||
class EdhrecCommanderApiResponseCardDetails
|
||||
class EdhrecApiResponseCardDetails
|
||||
{
|
||||
public:
|
||||
QString name;
|
||||
@@ -17,7 +17,7 @@ public:
|
||||
int numDecks;
|
||||
int potentialDecks;
|
||||
|
||||
EdhrecCommanderApiResponseCardDetails();
|
||||
EdhrecApiResponseCardDetails();
|
||||
|
||||
// Method to populate the object from a JSON object
|
||||
void fromJson(const QJsonObject &json);
|
||||
@@ -1,12 +1,12 @@
|
||||
#include "edhrec_commander_api_response_card_list.h"
|
||||
#include "edhrec_api_response_card_list.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
EdhrecCommanderApiResponseCardList::EdhrecCommanderApiResponseCardList()
|
||||
EdhrecApiResponseCardList::EdhrecApiResponseCardList()
|
||||
{
|
||||
}
|
||||
|
||||
void EdhrecCommanderApiResponseCardList::fromJson(const QJsonObject &json)
|
||||
void EdhrecApiResponseCardList::fromJson(const QJsonObject &json)
|
||||
{
|
||||
// Parse the header from the JSON object
|
||||
header = json.value("header").toString();
|
||||
@@ -15,19 +15,19 @@ void EdhrecCommanderApiResponseCardList::fromJson(const QJsonObject &json)
|
||||
QJsonArray cardviewsArray = json.value("cardviews").toArray();
|
||||
for (const QJsonValue &value : cardviewsArray) {
|
||||
QJsonObject cardviewObj = value.toObject();
|
||||
EdhrecCommanderApiResponseCardDetails cardView;
|
||||
EdhrecApiResponseCardDetails cardView;
|
||||
cardView.fromJson(cardviewObj);
|
||||
cardViews.append(cardView);
|
||||
}
|
||||
}
|
||||
|
||||
void EdhrecCommanderApiResponseCardList::debugPrint() const
|
||||
void EdhrecApiResponseCardList::debugPrint() const
|
||||
{
|
||||
// Print out the header
|
||||
qDebug() << "Header:" << header;
|
||||
|
||||
// Print out all the CardView objects
|
||||
for (const EdhrecCommanderApiResponseCardDetails &cardView : cardViews) {
|
||||
for (const EdhrecApiResponseCardDetails &cardView : cardViews) {
|
||||
cardView.debugPrint();
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,21 @@
|
||||
#ifndef CARD_LIST_H
|
||||
#define CARD_LIST_H
|
||||
|
||||
#include "edhrec_commander_api_response_card_details.h"
|
||||
#include "edhrec_api_response_card_details.h"
|
||||
|
||||
#include <QJsonArray>
|
||||
#include <QJsonObject>
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
|
||||
class EdhrecCommanderApiResponseCardList
|
||||
class EdhrecApiResponseCardList
|
||||
{
|
||||
public:
|
||||
QString header;
|
||||
QList<EdhrecCommanderApiResponseCardDetails> cardViews;
|
||||
QList<EdhrecApiResponseCardDetails> cardViews;
|
||||
|
||||
// Default constructor
|
||||
EdhrecCommanderApiResponseCardList();
|
||||
EdhrecApiResponseCardList();
|
||||
|
||||
// Method to populate the object from a JSON object
|
||||
void fromJson(const QJsonObject &json);
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef EDHREC_COMMANDER_API_RESPONSE_COMMANDER_DETAILS_H
|
||||
#define EDHREC_COMMANDER_API_RESPONSE_COMMANDER_DETAILS_H
|
||||
|
||||
#include "edhrec_commander_api_response_card_prices.h"
|
||||
#include "../card_prices/edhrec_api_response_card_prices.h"
|
||||
|
||||
#include <QJsonArray>
|
||||
#include <QJsonObject>
|
||||
@@ -1,9 +1,9 @@
|
||||
#ifndef DECKDATA_H
|
||||
#define DECKDATA_H
|
||||
|
||||
#include "edhrec_commander_api_response_archidekt_links.h"
|
||||
#include "../archidekt_links//edhrec_api_response_archidekt_links.h"
|
||||
#include "../cards/edhrec_api_response_card_container.h"
|
||||
#include "edhrec_commander_api_response_average_deck_statistics.h"
|
||||
#include "edhrec_commander_api_response_card_container.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QJsonObject>
|
||||
@@ -19,7 +19,7 @@ public:
|
||||
QString header;
|
||||
QJsonObject panels;
|
||||
QString description;
|
||||
EdhrecCommanderApiResponseCardContainer container;
|
||||
EdhrecApiResponseCardContainer container;
|
||||
|
||||
void fromJson(const QJsonObject &json);
|
||||
void debugPrint() const;
|
||||
@@ -0,0 +1,19 @@
|
||||
#include "edhrec_top_cards_api_response.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QJsonArray>
|
||||
|
||||
void EdhrecTopCardsApiResponse::fromJson(const QJsonObject &json)
|
||||
{
|
||||
header = json.value("header").toString();
|
||||
description = json.value("description").toString();
|
||||
QJsonObject containerJson = json.value("container").toObject();
|
||||
container.fromJson(containerJson);
|
||||
}
|
||||
|
||||
void EdhrecTopCardsApiResponse::debugPrint() const
|
||||
{
|
||||
qDebug() << "Header:" << header;
|
||||
qDebug() << "Description:" << description;
|
||||
container.debugPrint();
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef EDHREC_TOP_CARDS_API_RESPONSE_H
|
||||
#define EDHREC_TOP_CARDS_API_RESPONSE_H
|
||||
|
||||
#include "../cards/edhrec_api_response_card_container.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QString>
|
||||
|
||||
class EdhrecTopCardsApiResponse
|
||||
{
|
||||
public:
|
||||
QString header;
|
||||
QString description;
|
||||
EdhrecApiResponseCardContainer container;
|
||||
|
||||
void fromJson(const QJsonObject &json);
|
||||
void debugPrint() const;
|
||||
};
|
||||
|
||||
#endif // EDHREC_TOP_CARDS_API_RESPONSE_H
|
||||
@@ -0,0 +1,19 @@
|
||||
#include "edhrec_top_commanders_api_response.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QJsonArray>
|
||||
|
||||
void EdhrecTopCommandersApiResponse::fromJson(const QJsonObject &json)
|
||||
{
|
||||
header = json.value("header").toString();
|
||||
description = json.value("description").toString();
|
||||
QJsonObject containerJson = json.value("container").toObject();
|
||||
container.fromJson(containerJson);
|
||||
}
|
||||
|
||||
void EdhrecTopCommandersApiResponse::debugPrint() const
|
||||
{
|
||||
qDebug() << "Header:" << header;
|
||||
qDebug() << "Description:" << description;
|
||||
container.debugPrint();
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef EDHREC_TOP_COMMANDERS_API_RESPONSE_H
|
||||
#define EDHREC_TOP_COMMANDERS_API_RESPONSE_H
|
||||
|
||||
#include "../cards/edhrec_api_response_card_container.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QString>
|
||||
|
||||
class EdhrecTopCommandersApiResponse
|
||||
{
|
||||
public:
|
||||
QString header;
|
||||
QString description;
|
||||
EdhrecApiResponseCardContainer container;
|
||||
|
||||
void fromJson(const QJsonObject &json);
|
||||
void debugPrint() const;
|
||||
};
|
||||
|
||||
#endif // EDHREC_TOP_COMMANDERS_API_RESPONSE_H
|
||||
@@ -0,0 +1,19 @@
|
||||
#include "edhrec_top_tags_api_response.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QJsonArray>
|
||||
|
||||
void EdhrecTopTagsApiResponse::fromJson(const QJsonObject &json)
|
||||
{
|
||||
header = json.value("header").toString();
|
||||
description = json.value("description").toString();
|
||||
QJsonObject containerJson = json.value("container").toObject();
|
||||
container.fromJson(containerJson);
|
||||
}
|
||||
|
||||
void EdhrecTopTagsApiResponse::debugPrint() const
|
||||
{
|
||||
qDebug() << "Header:" << header;
|
||||
qDebug() << "Description:" << description;
|
||||
container.debugPrint();
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef EDHREC_TOP_TAGS_API_RESPONSE_H
|
||||
#define EDHREC_TOP_TAGS_API_RESPONSE_H
|
||||
|
||||
#include "../cards/edhrec_api_response_card_container.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QString>
|
||||
|
||||
class EdhrecTopTagsApiResponse
|
||||
{
|
||||
public:
|
||||
QString header;
|
||||
QString description;
|
||||
EdhrecApiResponseCardContainer container;
|
||||
|
||||
void fromJson(const QJsonObject &json);
|
||||
void debugPrint() const;
|
||||
};
|
||||
|
||||
#endif // EDHREC_TOP_TAGS_API_RESPONSE_H
|
||||
@@ -0,0 +1,66 @@
|
||||
#include "edhrec_api_response_card_prices_display_widget.h"
|
||||
|
||||
EdhrecApiResponseCardPricesDisplayWidget::EdhrecApiResponseCardPricesDisplayWidget(QWidget *parent,
|
||||
const CardPrices &_cardPrices)
|
||||
: QWidget(parent), cardPrices(_cardPrices)
|
||||
{
|
||||
layout = new QGridLayout(this);
|
||||
setLayout(layout);
|
||||
|
||||
cardHoarderLabel = new QLabel(this);
|
||||
cardHoarderPrice = new QLabel(QString::number(cardPrices.getCardhoarder().value("price").toDouble()), this);
|
||||
cardKingdomLabel = new QLabel(this);
|
||||
cardKingdomPrice = new QLabel(QString::number(cardPrices.getCardkingdom().value("price").toDouble()), this);
|
||||
cardMarketLabel = new QLabel(this);
|
||||
cardMarketPrice = new QLabel(QString::number(cardPrices.getCardmarket().value("price").toDouble()), this);
|
||||
face2faceLabel = new QLabel(this);
|
||||
face2facePrice = new QLabel(QString::number(cardPrices.getFace2face().value("price").toDouble()), this);
|
||||
manaPoolLabel = new QLabel(this);
|
||||
manaPoolPrice = new QLabel(QString::number(cardPrices.getManapool().value("price").toDouble()), this);
|
||||
mtgStocksLabel = new QLabel(this);
|
||||
mtgStocksPrice = new QLabel(QString::number(cardPrices.getMtgstocks().value("price").toDouble()), this);
|
||||
scgLabel = new QLabel(this);
|
||||
scgPrice = new QLabel(QString::number(cardPrices.getScg().value("price").toDouble()), this);
|
||||
tcglLabel = new QLabel(this);
|
||||
tcglPrice = new QLabel(QString::number(cardPrices.getTcgl().value("price").toDouble()), this);
|
||||
tcgplayerLabel = new QLabel(this);
|
||||
tcgplayerPrice = new QLabel(QString::number(cardPrices.getTcgplayer().value("price").toDouble()), this);
|
||||
|
||||
layout->addWidget(cardHoarderLabel, 0, 0);
|
||||
layout->addWidget(cardHoarderPrice, 0, 1);
|
||||
layout->addWidget(cardKingdomLabel, 0, 2);
|
||||
layout->addWidget(cardKingdomPrice, 0, 3);
|
||||
|
||||
layout->addWidget(cardMarketLabel, 1, 0);
|
||||
layout->addWidget(cardMarketPrice, 1, 1);
|
||||
layout->addWidget(face2faceLabel, 1, 2);
|
||||
layout->addWidget(face2facePrice, 1, 3);
|
||||
|
||||
layout->addWidget(manaPoolLabel, 2, 0);
|
||||
layout->addWidget(manaPoolPrice, 2, 1);
|
||||
layout->addWidget(mtgStocksLabel, 2, 2);
|
||||
layout->addWidget(mtgStocksPrice, 2, 3);
|
||||
|
||||
layout->addWidget(scgLabel, 3, 0);
|
||||
layout->addWidget(scgPrice, 3, 1);
|
||||
layout->addWidget(tcglLabel, 3, 2);
|
||||
layout->addWidget(tcglPrice, 3, 3);
|
||||
|
||||
layout->addWidget(tcgplayerLabel, 4, 0);
|
||||
layout->addWidget(tcgplayerPrice, 4, 1);
|
||||
|
||||
retranslateUi();
|
||||
}
|
||||
|
||||
void EdhrecApiResponseCardPricesDisplayWidget::retranslateUi()
|
||||
{
|
||||
cardHoarderLabel->setText(tr("Card Hoarder"));
|
||||
cardKingdomLabel->setText(tr("Card Kingdom"));
|
||||
cardMarketLabel->setText(tr("Card Market"));
|
||||
face2faceLabel->setText(tr("Face 2-Face"));
|
||||
manaPoolLabel->setText(tr("Mana Pool"));
|
||||
mtgStocksLabel->setText(tr("MTG Stocks"));
|
||||
scgLabel->setText(tr("Scg"));
|
||||
tcglLabel->setText(tr("Tcgl"));
|
||||
tcgplayerLabel->setText(tr("Tcgplayer"));
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
#ifndef EDHREC_API_RESPONSE_CARD_PRICES_DISPLAY_WIDGET_H
|
||||
#define EDHREC_API_RESPONSE_CARD_PRICES_DISPLAY_WIDGET_H
|
||||
|
||||
#include "../../api_response/card_prices/edhrec_api_response_card_prices.h"
|
||||
|
||||
#include <QGridLayout>
|
||||
#include <QLabel>
|
||||
#include <QWidget>
|
||||
|
||||
class EdhrecApiResponseCardPricesDisplayWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
EdhrecApiResponseCardPricesDisplayWidget(QWidget *parent, const CardPrices &cardPrices);
|
||||
|
||||
public slots:
|
||||
void retranslateUi();
|
||||
|
||||
private:
|
||||
CardPrices cardPrices;
|
||||
QGridLayout *layout;
|
||||
QLabel *cardHoarderLabel;
|
||||
QLabel *cardHoarderPrice;
|
||||
QLabel *cardKingdomLabel;
|
||||
QLabel *cardKingdomPrice;
|
||||
QLabel *cardMarketLabel;
|
||||
QLabel *cardMarketPrice;
|
||||
QLabel *face2faceLabel;
|
||||
QLabel *face2facePrice;
|
||||
QLabel *manaPoolLabel;
|
||||
QLabel *manaPoolPrice;
|
||||
QLabel *mtgStocksLabel;
|
||||
QLabel *mtgStocksPrice;
|
||||
QLabel *scgLabel;
|
||||
QLabel *scgPrice;
|
||||
QLabel *tcglLabel;
|
||||
QLabel *tcglPrice;
|
||||
QLabel *tcgplayerLabel;
|
||||
QLabel *tcgplayerPrice;
|
||||
};
|
||||
|
||||
#endif // EDHREC_API_RESPONSE_CARD_PRICES_DISPLAY_WIDGET_H
|
||||
@@ -0,0 +1,54 @@
|
||||
#include "edhrec_api_response_card_details_display_widget.h"
|
||||
|
||||
#include "../../../../../../game/cards/card_database_manager.h"
|
||||
#include "../../tab_edhrec_main.h"
|
||||
|
||||
EdhrecApiResponseCardDetailsDisplayWidget::EdhrecApiResponseCardDetailsDisplayWidget(
|
||||
QWidget *parent,
|
||||
const EdhrecApiResponseCardDetails &_toDisplay)
|
||||
: QWidget(parent), toDisplay(_toDisplay)
|
||||
{
|
||||
layout = new QVBoxLayout(this);
|
||||
setLayout(layout);
|
||||
|
||||
cardPictureWidget = new CardInfoPictureWidget(this);
|
||||
cardPictureWidget->setCard(CardDatabaseManager::getInstance()->guessCard(toDisplay.sanitized));
|
||||
|
||||
nameLabel = new QLabel(this);
|
||||
nameLabel->setText(toDisplay.name);
|
||||
nameLabel->setAlignment(Qt::AlignHCenter);
|
||||
|
||||
inclusionDisplayWidget = new EdhrecApiResponseCardInclusionDisplayWidget(this, toDisplay);
|
||||
|
||||
synergyDisplayWidget = new EdhrecApiResponseCardSynergyDisplayWidget(this, toDisplay);
|
||||
|
||||
layout->addWidget(nameLabel);
|
||||
layout->addWidget(cardPictureWidget);
|
||||
layout->addWidget(inclusionDisplayWidget);
|
||||
layout->addWidget(synergyDisplayWidget);
|
||||
|
||||
QWidget *currentParent = parentWidget();
|
||||
TabEdhRecMain *parentTab = nullptr;
|
||||
|
||||
while (currentParent) {
|
||||
if ((parentTab = qobject_cast<TabEdhRecMain *>(currentParent))) {
|
||||
break;
|
||||
}
|
||||
currentParent = currentParent->parentWidget();
|
||||
}
|
||||
|
||||
if (parentTab) {
|
||||
cardPictureWidget->setScaleFactor(parentTab->getCardSizeSlider()->getSlider()->value());
|
||||
connect(cardPictureWidget, &CardInfoPictureWidget::cardClicked, this,
|
||||
&EdhrecApiResponseCardDetailsDisplayWidget::actRequestPageNavigation);
|
||||
connect(parentTab->getCardSizeSlider()->getSlider(), &QSlider::valueChanged, cardPictureWidget,
|
||||
&CardInfoPictureWidget::setScaleFactor);
|
||||
connect(this, &EdhrecApiResponseCardDetailsDisplayWidget::requestUrl, parentTab,
|
||||
&TabEdhRecMain::actNavigatePage);
|
||||
}
|
||||
}
|
||||
|
||||
void EdhrecApiResponseCardDetailsDisplayWidget::actRequestPageNavigation()
|
||||
{
|
||||
emit requestUrl(toDisplay.url);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
#ifndef EDHREC_COMMANDER_API_RESPONSE_CARD_DETAILS_DISPLAY_WIDGET_H
|
||||
#define EDHREC_COMMANDER_API_RESPONSE_CARD_DETAILS_DISPLAY_WIDGET_H
|
||||
|
||||
#include "../../../../../ui/widgets/cards/card_info_picture_widget.h"
|
||||
#include "../../api_response/cards/edhrec_api_response_card_details.h"
|
||||
#include "edhrec_api_response_card_inclusion_display_widget.h"
|
||||
#include "edhrec_api_response_card_synergy_display_widget.h"
|
||||
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QWidget>
|
||||
|
||||
class EdhrecApiResponseCardDetailsDisplayWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit EdhrecApiResponseCardDetailsDisplayWidget(QWidget *parent, const EdhrecApiResponseCardDetails &_toDisplay);
|
||||
public slots:
|
||||
void actRequestPageNavigation();
|
||||
signals:
|
||||
void requestUrl(QString url);
|
||||
|
||||
private:
|
||||
EdhrecApiResponseCardDetails toDisplay;
|
||||
QVBoxLayout *layout;
|
||||
CardInfoPictureWidget *cardPictureWidget;
|
||||
QLabel *nameLabel;
|
||||
EdhrecApiResponseCardInclusionDisplayWidget *inclusionDisplayWidget;
|
||||
EdhrecApiResponseCardSynergyDisplayWidget *synergyDisplayWidget;
|
||||
};
|
||||
|
||||
#endif // EDHREC_COMMANDER_API_RESPONSE_CARD_DETAILS_DISPLAY_WIDGET_H
|
||||
@@ -0,0 +1,41 @@
|
||||
#include "edhrec_api_response_card_inclusion_display_widget.h"
|
||||
|
||||
EdhrecApiResponseCardInclusionDisplayWidget::EdhrecApiResponseCardInclusionDisplayWidget(
|
||||
QWidget *parent,
|
||||
const EdhrecApiResponseCardDetails &_toDisplay)
|
||||
: QWidget(parent), toDisplay(_toDisplay)
|
||||
{
|
||||
layout = new QVBoxLayout(this);
|
||||
setLayout(layout);
|
||||
|
||||
commanderLabel = new QLabel(this);
|
||||
commanderLabel->setAlignment(Qt::AlignCenter);
|
||||
amountLabel = new QLabel(this);
|
||||
amountLabel->setAlignment(Qt::AlignCenter);
|
||||
inclusionLabel = new QLabel(this);
|
||||
inclusionLabel->setAlignment(Qt::AlignCenter);
|
||||
percentBarWidget = new PercentBarWidget(this, toDisplay.inclusion / (toDisplay.potentialDecks / 100.0));
|
||||
|
||||
if (toDisplay.inclusion != 0 && toDisplay.potentialDecks != 0) {
|
||||
layout->addWidget(amountLabel);
|
||||
layout->addWidget(inclusionLabel);
|
||||
layout->addWidget(percentBarWidget);
|
||||
commanderLabel->hide();
|
||||
} else {
|
||||
amountLabel->hide();
|
||||
inclusionLabel->hide();
|
||||
percentBarWidget->hide();
|
||||
layout->addWidget(commanderLabel);
|
||||
}
|
||||
|
||||
retranslateUi();
|
||||
}
|
||||
|
||||
void EdhrecApiResponseCardInclusionDisplayWidget::retranslateUi()
|
||||
{
|
||||
commanderLabel->setText(toDisplay.label);
|
||||
amountLabel->setText(tr("In %1 decks").arg(QString::number(toDisplay.inclusion)));
|
||||
inclusionLabel->setText(tr("%1% of %2 decks")
|
||||
.arg(QString::number(toDisplay.inclusion / (toDisplay.potentialDecks / 100.0), 'f', 2),
|
||||
QString::number(toDisplay.potentialDecks)));
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
#ifndef EDHREC_API_RESPONSE_CARD_INCLUSION_DISPLAY_WIDGET_H
|
||||
#define EDHREC_API_RESPONSE_CARD_INCLUSION_DISPLAY_WIDGET_H
|
||||
|
||||
#include "../../../../../ui/widgets/general/display/percent_bar_widget.h"
|
||||
#include "../../api_response/cards/edhrec_api_response_card_details.h"
|
||||
|
||||
#include <QLabel>
|
||||
#include <QVBoxLayout>
|
||||
#include <QWidget>
|
||||
|
||||
class EdhrecApiResponseCardInclusionDisplayWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
EdhrecApiResponseCardInclusionDisplayWidget(QWidget *parent, const EdhrecApiResponseCardDetails &_toDisplay);
|
||||
void retranslateUi();
|
||||
|
||||
private:
|
||||
QVBoxLayout *layout;
|
||||
EdhrecApiResponseCardDetails toDisplay;
|
||||
QLabel *commanderLabel;
|
||||
QLabel *amountLabel;
|
||||
QLabel *inclusionLabel;
|
||||
PercentBarWidget *percentBarWidget;
|
||||
};
|
||||
|
||||
#endif // EDHREC_API_RESPONSE_CARD_INCLUSION_DISPLAY_WIDGET_H
|
||||
@@ -0,0 +1,33 @@
|
||||
#include "edhrec_api_response_card_list_display_widget.h"
|
||||
|
||||
#include "../../../../../ui/widgets/general/display/banner_widget.h"
|
||||
#include "edhrec_api_response_card_details_display_widget.h"
|
||||
|
||||
#include <QLabel>
|
||||
|
||||
EdhrecApiResponseCardListDisplayWidget::EdhrecApiResponseCardListDisplayWidget(QWidget *parent,
|
||||
EdhrecApiResponseCardList toDisplay)
|
||||
: QWidget(parent)
|
||||
{
|
||||
layout = new QVBoxLayout(this);
|
||||
setLayout(layout);
|
||||
|
||||
header = new BannerWidget(this, toDisplay.header);
|
||||
|
||||
flowWidget = new FlowWidget(this, Qt::Horizontal, Qt::ScrollBarAlwaysOff, Qt::ScrollBarAlwaysOff);
|
||||
header->setBuddy(flowWidget);
|
||||
|
||||
foreach (EdhrecApiResponseCardDetails card_detail, toDisplay.cardViews) {
|
||||
auto widget = new EdhrecApiResponseCardDetailsDisplayWidget(flowWidget, card_detail);
|
||||
flowWidget->addWidget(widget);
|
||||
}
|
||||
|
||||
layout->addWidget(header);
|
||||
layout->addWidget(flowWidget);
|
||||
}
|
||||
|
||||
void EdhrecApiResponseCardListDisplayWidget::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
QWidget::resizeEvent(event);
|
||||
qDebug() << event->size();
|
||||
}
|
||||
@@ -1,20 +1,19 @@
|
||||
#ifndef EDHREC_COMMANDER_API_RESPONSE_CARD_LIST_DISPLAY_WIDGET_H
|
||||
#define EDHREC_COMMANDER_API_RESPONSE_CARD_LIST_DISPLAY_WIDGET_H
|
||||
|
||||
#include "../../../ui/widgets/general/display/banner_widget.h"
|
||||
#include "../../../ui/widgets/general/layout_containers/flow_widget.h"
|
||||
#include "api_response/edhrec_commander_api_response_card_list.h"
|
||||
#include "../../../../../ui/widgets/general/display/banner_widget.h"
|
||||
#include "../../../../../ui/widgets/general/layout_containers/flow_widget.h"
|
||||
#include "../../api_response/cards/edhrec_api_response_card_list.h"
|
||||
|
||||
#include <QResizeEvent>
|
||||
#include <QVBoxLayout>
|
||||
#include <QWidget>
|
||||
|
||||
class EdhrecCommanderApiResponseCardListDisplayWidget : public QWidget
|
||||
class EdhrecApiResponseCardListDisplayWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit EdhrecCommanderApiResponseCardListDisplayWidget(QWidget *parent,
|
||||
EdhrecCommanderApiResponseCardList toDisplay);
|
||||
explicit EdhrecApiResponseCardListDisplayWidget(QWidget *parent, EdhrecApiResponseCardList toDisplay);
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
[[nodiscard]] QString getBannerText() const
|
||||
{
|
||||
@@ -0,0 +1,28 @@
|
||||
#include "edhrec_api_response_card_synergy_display_widget.h"
|
||||
|
||||
EdhrecApiResponseCardSynergyDisplayWidget::EdhrecApiResponseCardSynergyDisplayWidget(
|
||||
QWidget *parent,
|
||||
const EdhrecApiResponseCardDetails &_toDisplay)
|
||||
: QWidget(parent), toDisplay(_toDisplay)
|
||||
{
|
||||
layout = new QVBoxLayout(this);
|
||||
setLayout(layout);
|
||||
|
||||
label = new QLabel(this);
|
||||
label->setAlignment(Qt::AlignCenter);
|
||||
percentBarWidget = new PercentBarWidget(this, toDisplay.synergy * 100.0);
|
||||
|
||||
if (toDisplay.synergy != 0) {
|
||||
layout->addWidget(label);
|
||||
layout->addWidget(percentBarWidget);
|
||||
} else {
|
||||
hide();
|
||||
}
|
||||
|
||||
retranslateUi();
|
||||
}
|
||||
|
||||
void EdhrecApiResponseCardSynergyDisplayWidget::retranslateUi()
|
||||
{
|
||||
label->setText(tr("%1% Synergy").arg(QString::number(toDisplay.synergy * 100.0, 'f', 1)));
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
#ifndef EDHREC_API_RESPONSE_CARD_SYNERGY_DISPLAY_WIDGET_H
|
||||
#define EDHREC_API_RESPONSE_CARD_SYNERGY_DISPLAY_WIDGET_H
|
||||
|
||||
#include "../../../../../ui/widgets/general/display/percent_bar_widget.h"
|
||||
#include "../../api_response/cards/edhrec_api_response_card_details.h"
|
||||
|
||||
#include <QLabel>
|
||||
#include <QVBoxLayout>
|
||||
#include <QWidget>
|
||||
|
||||
class EdhrecApiResponseCardSynergyDisplayWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
EdhrecApiResponseCardSynergyDisplayWidget(QWidget *parent, const EdhrecApiResponseCardDetails &_toDisplay);
|
||||
void retranslateUi();
|
||||
|
||||
private:
|
||||
QVBoxLayout *layout;
|
||||
EdhrecApiResponseCardDetails toDisplay;
|
||||
QLabel *label;
|
||||
PercentBarWidget *percentBarWidget;
|
||||
};
|
||||
|
||||
#endif // EDHREC_API_RESPONSE_CARD_SYNERGY_DISPLAY_WIDGET_H
|
||||
@@ -0,0 +1,60 @@
|
||||
#include "edhrec_api_response_commander_details_display_widget.h"
|
||||
|
||||
#include "../../../../../../game/cards/card_database_manager.h"
|
||||
#include "../../../../../ui/widgets/cards/card_info_picture_widget.h"
|
||||
#include "../../tab_edhrec_main.h"
|
||||
#include "../card_prices/edhrec_api_response_card_prices_display_widget.h"
|
||||
|
||||
EdhrecCommanderResponseCommanderDetailsDisplayWidget::EdhrecCommanderResponseCommanderDetailsDisplayWidget(
|
||||
QWidget *parent,
|
||||
const EdhrecCommanderApiResponseCommanderDetails &_commanderDetails,
|
||||
QString baseUrl)
|
||||
: QWidget(parent), commanderDetails(_commanderDetails)
|
||||
{
|
||||
layout = new QVBoxLayout(this);
|
||||
setLayout(layout);
|
||||
|
||||
commanderPicture = new CardInfoPictureWidget(this);
|
||||
commanderPicture->setCard(CardDatabaseManager::getInstance()->getCard(commanderDetails.getName()));
|
||||
|
||||
QWidget *currentParent = parentWidget();
|
||||
TabEdhRecMain *parentTab = nullptr;
|
||||
|
||||
while (currentParent) {
|
||||
if ((parentTab = qobject_cast<TabEdhRecMain *>(currentParent))) {
|
||||
break;
|
||||
}
|
||||
currentParent = currentParent->parentWidget();
|
||||
}
|
||||
|
||||
if (parentTab) {
|
||||
connect(parentTab->getCardSizeSlider()->getSlider(), &QSlider::valueChanged, commanderPicture,
|
||||
&CardInfoPictureWidget::setScaleFactor);
|
||||
commanderPicture->setScaleFactor(parentTab->getCardSizeSlider()->getSlider()->value());
|
||||
}
|
||||
|
||||
commanderDetails.debugPrint();
|
||||
|
||||
label = new QLabel(this);
|
||||
label->setAlignment(Qt::AlignCenter);
|
||||
salt = new QLabel(this);
|
||||
salt->setAlignment(Qt::AlignCenter);
|
||||
|
||||
cardPricesDisplayWidget = new EdhrecApiResponseCardPricesDisplayWidget(this, commanderDetails.getPrices());
|
||||
|
||||
navigationWidget = new EdhrecCommanderApiResponseNavigationWidget(this, commanderDetails, baseUrl);
|
||||
|
||||
layout->addWidget(commanderPicture);
|
||||
layout->addWidget(label);
|
||||
layout->addWidget(salt);
|
||||
layout->addWidget(cardPricesDisplayWidget);
|
||||
layout->addWidget(navigationWidget);
|
||||
|
||||
retranslateUi();
|
||||
}
|
||||
|
||||
void EdhrecCommanderResponseCommanderDetailsDisplayWidget::retranslateUi()
|
||||
{
|
||||
label->setText(commanderDetails.getLabel());
|
||||
salt->setText(tr("Salt: ") + QString::number(commanderDetails.getSalt()));
|
||||
}
|
||||
@@ -1,28 +1,34 @@
|
||||
#ifndef EDHREC_COMMANDER_API_RESPONSE_COMMANDER_DETAILS_DISPLAY_WIDGET_H
|
||||
#define EDHREC_COMMANDER_API_RESPONSE_COMMANDER_DETAILS_DISPLAY_WIDGET_H
|
||||
|
||||
#include "../../../ui/widgets/cards/card_info_picture_widget.h"
|
||||
#include "api_response/edhrec_commander_api_response_commander_details.h"
|
||||
#include "../../../../../ui/widgets/cards/card_info_picture_widget.h"
|
||||
#include "../../api_response/cards/edhrec_commander_api_response_commander_details.h"
|
||||
#include "../card_prices/edhrec_api_response_card_prices_display_widget.h"
|
||||
#include "edhrec_commander_api_response_navigation_widget.h"
|
||||
|
||||
#include <QLabel>
|
||||
#include <QVBoxLayout>
|
||||
#include <QWidget>
|
||||
|
||||
class EdhrecCommanderApiResponseNavigationWidget;
|
||||
class EdhrecCommanderResponseCommanderDetailsDisplayWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit EdhrecCommanderResponseCommanderDetailsDisplayWidget(
|
||||
QWidget *parent,
|
||||
const EdhrecCommanderApiResponseCommanderDetails &_commanderDetails);
|
||||
const EdhrecCommanderApiResponseCommanderDetails &_commanderDetails,
|
||||
QString baseUrl);
|
||||
void retranslateUi();
|
||||
|
||||
private:
|
||||
QLabel *label;
|
||||
QLabel *salt;
|
||||
EdhrecCommanderApiResponseCommanderDetails commanderDetails;
|
||||
QVBoxLayout *layout;
|
||||
CardInfoPictureWidget *commanderPicture;
|
||||
EdhrecCommanderApiResponseCommanderDetails commanderDetails;
|
||||
QLabel *label;
|
||||
QLabel *salt;
|
||||
EdhrecApiResponseCardPricesDisplayWidget *cardPricesDisplayWidget;
|
||||
EdhrecCommanderApiResponseNavigationWidget *navigationWidget;
|
||||
};
|
||||
|
||||
#endif // EDHREC_COMMANDER_API_RESPONSE_COMMANDER_DETAILS_DISPLAY_WIDGET_H
|
||||
@@ -1,9 +1,9 @@
|
||||
#include "edhrec_commander_api_response_display_widget.h"
|
||||
|
||||
#include "../../../ui/widgets/cards/card_info_picture_widget.h"
|
||||
#include "api_response/edhrec_commander_api_response.h"
|
||||
#include "edhrec_commander_api_response_card_list_display_widget.h"
|
||||
#include "edhrec_commander_api_response_commander_details_display_widget.h"
|
||||
#include "../../../../../ui/widgets/cards/card_info_picture_widget.h"
|
||||
#include "../../api_response/commander/edhrec_commander_api_response.h"
|
||||
#include "../cards/edhrec_api_response_card_list_display_widget.h"
|
||||
#include "edhrec_api_response_commander_details_display_widget.h"
|
||||
|
||||
#include <QListView>
|
||||
#include <QResizeEvent>
|
||||
@@ -12,7 +12,8 @@
|
||||
#include <QStringListModel>
|
||||
|
||||
EdhrecCommanderApiResponseDisplayWidget::EdhrecCommanderApiResponseDisplayWidget(QWidget *parent,
|
||||
EdhrecCommanderApiResponse response)
|
||||
EdhrecCommanderApiResponse response,
|
||||
QString baseUrl)
|
||||
: QWidget(parent)
|
||||
{
|
||||
layout = new QHBoxLayout(this);
|
||||
@@ -31,15 +32,15 @@ EdhrecCommanderApiResponseDisplayWidget::EdhrecCommanderApiResponseDisplayWidget
|
||||
QStringList widgetNames;
|
||||
|
||||
// Add commander details
|
||||
auto commanderPicture =
|
||||
new EdhrecCommanderResponseCommanderDetailsDisplayWidget(this, response.container.getCommanderDetails());
|
||||
auto commanderPicture = new EdhrecCommanderResponseCommanderDetailsDisplayWidget(
|
||||
this, response.container.getCommanderDetails(), baseUrl);
|
||||
cardDisplayLayout->addWidget(commanderPicture);
|
||||
widgetNames.append("Commander Details");
|
||||
|
||||
// Add card list widgets
|
||||
auto edhrec_commander_api_response_card_lists = response.container.getCardlists();
|
||||
for (const EdhrecCommanderApiResponseCardList &card_list : edhrec_commander_api_response_card_lists) {
|
||||
auto cardListDisplayWidget = new EdhrecCommanderApiResponseCardListDisplayWidget(this, card_list);
|
||||
for (const EdhrecApiResponseCardList &card_list : edhrec_commander_api_response_card_lists) {
|
||||
auto cardListDisplayWidget = new EdhrecApiResponseCardListDisplayWidget(this, card_list);
|
||||
cardDisplayLayout->addWidget(cardListDisplayWidget);
|
||||
widgetNames.append(cardListDisplayWidget->getBannerText());
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef EDHREC_COMMANDER_API_RESPONSE_DISPLAY_WIDGET_H
|
||||
#define EDHREC_COMMANDER_API_RESPONSE_DISPLAY_WIDGET_H
|
||||
|
||||
#include "api_response/edhrec_commander_api_response.h"
|
||||
#include "../../api_response/commander/edhrec_commander_api_response.h"
|
||||
|
||||
#include <QScrollArea>
|
||||
#include <QVBoxLayout>
|
||||
@@ -12,7 +12,9 @@ class EdhrecCommanderApiResponseDisplayWidget : public QWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit EdhrecCommanderApiResponseDisplayWidget(QWidget *parent, EdhrecCommanderApiResponse response);
|
||||
explicit EdhrecCommanderApiResponseDisplayWidget(QWidget *parent,
|
||||
EdhrecCommanderApiResponse response,
|
||||
QString baseUrl);
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
|
||||
public slots:
|
||||
@@ -0,0 +1,174 @@
|
||||
#include "edhrec_commander_api_response_navigation_widget.h"
|
||||
|
||||
#include "../../tab_edhrec_main.h"
|
||||
|
||||
EdhrecCommanderApiResponseNavigationWidget::EdhrecCommanderApiResponseNavigationWidget(
|
||||
QWidget *parent,
|
||||
const EdhrecCommanderApiResponseCommanderDetails &_commanderDetails,
|
||||
QString baseUrl)
|
||||
: QWidget(parent), commanderDetails(_commanderDetails)
|
||||
{
|
||||
layout = new QGridLayout(this);
|
||||
setLayout(layout);
|
||||
|
||||
gameChangerLabel = new QLabel(this);
|
||||
budgetLabel = new QLabel(this);
|
||||
|
||||
comboPushButton = new QPushButton(this);
|
||||
averageDeckPushButton = new QPushButton(this);
|
||||
|
||||
layout->addWidget(comboPushButton, 0, 0, 1, 1);
|
||||
layout->addWidget(averageDeckPushButton, 0, 1, 1, 1);
|
||||
|
||||
layout->addWidget(gameChangerLabel, 1, 0, 1, 2);
|
||||
|
||||
for (int i = 0; i < gameChangerOptions.length(); i++) {
|
||||
QString option = gameChangerOptions.at(i);
|
||||
QString label = option.isEmpty() ? "All" : option.at(0).toUpper() + option.mid(1);
|
||||
QPushButton *optionButton = new QPushButton(label, this);
|
||||
gameChangerButtons[option] = optionButton;
|
||||
layout->addWidget(optionButton, 2, i);
|
||||
connect(optionButton, &QPushButton::clicked, this, [=, this]() {
|
||||
selectedGameChanger = option;
|
||||
updateOptionButtonSelection(gameChangerButtons, option);
|
||||
actRequestCommanderNavigation();
|
||||
});
|
||||
}
|
||||
|
||||
layout->addWidget(budgetLabel, 3, 0, 1, 2);
|
||||
|
||||
for (int i = 0; i < budgetOptions.length(); i++) {
|
||||
QString option = budgetOptions.at(i);
|
||||
QString label = option.isEmpty() ? "Any" : option.at(0).toUpper() + option.mid(1);
|
||||
QPushButton *btn = new QPushButton(label, this);
|
||||
budgetButtons[option] = btn;
|
||||
layout->addWidget(btn, 4, i);
|
||||
connect(btn, &QPushButton::clicked, this, [=, this]() {
|
||||
selectedBudget = option;
|
||||
updateOptionButtonSelection(budgetButtons, option);
|
||||
actRequestCommanderNavigation();
|
||||
});
|
||||
}
|
||||
|
||||
updateOptionButtonSelection(gameChangerButtons, "");
|
||||
updateOptionButtonSelection(budgetButtons, "");
|
||||
|
||||
QWidget *currentParent = parentWidget();
|
||||
TabEdhRecMain *parentTab = nullptr;
|
||||
|
||||
while (currentParent) {
|
||||
if ((parentTab = qobject_cast<TabEdhRecMain *>(currentParent))) {
|
||||
break;
|
||||
}
|
||||
currentParent = currentParent->parentWidget();
|
||||
}
|
||||
|
||||
if (parentTab) {
|
||||
connect(comboPushButton, &QPushButton::clicked, this,
|
||||
&EdhrecCommanderApiResponseNavigationWidget::actRequestComboNavigation);
|
||||
connect(averageDeckPushButton, &QPushButton::clicked, this,
|
||||
&EdhrecCommanderApiResponseNavigationWidget::actRequestAverageDeckNavigation);
|
||||
connect(this, &EdhrecCommanderApiResponseNavigationWidget::requestUrl, parentTab,
|
||||
&TabEdhRecMain::actNavigatePage);
|
||||
}
|
||||
|
||||
retranslateUi();
|
||||
applyOptionsFromUrl(baseUrl);
|
||||
}
|
||||
|
||||
void EdhrecCommanderApiResponseNavigationWidget::retranslateUi()
|
||||
{
|
||||
comboPushButton->setText(tr("Combos"));
|
||||
averageDeckPushButton->setText(tr("Average Deck"));
|
||||
gameChangerLabel->setText(tr("Game Changers"));
|
||||
budgetLabel->setText(tr("Budget"));
|
||||
}
|
||||
|
||||
void EdhrecCommanderApiResponseNavigationWidget::applyOptionsFromUrl(const QString &url)
|
||||
{
|
||||
QString cleanedUrl = url;
|
||||
|
||||
// Remove base and file extension
|
||||
if (cleanedUrl.startsWith("https://json.edhrec.com/pages/")) {
|
||||
cleanedUrl = cleanedUrl.mid(QString("https://json.edhrec.com/pages/").length());
|
||||
}
|
||||
if (cleanedUrl.endsWith(".json")) {
|
||||
cleanedUrl.chop(5);
|
||||
}
|
||||
|
||||
// Expecting something like: "commanders/the-ur-dragon/core/expensive"
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
QStringList parts = cleanedUrl.split('/', Qt::SkipEmptyParts);
|
||||
#else
|
||||
QStringList parts = cleanedUrl.split('/', QString::SkipEmptyParts);
|
||||
#endif
|
||||
|
||||
if (parts.size() < 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
QString commanderName = parts[1];
|
||||
QString gameChangerOpt, budgetOpt;
|
||||
|
||||
// Define valid sets
|
||||
QSet<QString> validGameChangers = {"core", "upgraded", "optimized"};
|
||||
QSet<QString> validBudgets = {"budget", "expensive"};
|
||||
|
||||
// Check remaining parts after commander
|
||||
for (int i = 2; i < parts.size(); ++i) {
|
||||
QString part = parts[i].toLower();
|
||||
if (validGameChangers.contains(part)) {
|
||||
gameChangerOpt = part;
|
||||
} else if (validBudgets.contains(part)) {
|
||||
budgetOpt = part;
|
||||
}
|
||||
}
|
||||
|
||||
// Validate and apply
|
||||
if (!gameChangerButtons.contains(gameChangerOpt)) {
|
||||
gameChangerOpt.clear();
|
||||
}
|
||||
if (!budgetButtons.contains(budgetOpt)) {
|
||||
budgetOpt.clear();
|
||||
}
|
||||
|
||||
selectedGameChanger = gameChangerOpt;
|
||||
selectedBudget = budgetOpt;
|
||||
|
||||
updateOptionButtonSelection(gameChangerButtons, selectedGameChanger);
|
||||
updateOptionButtonSelection(budgetButtons, selectedBudget);
|
||||
}
|
||||
|
||||
void EdhrecCommanderApiResponseNavigationWidget::updateOptionButtonSelection(QMap<QString, QPushButton *> &buttons,
|
||||
const QString &selectedKey)
|
||||
{
|
||||
for (auto it = buttons.begin(); it != buttons.end(); ++it) {
|
||||
it.value()->setStyleSheet(it.key() == selectedKey ? "background-color: lightblue; font-weight: bold;" : "");
|
||||
}
|
||||
}
|
||||
|
||||
QString EdhrecCommanderApiResponseNavigationWidget::addNavigationOptionsToUrl(QString baseUrl)
|
||||
{
|
||||
if (!selectedGameChanger.isEmpty()) {
|
||||
baseUrl += "/" + selectedGameChanger;
|
||||
}
|
||||
if (!selectedBudget.isEmpty()) {
|
||||
baseUrl += "/" + selectedBudget;
|
||||
}
|
||||
return baseUrl;
|
||||
}
|
||||
|
||||
void EdhrecCommanderApiResponseNavigationWidget::actRequestCommanderNavigation()
|
||||
{
|
||||
emit requestUrl(addNavigationOptionsToUrl("/commanders/" + commanderDetails.getSanitized()));
|
||||
}
|
||||
|
||||
void EdhrecCommanderApiResponseNavigationWidget::actRequestComboNavigation()
|
||||
{
|
||||
emit requestUrl("/combos/" + commanderDetails.getSanitized());
|
||||
}
|
||||
|
||||
void EdhrecCommanderApiResponseNavigationWidget::actRequestAverageDeckNavigation()
|
||||
{
|
||||
emit requestUrl(addNavigationOptionsToUrl("/average-decks/" + commanderDetails.getSanitized()));
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
#ifndef EDHREC_COMMANDER_API_RESPONSE_NAVIGATION_WIDGET_H
|
||||
#define EDHREC_COMMANDER_API_RESPONSE_NAVIGATION_WIDGET_H
|
||||
|
||||
#include "edhrec_api_response_commander_details_display_widget.h"
|
||||
|
||||
#include <QGridLayout>
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
#include <QWidget>
|
||||
|
||||
class EdhrecCommanderApiResponseNavigationWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit EdhrecCommanderApiResponseNavigationWidget(
|
||||
QWidget *parent,
|
||||
const EdhrecCommanderApiResponseCommanderDetails &_commanderDetails,
|
||||
QString baseUrl);
|
||||
void retranslateUi();
|
||||
void applyOptionsFromUrl(const QString &url);
|
||||
|
||||
public slots:
|
||||
void actRequestCommanderNavigation();
|
||||
void actRequestComboNavigation();
|
||||
void actRequestAverageDeckNavigation();
|
||||
signals:
|
||||
void requestUrl(QString url);
|
||||
|
||||
private:
|
||||
QGridLayout *layout;
|
||||
|
||||
QLabel *gameChangerLabel;
|
||||
QLabel *budgetLabel;
|
||||
|
||||
QStringList gameChangerOptions = {"", "core", "upgraded", "optimized"};
|
||||
QStringList budgetOptions = {"", "budget", "expensive"};
|
||||
|
||||
QString selectedGameChanger;
|
||||
QString selectedBudget;
|
||||
|
||||
QMap<QString, QPushButton *> gameChangerButtons;
|
||||
QMap<QString, QPushButton *> budgetButtons;
|
||||
|
||||
QPushButton *comboPushButton;
|
||||
QPushButton *averageDeckPushButton;
|
||||
|
||||
EdhrecCommanderApiResponseCommanderDetails commanderDetails;
|
||||
|
||||
void updateOptionButtonSelection(QMap<QString, QPushButton *> &buttons, const QString &selectedKey);
|
||||
QString addNavigationOptionsToUrl(QString baseUrl);
|
||||
QString buildComboUrl() const;
|
||||
};
|
||||
|
||||
#endif // EDHREC_COMMANDER_API_RESPONSE_NAVIGATION_WIDGET_H
|
||||
@@ -0,0 +1,45 @@
|
||||
#include "edhrec_top_cards_api_response_display_widget.h"
|
||||
|
||||
#include "../../api_response/top_cards/edhrec_top_cards_api_response.h"
|
||||
#include "../cards/edhrec_api_response_card_list_display_widget.h"
|
||||
|
||||
EdhrecTopCardsApiResponseDisplayWidget::EdhrecTopCardsApiResponseDisplayWidget(QWidget *parent,
|
||||
EdhrecTopCardsApiResponse response)
|
||||
: QWidget(parent)
|
||||
{
|
||||
layout = new QHBoxLayout(this);
|
||||
setLayout(layout);
|
||||
|
||||
cardDisplayLayout = new QVBoxLayout(this);
|
||||
|
||||
// Add card list widgets
|
||||
auto edhrec_commander_api_response_card_lists = response.container.getCardlists();
|
||||
for (const EdhrecApiResponseCardList &card_list : edhrec_commander_api_response_card_lists) {
|
||||
auto cardListDisplayWidget = new EdhrecApiResponseCardListDisplayWidget(this, card_list);
|
||||
cardDisplayLayout->addWidget(cardListDisplayWidget);
|
||||
}
|
||||
|
||||
// Create a QScrollArea to hold the card display widgets
|
||||
scrollArea = new QScrollArea(this);
|
||||
scrollArea->setWidgetResizable(true);
|
||||
scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||
scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
|
||||
// Set the cardDisplayLayout inside the scroll area
|
||||
auto scrollWidget = new QWidget(scrollArea);
|
||||
scrollWidget->setLayout(cardDisplayLayout);
|
||||
scrollArea->setWidget(scrollWidget);
|
||||
|
||||
layout->addWidget(scrollArea);
|
||||
}
|
||||
|
||||
void EdhrecTopCardsApiResponseDisplayWidget::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
QWidget::resizeEvent(event);
|
||||
layout->invalidate();
|
||||
layout->activate();
|
||||
layout->update();
|
||||
if (scrollArea && scrollArea->widget()) {
|
||||
scrollArea->widget()->resize(event->size());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
#ifndef EDHREC_TOP_CARDS_API_RESPONSE_DISPLAY_WIDGET_H
|
||||
#define EDHREC_TOP_CARDS_API_RESPONSE_DISPLAY_WIDGET_H
|
||||
|
||||
#include "../../api_response/top_cards/edhrec_top_cards_api_response.h"
|
||||
|
||||
#include <QResizeEvent>
|
||||
#include <QScrollArea>
|
||||
#include <QVBoxLayout>
|
||||
#include <QWidget>
|
||||
|
||||
class EdhrecTopCardsApiResponseDisplayWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit EdhrecTopCardsApiResponseDisplayWidget(QWidget *parent, EdhrecTopCardsApiResponse response);
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
|
||||
private:
|
||||
QHBoxLayout *layout;
|
||||
QVBoxLayout *cardDisplayLayout;
|
||||
QScrollArea *scrollArea;
|
||||
};
|
||||
|
||||
#endif // EDHREC_TOP_CARDS_API_RESPONSE_DISPLAY_WIDGET_H
|
||||
@@ -0,0 +1,47 @@
|
||||
#include "edhrec_top_commanders_api_response_display_widget.h"
|
||||
|
||||
#include "../../api_response/top_commanders/edhrec_top_commanders_api_response.h"
|
||||
#include "../cards/edhrec_api_response_card_list_display_widget.h"
|
||||
|
||||
EdhrecTopCommandersApiResponseDisplayWidget::EdhrecTopCommandersApiResponseDisplayWidget(
|
||||
QWidget *parent,
|
||||
EdhrecTopCommandersApiResponse response)
|
||||
: QWidget(parent)
|
||||
{
|
||||
layout = new QHBoxLayout(this);
|
||||
setLayout(layout);
|
||||
|
||||
cardDisplayLayout = new QVBoxLayout(this);
|
||||
|
||||
// Add card list widgets
|
||||
auto edhrec_commander_api_response_card_lists = response.container.getCardlists();
|
||||
for (const EdhrecApiResponseCardList &card_list : edhrec_commander_api_response_card_lists) {
|
||||
auto cardListDisplayWidget = new EdhrecApiResponseCardListDisplayWidget(this, card_list);
|
||||
cardDisplayLayout->addWidget(cardListDisplayWidget);
|
||||
}
|
||||
|
||||
// Create a QScrollArea to hold the card display widgets
|
||||
scrollArea = new QScrollArea(this);
|
||||
scrollArea->setWidgetResizable(true);
|
||||
scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||
scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
|
||||
// Set the cardDisplayLayout inside the scroll area
|
||||
auto scrollWidget = new QWidget(scrollArea);
|
||||
scrollWidget->setLayout(cardDisplayLayout);
|
||||
scrollArea->setWidget(scrollWidget);
|
||||
|
||||
layout->addWidget(scrollArea);
|
||||
}
|
||||
|
||||
void EdhrecTopCommandersApiResponseDisplayWidget::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
QWidget::resizeEvent(event);
|
||||
qDebug() << event->size();
|
||||
layout->invalidate();
|
||||
layout->activate();
|
||||
layout->update();
|
||||
if (scrollArea && scrollArea->widget()) {
|
||||
scrollArea->widget()->resize(event->size());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
#ifndef EDHREC_TOP_COMMANDERS_API_RESPONSE_DISPLAY_WIDGET_H
|
||||
#define EDHREC_TOP_COMMANDERS_API_RESPONSE_DISPLAY_WIDGET_H
|
||||
|
||||
#include "../../api_response/top_commanders/edhrec_top_commanders_api_response.h"
|
||||
|
||||
#include <QResizeEvent>
|
||||
#include <QScrollArea>
|
||||
#include <QVBoxLayout>
|
||||
#include <QWidget>
|
||||
|
||||
class EdhrecTopCommandersApiResponseDisplayWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit EdhrecTopCommandersApiResponseDisplayWidget(QWidget *parent, EdhrecTopCommandersApiResponse response);
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
|
||||
private:
|
||||
QHBoxLayout *layout;
|
||||
QVBoxLayout *cardDisplayLayout;
|
||||
QScrollArea *scrollArea;
|
||||
};
|
||||
|
||||
#endif // EDHREC_TOP_COMMANDERS_API_RESPONSE_DISPLAY_WIDGET_H
|
||||
@@ -0,0 +1,45 @@
|
||||
#include "edhrec_top_tags_api_response_display_widget.h"
|
||||
|
||||
#include "../../api_response/top_tags/edhrec_top_tags_api_response.h"
|
||||
#include "../cards/edhrec_api_response_card_list_display_widget.h"
|
||||
|
||||
EdhrecTopTagsApiResponseDisplayWidget::EdhrecTopTagsApiResponseDisplayWidget(QWidget *parent,
|
||||
EdhrecTopTagsApiResponse response)
|
||||
: QWidget(parent)
|
||||
{
|
||||
layout = new QHBoxLayout(this);
|
||||
setLayout(layout);
|
||||
|
||||
cardDisplayLayout = new QVBoxLayout(this);
|
||||
|
||||
// Add card list widgets
|
||||
auto edhrec_commander_api_response_card_lists = response.container.getCardlists();
|
||||
for (const EdhrecApiResponseCardList &card_list : edhrec_commander_api_response_card_lists) {
|
||||
auto cardListDisplayWidget = new EdhrecApiResponseCardListDisplayWidget(this, card_list);
|
||||
cardDisplayLayout->addWidget(cardListDisplayWidget);
|
||||
}
|
||||
|
||||
// Create a QScrollArea to hold the card display widgets
|
||||
scrollArea = new QScrollArea(this);
|
||||
scrollArea->setWidgetResizable(true);
|
||||
scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||
scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
|
||||
// Set the cardDisplayLayout inside the scroll area
|
||||
auto scrollWidget = new QWidget(scrollArea);
|
||||
scrollWidget->setLayout(cardDisplayLayout);
|
||||
scrollArea->setWidget(scrollWidget);
|
||||
|
||||
layout->addWidget(scrollArea);
|
||||
}
|
||||
|
||||
void EdhrecTopTagsApiResponseDisplayWidget::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
QWidget::resizeEvent(event);
|
||||
layout->invalidate();
|
||||
layout->activate();
|
||||
layout->update();
|
||||
if (scrollArea && scrollArea->widget()) {
|
||||
scrollArea->widget()->resize(event->size());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
#ifndef EDHREC_TOP_TAGS_API_RESPONSE_DISPLAY_WIDGET_H
|
||||
#define EDHREC_TOP_TAGS_API_RESPONSE_DISPLAY_WIDGET_H
|
||||
|
||||
#include "../../api_response/top_tags/edhrec_top_tags_api_response.h"
|
||||
|
||||
#include <QResizeEvent>
|
||||
#include <QScrollArea>
|
||||
#include <QVBoxLayout>
|
||||
#include <QWidget>
|
||||
|
||||
class EdhrecTopTagsApiResponseDisplayWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit EdhrecTopTagsApiResponseDisplayWidget(QWidget *parent, EdhrecTopTagsApiResponse response);
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
|
||||
private:
|
||||
QHBoxLayout *layout;
|
||||
QVBoxLayout *cardDisplayLayout;
|
||||
QScrollArea *scrollArea;
|
||||
};
|
||||
|
||||
#endif // EDHREC_TOP_TAGS_API_RESPONSE_DISPLAY_WIDGET_H
|
||||
@@ -1,41 +0,0 @@
|
||||
#include "edhrec_commander_api_response_card_details_display_widget.h"
|
||||
|
||||
#include "../../../../game/cards/card_database_manager.h"
|
||||
|
||||
EdhrecCommanderApiResponseCardDetailsDisplayWidget::EdhrecCommanderApiResponseCardDetailsDisplayWidget(
|
||||
QWidget *parent,
|
||||
const EdhrecCommanderApiResponseCardDetails &_toDisplay)
|
||||
: QWidget(parent), toDisplay(_toDisplay)
|
||||
{
|
||||
layout = new QVBoxLayout(this);
|
||||
setLayout(layout);
|
||||
|
||||
cardPictureWidget = new CardInfoPictureWidget(this);
|
||||
cardPictureWidget->setCard(CardDatabaseManager::getInstance()->getCard(toDisplay.name));
|
||||
|
||||
label = new QLabel(this);
|
||||
label->setText(toDisplay.name + "\n" + toDisplay.label);
|
||||
label->setAlignment(Qt::AlignHCenter);
|
||||
|
||||
// Set label color based on inclusion rate
|
||||
int inclusionRate = (toDisplay.numDecks * 100) / toDisplay.potentialDecks;
|
||||
|
||||
QColor labelColor;
|
||||
if (inclusionRate <= 30) {
|
||||
labelColor = QColor(255, 0, 0); // Red
|
||||
} else if (inclusionRate <= 60) {
|
||||
int red = 255 - ((inclusionRate - 30) * 2);
|
||||
int green = (inclusionRate - 30) * 4; // Adjust green to make the transition smoother
|
||||
labelColor = QColor(red, green, 0); // purple-ish
|
||||
} else if (inclusionRate <= 90) {
|
||||
int green = (inclusionRate - 60) * 5; // Increase green
|
||||
labelColor = QColor(100, green, 100); // Green shades
|
||||
} else {
|
||||
labelColor = QColor(100, 200, 100); // Dark Green
|
||||
}
|
||||
|
||||
label->setStyleSheet(QString("color: %1").arg(labelColor.name()));
|
||||
|
||||
layout->addWidget(cardPictureWidget);
|
||||
layout->addWidget(label);
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
#ifndef EDHREC_COMMANDER_API_RESPONSE_CARD_DETAILS_DISPLAY_WIDGET_H
|
||||
#define EDHREC_COMMANDER_API_RESPONSE_CARD_DETAILS_DISPLAY_WIDGET_H
|
||||
|
||||
#include "../../../ui/widgets/cards/card_info_picture_widget.h"
|
||||
#include "api_response/edhrec_commander_api_response_card_details.h"
|
||||
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QWidget>
|
||||
|
||||
class EdhrecCommanderApiResponseCardDetailsDisplayWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit EdhrecCommanderApiResponseCardDetailsDisplayWidget(
|
||||
QWidget *parent,
|
||||
const EdhrecCommanderApiResponseCardDetails &_toDisplay);
|
||||
|
||||
private:
|
||||
EdhrecCommanderApiResponseCardDetails toDisplay;
|
||||
QVBoxLayout *layout;
|
||||
CardInfoPictureWidget *cardPictureWidget;
|
||||
QLabel *label;
|
||||
};
|
||||
|
||||
#endif // EDHREC_COMMANDER_API_RESPONSE_CARD_DETAILS_DISPLAY_WIDGET_H
|
||||
@@ -1,34 +0,0 @@
|
||||
#include "edhrec_commander_api_response_card_list_display_widget.h"
|
||||
|
||||
#include "../../../ui/widgets/general/display/banner_widget.h"
|
||||
#include "edhrec_commander_api_response_card_details_display_widget.h"
|
||||
|
||||
#include <QLabel>
|
||||
|
||||
EdhrecCommanderApiResponseCardListDisplayWidget::EdhrecCommanderApiResponseCardListDisplayWidget(
|
||||
QWidget *parent,
|
||||
EdhrecCommanderApiResponseCardList toDisplay)
|
||||
: QWidget(parent)
|
||||
{
|
||||
layout = new QVBoxLayout(this);
|
||||
setLayout(layout);
|
||||
|
||||
header = new BannerWidget(this, toDisplay.header);
|
||||
|
||||
flowWidget = new FlowWidget(this, Qt::Horizontal, Qt::ScrollBarAlwaysOff, Qt::ScrollBarAlwaysOff);
|
||||
header->setBuddy(flowWidget);
|
||||
|
||||
foreach (EdhrecCommanderApiResponseCardDetails card_detail, toDisplay.cardViews) {
|
||||
auto widget = new EdhrecCommanderApiResponseCardDetailsDisplayWidget(flowWidget, card_detail);
|
||||
flowWidget->addWidget(widget);
|
||||
}
|
||||
|
||||
layout->addWidget(header);
|
||||
layout->addWidget(flowWidget);
|
||||
}
|
||||
|
||||
void EdhrecCommanderApiResponseCardListDisplayWidget::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
QWidget::resizeEvent(event);
|
||||
qDebug() << event->size();
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
#include "edhrec_commander_api_response_commander_details_display_widget.h"
|
||||
|
||||
#include "../../../../game/cards/card_database_manager.h"
|
||||
#include "../../../ui/widgets/cards/card_info_picture_widget.h"
|
||||
|
||||
#include <QLabel>
|
||||
|
||||
EdhrecCommanderResponseCommanderDetailsDisplayWidget::EdhrecCommanderResponseCommanderDetailsDisplayWidget(
|
||||
QWidget *parent,
|
||||
const EdhrecCommanderApiResponseCommanderDetails &_commanderDetails)
|
||||
: QWidget(parent), commanderDetails(_commanderDetails)
|
||||
{
|
||||
layout = new QVBoxLayout(this);
|
||||
setLayout(layout);
|
||||
|
||||
commanderPicture = new CardInfoPictureWidget(this);
|
||||
commanderPicture->setCard(CardDatabaseManager::getInstance()->getCard(commanderDetails.getName()));
|
||||
|
||||
commanderDetails.debugPrint();
|
||||
|
||||
label = new QLabel(this);
|
||||
label->setAlignment(Qt::AlignCenter);
|
||||
salt = new QLabel(this);
|
||||
salt->setAlignment(Qt::AlignCenter);
|
||||
|
||||
layout->addWidget(commanderPicture);
|
||||
layout->addWidget(label);
|
||||
layout->addWidget(salt);
|
||||
retranslateUi();
|
||||
}
|
||||
|
||||
void EdhrecCommanderResponseCommanderDetailsDisplayWidget::retranslateUi()
|
||||
{
|
||||
label->setText(commanderDetails.getLabel());
|
||||
salt->setText(tr("Salt: ") + QString::number(commanderDetails.getSalt()));
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "tab_edhrec.h"
|
||||
|
||||
#include "api_response/edhrec_commander_api_response.h"
|
||||
#include "edhrec_commander_api_response_display_widget.h"
|
||||
#include "api_response/commander/edhrec_commander_api_response.h"
|
||||
#include "display/commander/edhrec_commander_api_response_display_widget.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QHBoxLayout>
|
||||
@@ -21,7 +21,7 @@ TabEdhRec::TabEdhRec(TabSupervisor *_tabSupervisor) : Tab(_tabSupervisor)
|
||||
#endif
|
||||
|
||||
networkManager->setRedirectPolicy(QNetworkRequest::ManualRedirectPolicy);
|
||||
connect(networkManager, SIGNAL(finished(QNetworkReply *)), this, SLOT(processApiJson(QNetworkReply *)));
|
||||
connect(networkManager, &QNetworkAccessManager::finished, this, &TabEdhRec::processApiJson);
|
||||
}
|
||||
|
||||
void TabEdhRec::retranslateUi()
|
||||
@@ -76,7 +76,7 @@ void TabEdhRec::processApiJson(QNetworkReply *reply)
|
||||
EdhrecCommanderApiResponse deckData;
|
||||
deckData.fromJson(jsonObj);
|
||||
|
||||
displayWidget = new EdhrecCommanderApiResponseDisplayWidget(this, deckData);
|
||||
displayWidget = new EdhrecCommanderApiResponseDisplayWidget(this, deckData, reply->url().toString());
|
||||
// flowWidget->addWidget(displayWidget);
|
||||
setCentralWidget(displayWidget);
|
||||
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
#ifndef TAB_EDHREC_H
|
||||
#define TAB_EDHREC_H
|
||||
|
||||
#include "../../../../game/cards/card_database.h"
|
||||
#include "../../../../game/cards/card_info.h"
|
||||
#include "../../../ui/widgets/general/layout_containers/flow_widget.h"
|
||||
#include "../../tab.h"
|
||||
#include "edhrec_commander_api_response_display_widget.h"
|
||||
#include "display/commander/edhrec_commander_api_response_display_widget.h"
|
||||
|
||||
#include <QHBoxLayout>
|
||||
#include <QNetworkAccessManager>
|
||||
|
||||
class TabEdhRec : public Tab
|
||||
|
||||