Compare commits
636 Commits
2016-02-03
...
card_auto_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2e0944b7cc | ||
|
|
4cdd17945d | ||
|
|
c06fc562a1 | ||
|
|
73fb9ee03e | ||
|
|
4e10ce7473 | ||
|
|
a7f4aace9c | ||
|
|
9727699e26 | ||
|
|
2520d07ef2 | ||
|
|
661e00f563 | ||
|
|
2780270911 | ||
|
|
8a5baa4637 | ||
|
|
f5eb05b682 | ||
|
|
f309ddf28a | ||
|
|
67a2a8cf08 | ||
|
|
1fbdea0f35 | ||
|
|
cc2a0fa0d0 | ||
|
|
034e79dd36 | ||
|
|
5c03f18c72 | ||
|
|
61e509585f | ||
|
|
0c10b66a2d | ||
|
|
7758145e71 | ||
|
|
37ab7b8fb1 | ||
|
|
42d15c39a0 | ||
|
|
a0d84114de | ||
|
|
706054ea96 | ||
|
|
7d5a33b12c | ||
|
|
a056a882c3 | ||
|
|
f89f6438c9 | ||
|
|
e25b7e9eb8 | ||
|
|
ca2e05952e | ||
|
|
2fcb02cadd | ||
|
|
e1394bd851 | ||
|
|
6374d157fc | ||
|
|
5df547ee53 | ||
|
|
2a9d76f090 | ||
|
|
5859fa2f20 | ||
|
|
312caae062 | ||
|
|
281e52eaa9 | ||
|
|
66958b5975 | ||
|
|
941a06e107 | ||
|
|
7cfbf114b7 | ||
|
|
2409eae940 | ||
|
|
3d2c7b6670 | ||
|
|
65ef66cfa7 | ||
|
|
019295931a | ||
|
|
c8a10a9997 | ||
|
|
4e8a09517c | ||
|
|
f302154df7 | ||
|
|
11ad677fe8 | ||
|
|
8084ab605f | ||
|
|
af5a04abf1 | ||
|
|
3426a6b201 | ||
|
|
51eeac0541 | ||
|
|
2206328406 | ||
|
|
501e82f712 | ||
|
|
ab3989aeba | ||
|
|
a0d6a342d3 | ||
|
|
35159ef61a | ||
|
|
fcfb2b12b7 | ||
|
|
4cbec71882 | ||
|
|
b58aa459a4 | ||
|
|
8a8b580501 | ||
|
|
c9525af624 | ||
|
|
aba47719b2 | ||
|
|
b6b4d7e4a0 | ||
|
|
63d0f5af43 | ||
|
|
517420cccb | ||
|
|
3e418ba3c6 | ||
|
|
c1bd50f186 | ||
|
|
d13cf65a10 | ||
|
|
994a643d9c | ||
|
|
e127cb74b6 | ||
|
|
3c3e6ae68a | ||
|
|
b29bd9e070 | ||
|
|
8dbdd24c8e | ||
|
|
04ab3d7f13 | ||
|
|
03d0a84ef5 | ||
|
|
14a0c53fc1 | ||
|
|
da7c7c1f83 | ||
|
|
261d3ac591 | ||
|
|
55029b6b68 | ||
|
|
bc52882ac4 | ||
|
|
d1b95aad16 | ||
|
|
691bf36fbe | ||
|
|
5a823becf1 | ||
|
|
feeaba1d62 | ||
|
|
ebec30dd1c | ||
|
|
5757d60b1d | ||
|
|
81fcc3c11a | ||
|
|
34bec90193 | ||
|
|
dcc632e0d4 | ||
|
|
7a150c558d | ||
|
|
3a11aebb21 | ||
|
|
8825e2932a | ||
|
|
cd558a9722 | ||
|
|
cc822dd8df | ||
|
|
6fc1aaef90 | ||
|
|
c8122c94ef | ||
|
|
e6e6932dbb | ||
|
|
d124e6ac22 | ||
|
|
7efab80d9b | ||
|
|
d19744236e | ||
|
|
51ec593759 | ||
|
|
87c978937d | ||
|
|
dfaa85847c | ||
|
|
74dbf75c5b | ||
|
|
f0f73c8f77 | ||
|
|
3af2be4539 | ||
|
|
5b8e0dc8ec | ||
|
|
b75882b6b9 | ||
|
|
2abfd3b4a9 | ||
|
|
014b9947fe | ||
|
|
ec4e6d53df | ||
|
|
0eae4dbe54 | ||
|
|
297f1f2555 | ||
|
|
7e80f4b4ae | ||
|
|
6e24f59826 | ||
|
|
5e00faed5d | ||
|
|
6c038a91e4 | ||
|
|
4d641eb0e7 | ||
|
|
59824cf4dd | ||
|
|
b615b5b33e | ||
|
|
3dc2526f0a | ||
|
|
6bc39a4f6f | ||
|
|
422c899cdb | ||
|
|
e96a250bf1 | ||
|
|
563e96e051 | ||
|
|
4baaf978f5 | ||
|
|
6b6ba9a8f1 | ||
|
|
fcb0daf80f | ||
|
|
a3ca459526 | ||
|
|
17202e8dba | ||
|
|
ff6b0f86ec | ||
|
|
96b30da492 | ||
|
|
9cbdc4195e | ||
|
|
ada262b826 | ||
|
|
78e299fdfd | ||
|
|
cf5cd21c50 | ||
|
|
b684c12964 | ||
|
|
df8c38b649 | ||
|
|
1424de2c54 | ||
|
|
7875407795 | ||
|
|
ef89104503 | ||
|
|
ccee0aa3fd | ||
|
|
a6d3229e74 | ||
|
|
93d8ac10ff | ||
|
|
04d84f9d9a | ||
|
|
2557a2183d | ||
|
|
e694cbe854 | ||
|
|
3963570838 | ||
|
|
dd05b86bc9 | ||
|
|
af3423e67d | ||
|
|
7c8daf68ea | ||
|
|
6b1ea9186a | ||
|
|
e90c389212 | ||
|
|
556d19ff70 | ||
|
|
838ab888db | ||
|
|
1cb3d88e35 | ||
|
|
1366e5970e | ||
|
|
1565309146 | ||
|
|
b05ed0376a | ||
|
|
61893faf3b | ||
|
|
e8dbdc3c6d | ||
|
|
5abfda49be | ||
|
|
bcda502b46 | ||
|
|
03bb02f75b | ||
|
|
bfcc48f5bf | ||
|
|
ae15f5df06 | ||
|
|
029a4a39ad | ||
|
|
9ddb18a35e | ||
|
|
2094910b7a | ||
|
|
b36c349f9b | ||
|
|
99e7458f9b | ||
|
|
0a57229886 | ||
|
|
f3f83882e0 | ||
|
|
d970b9e50f | ||
|
|
b0d8a31a2e | ||
|
|
03a7a9fafb | ||
|
|
4c953acebc | ||
|
|
c5ac61c797 | ||
|
|
f75caa7245 | ||
|
|
87060dc5c7 | ||
|
|
62681f7f8d | ||
|
|
b53cd33eed | ||
|
|
405a719412 | ||
|
|
aca6917d42 | ||
|
|
73e2c3d32f | ||
|
|
7f273b547b | ||
|
|
77e0cddbae | ||
|
|
d9230d6c6b | ||
|
|
f00bcc9179 | ||
|
|
b47e262e7f | ||
|
|
1811bad835 | ||
|
|
41ebf7a9ad | ||
|
|
7f01f921f7 | ||
|
|
d347e54526 | ||
|
|
256e40a9ee | ||
|
|
5f4490ec4e | ||
|
|
2fb2481211 | ||
|
|
d585b9f1d6 | ||
|
|
c745f41cb9 | ||
|
|
5b07f6d6d8 | ||
|
|
39779be7bb | ||
|
|
70f1c97a27 | ||
|
|
a49373eded | ||
|
|
55dcf4a845 | ||
|
|
b140721d50 | ||
|
|
c96f234b6d | ||
|
|
a4e78bbfa2 | ||
|
|
fd3d62284d | ||
|
|
16bc8b764b | ||
|
|
36f6907fa3 | ||
|
|
339945e089 | ||
|
|
faeb3f8daf | ||
|
|
e04010f00b | ||
|
|
cbd9d2c4fc | ||
|
|
fdc82708c6 | ||
|
|
8f7691b47a | ||
|
|
ca2e3e5eab | ||
|
|
da42d9e049 | ||
|
|
f18679bfff | ||
|
|
970b67cdb6 | ||
|
|
3c5e38bd14 | ||
|
|
b20c60e603 | ||
|
|
12c9e4b81a | ||
|
|
7c1a18da5e | ||
|
|
df211748ca | ||
|
|
ce77d51a8f | ||
|
|
9dd3a04a08 | ||
|
|
62d8f5a039 | ||
|
|
2c551bdd35 | ||
|
|
0fd77346df | ||
|
|
a46c7156dd | ||
|
|
3c54499a40 | ||
|
|
160d66d890 | ||
|
|
3f3839d70a | ||
|
|
ab94d2c91d | ||
|
|
8ad448a23c | ||
|
|
acb40bc738 | ||
|
|
f2a887a6a4 | ||
|
|
29904c49da | ||
|
|
38ad71b06a | ||
|
|
7f057612bf | ||
|
|
9d2494e6e2 | ||
|
|
23d27cff77 | ||
|
|
176ea444ba | ||
|
|
3e12a5f67f | ||
|
|
3356b2ede7 | ||
|
|
5f3a3f535a | ||
|
|
e2e9c5ab96 | ||
|
|
dd36187864 | ||
|
|
dc6c375220 | ||
|
|
2e9a0bdd4d | ||
|
|
1413337b24 | ||
|
|
3b7990b569 | ||
|
|
657e1ac9e6 | ||
|
|
ee154da598 | ||
|
|
b3c1a87f60 | ||
|
|
9cbae8c707 | ||
|
|
ef7670a1e6 | ||
|
|
d7e5b29d41 | ||
|
|
6d07709174 | ||
|
|
51230ade1a | ||
|
|
0e6c3c9561 | ||
|
|
56ec219808 | ||
|
|
fab3d24757 | ||
|
|
87ebea7b0f | ||
|
|
a273f55b6f | ||
|
|
06c3edf4c6 | ||
|
|
6f30304271 | ||
|
|
3374576831 | ||
|
|
54911eebc1 | ||
|
|
b3563a897e | ||
|
|
1879b906e5 | ||
|
|
559d4bd47f | ||
|
|
b99ae7f463 | ||
|
|
f5a5ea0434 | ||
|
|
2f23a9cb2f | ||
|
|
317ac05919 | ||
|
|
f688c046ab | ||
|
|
141e6df50a | ||
|
|
8ac2a5870d | ||
|
|
a3f4012d1a | ||
|
|
c5aa75d4d1 | ||
|
|
d65a444ac5 | ||
|
|
2c3b85aed3 | ||
|
|
85985a9433 | ||
|
|
33e8a2ea95 | ||
|
|
5ebc9ca360 | ||
|
|
4feb43cdcc | ||
|
|
b5b9527c13 | ||
|
|
a2a7561613 | ||
|
|
1cc50b2793 | ||
|
|
2d401e4aba | ||
|
|
0da2bdd7aa | ||
|
|
212a7d00db | ||
|
|
3b2eff2551 | ||
|
|
fb194db766 | ||
|
|
127a91147c | ||
|
|
2048aac387 | ||
|
|
a8a4557738 | ||
|
|
a7dbc2e1f6 | ||
|
|
4cfcca33db | ||
|
|
37b43f9916 | ||
|
|
6e723b2a99 | ||
|
|
2817f54c96 | ||
|
|
f9a025081a | ||
|
|
877a5ca3b1 | ||
|
|
0d34fc5df2 | ||
|
|
72825c43ec | ||
|
|
bf154559eb | ||
|
|
bd850fa3ff | ||
|
|
b2f2e9db8a | ||
|
|
88b4e768c4 | ||
|
|
638c5e25fa | ||
|
|
ba0029f448 | ||
|
|
c850ae98d8 | ||
|
|
12539026c5 | ||
|
|
18b8a0ef5c | ||
|
|
ab19a89cd2 | ||
|
|
6619612c30 | ||
|
|
b8334d0cd5 | ||
|
|
cf08d1d267 | ||
|
|
2bad56f6b6 | ||
|
|
160c4cea6b | ||
|
|
7373819c32 | ||
|
|
b9cd942308 | ||
|
|
c0e7d0c7c7 | ||
|
|
d0088f6a18 | ||
|
|
3c2063df40 | ||
|
|
47cafde521 | ||
|
|
884e604909 | ||
|
|
9ba3f21730 | ||
|
|
24c95e00ed | ||
|
|
651128257f | ||
|
|
172fc79327 | ||
|
|
90c62c8ab8 | ||
|
|
0cfa6863d5 | ||
|
|
b64eab204c | ||
|
|
0fdb9b7c83 | ||
|
|
dab731656d | ||
|
|
ae5fc1fe2c | ||
|
|
d45293489f | ||
|
|
bdb8e931b4 | ||
|
|
784a75db02 | ||
|
|
cdeb1a7f9a | ||
|
|
a85b0dcbba | ||
|
|
93c7b1b846 | ||
|
|
3e39432ccc | ||
|
|
dbf7d7f748 | ||
|
|
847d959326 | ||
|
|
2d216807c7 | ||
|
|
f7c8651d51 | ||
|
|
62dc6dcb86 | ||
|
|
36e6da2abd | ||
|
|
3d0600b516 | ||
|
|
04779c2a77 | ||
|
|
42fb17bdd2 | ||
|
|
960ecaaeda | ||
|
|
e0636db60d | ||
|
|
c9a8dafd01 | ||
|
|
c78eed576f | ||
|
|
f86b9e0be7 | ||
|
|
a6f1f4c01d | ||
|
|
c90c4ea41f | ||
|
|
d039c9b6bd | ||
|
|
f6e4ee9a4a | ||
|
|
6962777ded | ||
|
|
1cebe030f6 | ||
|
|
a2f4fa916e | ||
|
|
9ebbd0c3ca | ||
|
|
21a34eaaa1 | ||
|
|
3498b16e01 | ||
|
|
a1840ea9d3 | ||
|
|
63a4f147f4 | ||
|
|
dfc4d9937b | ||
|
|
e67dfe05db | ||
|
|
f17a0da434 | ||
|
|
1197c10a70 | ||
|
|
b060f4ea6b | ||
|
|
749bc5d6f5 | ||
|
|
b808d3824b | ||
|
|
2dd7158802 | ||
|
|
32d2fa13f6 | ||
|
|
05f90a74a4 | ||
|
|
989c91f1d1 | ||
|
|
c3ef53d6fd | ||
|
|
632a2db18e | ||
|
|
40468a79ea | ||
|
|
0b7f4c134c | ||
|
|
10b677acdf | ||
|
|
f20e2ce2bd | ||
|
|
696b11475e | ||
|
|
a4b1a79cd4 | ||
|
|
1cbf67ab57 | ||
|
|
89ceb889e0 | ||
|
|
7af2f3f057 | ||
|
|
000f6ea2c0 | ||
|
|
e4127fead3 | ||
|
|
d8f7c57eff | ||
|
|
2376a7dbc0 | ||
|
|
c1aebc1af5 | ||
|
|
3680f40981 | ||
|
|
2a7fc827f4 | ||
|
|
6825486776 | ||
|
|
a7a0ea23ca | ||
|
|
85063859e0 | ||
|
|
b23a53eb1e | ||
|
|
6c7ba06930 | ||
|
|
65c98c8422 | ||
|
|
c4bb16e74b | ||
|
|
54cc0c2af6 | ||
|
|
0e8206a36f | ||
|
|
018a4736c6 | ||
|
|
8b1aaea79d | ||
|
|
7f28a7e844 | ||
|
|
680277ad6a | ||
|
|
bf4fba6bc5 | ||
|
|
8571815cbd | ||
|
|
ae456a5bc3 | ||
|
|
da2eb97c7b | ||
|
|
ac841ee2c6 | ||
|
|
c321227fa7 | ||
|
|
a68df3611b | ||
|
|
0f0f9a1246 | ||
|
|
1834e09c0f | ||
|
|
0df4b34fe4 | ||
|
|
8644016d3c | ||
|
|
8eb36fa2f1 | ||
|
|
deb6d4dec6 | ||
|
|
5002c293c7 | ||
|
|
2cbfc5a8e6 | ||
|
|
f87f677cad | ||
|
|
569ae87cbe | ||
|
|
f2cd276e5f | ||
|
|
1c1192c525 | ||
|
|
b39a18b446 | ||
|
|
c04298fb43 | ||
|
|
8060c8f37b | ||
|
|
63bf0029aa | ||
|
|
600a8e8c60 | ||
|
|
a83816f858 | ||
|
|
8d989ca7fb | ||
|
|
d61d9c98a0 | ||
|
|
b28b174056 | ||
|
|
36e62df67d | ||
|
|
d82564d84c | ||
|
|
3365e0461c | ||
|
|
69e8db441c | ||
|
|
0939cd8b21 | ||
|
|
b0efcf9f89 | ||
|
|
81006d5342 | ||
|
|
edd50a7571 | ||
|
|
cbff59ae59 | ||
|
|
deb8a2c954 | ||
|
|
0c731e378a | ||
|
|
1a38e4ef98 | ||
|
|
8cd5803556 | ||
|
|
a729b1c966 | ||
|
|
8ac1469fdb | ||
|
|
a11e57503e | ||
|
|
35df6485ab | ||
|
|
d4ced6f6af | ||
|
|
430f1baf2f | ||
|
|
e29230953d | ||
|
|
6a152ffbac | ||
|
|
07bc215b3e | ||
|
|
b64ff6f930 | ||
|
|
3717c7440a | ||
|
|
066aff96d7 | ||
|
|
089edc53d0 | ||
|
|
e038534a51 | ||
|
|
b61e023267 | ||
|
|
2a11466779 | ||
|
|
60f457827f | ||
|
|
277d7e2173 | ||
|
|
c095daa282 | ||
|
|
7f2e39500e | ||
|
|
670f55bc28 | ||
|
|
a045cf1c41 | ||
|
|
b032f71b22 | ||
|
|
9807bcb48f | ||
|
|
60ada0c278 | ||
|
|
204f351a61 | ||
|
|
8db10be892 | ||
|
|
5b21dc8cde | ||
|
|
c19f225806 | ||
|
|
7282aa7eea | ||
|
|
e81a6d497b | ||
|
|
79fc24769a | ||
|
|
287bed7e6d | ||
|
|
85c6bcdfa7 | ||
|
|
57f9b2c200 | ||
|
|
1782096805 | ||
|
|
bfbbedd604 | ||
|
|
f6a3551168 | ||
|
|
1bc56e1c86 | ||
|
|
b40d9da01d | ||
|
|
82742bbd47 | ||
|
|
f7d1802390 | ||
|
|
0baccd3c00 | ||
|
|
d51a6c1ae7 | ||
|
|
016601bdc2 | ||
|
|
4e198bdf70 | ||
|
|
32f8eb308a | ||
|
|
47de7beac1 | ||
|
|
1ff98cfcb4 | ||
|
|
c25eae9d23 | ||
|
|
e50c2014d1 | ||
|
|
829c96673b | ||
|
|
4ffec331dc | ||
|
|
dff5d89beb | ||
|
|
cf3e172d25 | ||
|
|
575376403f | ||
|
|
089acfd84a | ||
|
|
36470c5061 | ||
|
|
fffc3e7e00 | ||
|
|
114537445d | ||
|
|
8dd8b434b2 | ||
|
|
7bc14b594d | ||
|
|
d12c86d89c | ||
|
|
bb5292aa8d | ||
|
|
e3fb308ea1 | ||
|
|
0163d7af99 | ||
|
|
449982553a | ||
|
|
d46cdd8044 | ||
|
|
2ab320923f | ||
|
|
01e467fa98 | ||
|
|
7d0d0f4ea9 | ||
|
|
a42ef63ec4 | ||
|
|
a93bef1de5 | ||
|
|
ff1091ac02 | ||
|
|
a4359244bc | ||
|
|
c213b67fc4 | ||
|
|
af3b4ded22 | ||
|
|
6bebbf284f | ||
|
|
c01d526161 | ||
|
|
2e3966afce | ||
|
|
5b4a774725 | ||
|
|
11dfee404d | ||
|
|
a92b2ba600 | ||
|
|
d75d69400f | ||
|
|
a340d25077 | ||
|
|
768a1c5fb4 | ||
|
|
993cbf5ae9 | ||
|
|
6f84f921f3 | ||
|
|
44d34673f4 | ||
|
|
03af9afe17 | ||
|
|
cb29e0a057 | ||
|
|
a72f9af984 | ||
|
|
14d731da98 | ||
|
|
4f30b5cd31 | ||
|
|
73da10e485 | ||
|
|
b4d572158d | ||
|
|
963e5d7f33 | ||
|
|
8c17e2d12a | ||
|
|
8d67c75028 | ||
|
|
c7061523e6 | ||
|
|
2e7298d064 | ||
|
|
948a5c62ef | ||
|
|
e9736d298e | ||
|
|
4691f3e2c5 | ||
|
|
2b138cce93 | ||
|
|
ef62261e43 | ||
|
|
2a3701b036 | ||
|
|
ce56e5f1a4 | ||
|
|
58f85e7ebd | ||
|
|
f217551f5f | ||
|
|
55f3e9314b | ||
|
|
830a4c2f56 | ||
|
|
44123b9b0b | ||
|
|
506ad91b03 | ||
|
|
ee849f6379 | ||
|
|
e94f59d7c2 | ||
|
|
3c58003a3d | ||
|
|
9f3b50086d | ||
|
|
2d2958e931 | ||
|
|
a55b3784eb | ||
|
|
18993b397b | ||
|
|
ba3a9f83bc | ||
|
|
df393638ed | ||
|
|
535e19f8b8 | ||
|
|
27969b6752 | ||
|
|
41494b49dd | ||
|
|
68e2fb912f | ||
|
|
1e3fb6c6e1 | ||
|
|
cbea43267e | ||
|
|
62cb89d224 | ||
|
|
0b8f52e084 | ||
|
|
3ba3f1e2a7 | ||
|
|
49c22f3810 | ||
|
|
b462f95343 | ||
|
|
f31a89ebbb | ||
|
|
b2c1ae264b | ||
|
|
754e666eaa | ||
|
|
bc79d9e2f8 | ||
|
|
ac06544849 | ||
|
|
66634c9b3d | ||
|
|
108ec145b7 | ||
|
|
4e78d6ec95 | ||
|
|
bf42319296 | ||
|
|
4f1d3c3269 | ||
|
|
e3064727c3 | ||
|
|
2418b8017d | ||
|
|
2d43ab9f50 | ||
|
|
aac2d09f48 | ||
|
|
195ab9a150 | ||
|
|
5b22187a3d | ||
|
|
36f1536b09 | ||
|
|
a8c723326d | ||
|
|
ae8296a50e | ||
|
|
93d4f78715 | ||
|
|
8f819dfa66 | ||
|
|
aa658f95f6 | ||
|
|
d078cf52c9 | ||
|
|
96fbad1f0c | ||
|
|
829f84fe50 | ||
|
|
0ef2b48902 | ||
|
|
5a975831d4 | ||
|
|
058b913455 | ||
|
|
cddb45085c | ||
|
|
9d3c4f20a1 | ||
|
|
802ccd7f14 | ||
|
|
b5363f47ab | ||
|
|
927226633d | ||
|
|
de388a74bd | ||
|
|
54a759497f | ||
|
|
c914395236 | ||
|
|
2960cba12b | ||
|
|
646c4b4197 | ||
|
|
9846fb1d8e | ||
|
|
154da4452d | ||
|
|
54ebb6a508 | ||
|
|
00afe74a3b | ||
|
|
3ed3919349 | ||
|
|
acbe2b0b3c |
135
.appveyor.yml
Normal file
@@ -0,0 +1,135 @@
|
||||
version: 2.5.2-branch-{branch}-build-{build}
|
||||
|
||||
# Skipping commits affecting specific files (GitHub only).
|
||||
# More details here: https://www.appveyor.com/docs/appveyor-yml and https://www.appveyor.com/docs/how-to/filtering-commits
|
||||
skip_commits:
|
||||
files:
|
||||
- .ci/travis-*
|
||||
- .github/
|
||||
- .tx/
|
||||
- webclient/
|
||||
- .clang-format
|
||||
- .*ignore
|
||||
- .codacy.yml
|
||||
- .gitlab-ci.yml
|
||||
- .travis.yml
|
||||
- '**/*.md'
|
||||
- Dockerfile
|
||||
- LICENSE
|
||||
|
||||
image: Visual Studio 2017
|
||||
|
||||
cache:
|
||||
- c:\openssl-release
|
||||
- c:\protobuf-release
|
||||
- c:\zlib-release
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- qt_ver: 5.9\msvc2017_64
|
||||
openssl_ver: 1.0.2n-x64_86-win64
|
||||
protobuf_ver: 3.5.1
|
||||
zlib_ver: 1.2.11
|
||||
cmake_generator: Visual Studio 15 2017 Win64
|
||||
cmake_toolset: v141,host=x64
|
||||
target_arch: win64
|
||||
vc_arch: amd64
|
||||
- qt_ver: 5.9\msvc2015 # Qt doesn't provide a msvc2017_32
|
||||
openssl_ver: 1.0.2n-i386-win32
|
||||
protobuf_ver: 3.5.1
|
||||
zlib_ver: 1.2.11
|
||||
cmake_generator: Visual Studio 15 2017
|
||||
cmake_toolset: v141
|
||||
target_arch: win32
|
||||
vc_arch: amd64_x86
|
||||
|
||||
install:
|
||||
- ps: |
|
||||
if (Test-Path c:\openssl-release) {
|
||||
echo "using openssl from cache"
|
||||
} else {
|
||||
Invoke-WebRequest "https://indy.fulgan.com/SSL/openssl-$env:openssl_ver.zip" -OutFile c:\openssl-$env:openssl_ver.zip
|
||||
Expand-Archive -Path c:\openssl-$env:openssl_ver.zip -DestinationPath c:\openssl-release
|
||||
Set-Location -Path C:\openssl-release
|
||||
}
|
||||
if (Test-Path c:\protobuf-release) {
|
||||
echo "using protobuf from cache"
|
||||
} else {
|
||||
Invoke-WebRequest "https://github.com/google/protobuf/releases/download/v$env:protobuf_ver/protobuf-cpp-$env:protobuf_ver.zip" -OutFile c:\protobuf-cpp-$env:protobuf_ver.zip
|
||||
Expand-Archive -Path c:\protobuf-cpp-$env:protobuf_ver.zip -DestinationPath c:\
|
||||
Set-Location -Path C:\protobuf-$env:protobuf_ver\cmake
|
||||
cmake . -G "$env:cmake_generator" -T "$env:cmake_toolset" -Dprotobuf_BUILD_TESTS=0 -Dprotobuf_MSVC_STATIC_RUNTIME=0 -DCMAKE_INSTALL_PREFIX=c:/protobuf-release
|
||||
msbuild INSTALL.vcxproj /p:Configuration=Release
|
||||
}
|
||||
if (Test-Path c:\zlib-release) {
|
||||
echo "using zlib from cache"
|
||||
} else {
|
||||
Invoke-WebRequest "https://github.com/madler/zlib/archive/v$env:zlib_ver.zip" -OutFile c:\zlib-$env:zlib_ver.zip
|
||||
Expand-Archive -Path c:\zlib-$env:zlib_ver.zip -DestinationPath c:\
|
||||
Set-Location -Path C:\zlib-$env:zlib_ver
|
||||
cmake . -G "$env:cmake_generator" -T "$env:cmake_toolset" -DCMAKE_INSTALL_PREFIX=c:/zlib-release
|
||||
msbuild INSTALL.vcxproj /p:Configuration=Release
|
||||
}
|
||||
|
||||
services:
|
||||
- mysql
|
||||
|
||||
build_script:
|
||||
- ps: |
|
||||
New-Item -ItemType directory -Path $env:APPVEYOR_BUILD_FOLDER\build
|
||||
Set-Location -Path $env:APPVEYOR_BUILD_FOLDER\build
|
||||
$zlibdir = "c:\zlib-release"
|
||||
$openssldir = "C:\openssl-release"
|
||||
$protodir = "c:\protobuf-release"
|
||||
$protoc = "c:\protobuf-release\bin\protoc.exe"
|
||||
$mysqldll = "c:\Program Files\MySQL\MySQL Server 5.7\lib\libmysql.dll"
|
||||
cmake .. -G "$env:cmake_generator" -T "$env:cmake_toolset" "-DCMAKE_PREFIX_PATH=c:/Qt/$env:qt_ver;$protodir;$zlibdir;$openssldir" "-DWITH_SERVER=1" "-DPROTOBUF_PROTOC_EXECUTABLE=$protoc" "-DMYSQLCLIENT_LIBRARIES=$mysqldll"
|
||||
- msbuild PACKAGE.vcxproj /p:Configuration=Release
|
||||
- ps: |
|
||||
$exe = dir -name *.exe
|
||||
$new_name = $exe.Replace(".exe", "-${env:target_arch}.exe")
|
||||
Push-AppveyorArtifact $exe -FileName $new_name
|
||||
$cmake_name = $exe.Replace(".exe", "-${env:target_arch}.cmake.txt")
|
||||
Push-AppveyorArtifact CMakeCache.txt -FileName $cmake_name
|
||||
$json = New-Object PSObject
|
||||
(New-Object PSObject | Add-Member -PassThru NoteProperty bin $new_name | Add-Member -PassThru NoteProperty cmake $cmake_name | Add-Member -PassThru NoteProperty commit $env:APPVEYOR_REPO_COMMIT) | ConvertTo-JSON | Out-File -FilePath "latest-$env:target_arch" -Encoding ASCII
|
||||
Push-AppveyorArtifact "latest-$env:target_arch"
|
||||
$version = $matches['content']
|
||||
|
||||
test: off
|
||||
|
||||
|
||||
# Builds for pull requests skip the deployment step altogether
|
||||
deploy:
|
||||
# Deploy configuration for "beta" releases
|
||||
- provider: GitHub
|
||||
auth_token:
|
||||
secure: p+7wPVry2XEa6TBm9XH8IaQZbBmXQ/J2ldbGmcIxUZD3NkkPrSRRlmE7Of1CBBIO
|
||||
tag: "$(APPVEYOR_REPO_TAG_NAME)"
|
||||
release: "Cockatrice $(APPVEYOR_REPO_TAG_NAME)"
|
||||
description: "Beta release of Cockatrice"
|
||||
artifact: /.*\.exe/
|
||||
force_update: true
|
||||
draft: false
|
||||
prerelease: true
|
||||
on:
|
||||
APPVEYOR_REPO_TAG: true
|
||||
APPVEYOR_REPO_TAG_NAME: /([0-9]|[1-9][0-9])(\.([0-9]|[1-9][0-9])){2}-beta(\.([2-9]|[1-9][0-9]))?$/ # regex to match semver naming convention for beta pre-releases
|
||||
|
||||
# Deploy configuration for "stable" releases
|
||||
- provider: GitHub
|
||||
auth_token:
|
||||
secure: p+7wPVry2XEa6TBm9XH8IaQZbBmXQ/J2ldbGmcIxUZD3NkkPrSRRlmE7Of1CBBIO
|
||||
tag: "$(APPVEYOR_REPO_TAG_NAME)"
|
||||
release: "Cockatrice $(APPVEYOR_REPO_TAG_NAME)"
|
||||
artifact: /.*\.exe/
|
||||
force_update: true
|
||||
draft: false
|
||||
prerelease: false
|
||||
on:
|
||||
APPVEYOR_REPO_TAG: true
|
||||
APPVEYOR_REPO_TAG_NAME: /([0-9]|[1-9][0-9])(\.([0-9]|[1-9][0-9])){2}$/ # regex to match semver naming convention for stable full releases
|
||||
|
||||
|
||||
# official validator for ".appveyor.yml" config file: https://ci.appveyor.com/tools/validate-yaml
|
||||
# appveyor config documentation: https://www.appveyor.com/docs/build-configuration/
|
||||
56
.ci/travis-compile.sh
Normal file
@@ -0,0 +1,56 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
./servatrice/check_schema_version.sh
|
||||
|
||||
mkdir -p build
|
||||
cd build
|
||||
prefix=""
|
||||
|
||||
if [[ $TRAVIS_OS_NAME == "osx" ]]; then
|
||||
export PATH="/usr/local/opt/ccache/bin:$PATH"
|
||||
prefix="-DCMAKE_PREFIX_PATH=$(echo /usr/local/opt/qt5/)"
|
||||
fi
|
||||
if [[ $TRAVIS_OS_NAME == "linux" ]]; then
|
||||
prefix="-DCMAKE_PREFIX_PATH=$(echo /opt/qt5*/lib/cmake/)"
|
||||
fi
|
||||
|
||||
if [[ $BUILDTYPE == "Debug" ]]; then
|
||||
cmake .. -DWITH_SERVER=1 -DCMAKE_BUILD_TYPE=$BUILDTYPE $prefix -DTEST=1
|
||||
make -j2
|
||||
make test
|
||||
|
||||
if [[ $TRAVIS_OS_NAME == "osx" ]]; then
|
||||
make install
|
||||
fi
|
||||
|
||||
if [[ $TRAVIS_OS_NAME == "linux" ]]; then
|
||||
cd ..
|
||||
clang-format -i \
|
||||
common/*.h \
|
||||
common/*.cpp \
|
||||
cockatrice/src/*.h \
|
||||
cockatrice/src/*.cpp \
|
||||
oracle/src/*.h \
|
||||
oracle/src/*.cpp \
|
||||
servatrice/src/*.h \
|
||||
servatrice/src/*.cpp
|
||||
|
||||
git clean -f
|
||||
git diff --quiet || (
|
||||
echo "*****************************************************";
|
||||
echo "*** This PR is not clean against our code style ***";
|
||||
echo "*** Run clang-format and fix up any differences ***";
|
||||
echo "*** Check our CONTRIBUTING.md file for details! ***";
|
||||
echo "*** Thank you ♥ ***";
|
||||
echo "*****************************************************";
|
||||
)
|
||||
git diff --exit-code
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $BUILDTYPE == "Release" ]]; then
|
||||
cmake .. -DWITH_SERVER=1 -DCMAKE_BUILD_TYPE=$BUILDTYPE $prefix
|
||||
make package -j2
|
||||
fi
|
||||
9
.ci/travis-dependencies.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ $TRAVIS_OS_NAME == "osx" ]] ; then
|
||||
brew update
|
||||
brew install ccache clang-format protobuf qt
|
||||
fi
|
||||
if [[ $TRAVIS_OS_NAME == "linux" ]] ; then
|
||||
echo Skipping... packages are installed with the Travis apt addon for sudo disabled container builds
|
||||
fi
|
||||
25
.clang-format
Normal file
@@ -0,0 +1,25 @@
|
||||
IndentWidth: 4
|
||||
AccessModifierOffset: -4
|
||||
ColumnLimit: 120
|
||||
---
|
||||
Language: Cpp
|
||||
BreakBeforeBraces: Custom
|
||||
BraceWrapping:
|
||||
AfterClass: true
|
||||
AfterControlStatement: false
|
||||
AfterEnum: true
|
||||
AfterFunction: true
|
||||
AfterNamespace: true
|
||||
AfterStruct: true
|
||||
AfterUnion: true
|
||||
BeforeCatch: false
|
||||
BeforeElse: false
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: true
|
||||
SplitEmptyRecord: true
|
||||
SplitEmptyNamespace: true
|
||||
AllowShortFunctionsOnASingleLine: None
|
||||
BinPackParameters: false
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
IndentCaseLabels: true
|
||||
PointerAlignment: Right
|
||||
5
.codacy.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
exclude_paths:
|
||||
- '**/translations/*.ts'
|
||||
|
||||
# codacy config documentation: https://support.codacy.com/hc/en-us/articles/115002130625-Codacy-Configuration-File
|
||||
@@ -1,12 +1,9 @@
|
||||
.git/
|
||||
CONTRIBUTING.md
|
||||
Dockerfile
|
||||
TODO.md
|
||||
build/
|
||||
.github/
|
||||
.travis/
|
||||
.tx/
|
||||
cockatrice/
|
||||
doc/
|
||||
oracle/
|
||||
sounds/
|
||||
travis-compile.sh
|
||||
travis-dependencies.sh
|
||||
zonebg/
|
||||
Dockerfile
|
||||
|
||||
305
.github/CONTRIBUTING.md
vendored
Normal file
@@ -0,0 +1,305 @@
|
||||
[Introduction](#contributing-to-cockatrice) | [Code Style Guide](#code-style-guide) | [Translations](#translations) | [Release Management](#release-management)
|
||||
|
||||
----
|
||||
|
||||
<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.
|
||||
|
||||
|
||||
# Recommended Setups #
|
||||
|
||||
For those developers who like the 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.
|
||||
|
||||
Developers who like Windows development tend to find [Visual Studio](https://www.visualstudio.com/) the best tool for the job.
|
||||
|
||||
If you have any questions on IDEs, feel free to chat with us on [Gitter](https://gitter.im/Cockatrice/Cockatrice) and we would love to help answer your questions!
|
||||
|
||||
|
||||
# Code Style Guide #
|
||||
|
||||
### Compatibility ###
|
||||
|
||||
Cockatrice is currently compiled on all platforms using <kbd>C++11</kbd>. You'll notice <kbd>C++03</kbd> code throughout the codebase. Please feel free to help convert it over!
|
||||
|
||||
For consistency, we use Qt data structures where possible. For example, `QString` over
|
||||
`std::string` and `QList` over `std::vector`.
|
||||
|
||||
### Header files ###
|
||||
|
||||
Use header files with the extension `.h` and source files with the extension
|
||||
`.cpp`.
|
||||
|
||||
Use header guards in the form of `FILE_NAME_H`.
|
||||
|
||||
Simple functions, such as getters, may be written inline in the header file,
|
||||
but other functions should be written in the source file.
|
||||
|
||||
Keep library includes and project includes grouped together. So this is okay:
|
||||
```c++
|
||||
// Good
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
#include "card.h"
|
||||
#include "deck.h"
|
||||
|
||||
// Good
|
||||
#include "card.h"
|
||||
#include "deck.h"
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
|
||||
// Bad:
|
||||
#include <QList>
|
||||
#include "card.h"
|
||||
#include <QString>
|
||||
#include "deck.h"
|
||||
```
|
||||
|
||||
### Naming ###
|
||||
|
||||
Use `UpperCamelCase` for classes, structs, enums, etc. and `lowerCamelCase` for
|
||||
function and variable names.
|
||||
|
||||
Member variables aren't decorated in any way. Don't prefix or suffix with
|
||||
underscores, etc.
|
||||
|
||||
For arguments to constructors which have the same names as member variables,
|
||||
prefix those arguments with underscores:
|
||||
```c++
|
||||
MyClass::MyClass(int _myData) : myData(_myData)
|
||||
{
|
||||
|
||||
}
|
||||
```
|
||||
Pointers and references should be denoted with the `*` or `&` going with the
|
||||
variable name:
|
||||
```c++
|
||||
// Good
|
||||
Foo *foo1 = new Foo;
|
||||
Foo &foo2 = *foo1;
|
||||
|
||||
// Bad
|
||||
Bar* bar1 = new Bar;
|
||||
Bar& bar2 = *bar1;
|
||||
```
|
||||
Use `nullptr` instead of `NULL` (or `0`) for null pointers.
|
||||
If you find any usage of the old keywords, we encourage you to fix it.
|
||||
|
||||
### Braces ###
|
||||
|
||||
Braces should almost always go on their own line:
|
||||
```c++
|
||||
int main()
|
||||
{
|
||||
if (someCondition)
|
||||
{
|
||||
doSomething();
|
||||
}
|
||||
else if (someOtherCondition1)
|
||||
{
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
doSomethingElse();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (someOtherCondition2)
|
||||
{
|
||||
doSomethingElse();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
Braces should never be omitted for single-statement. Keeping the code legibile is a high priority of ours and we hope you share a similar belief :)
|
||||
|
||||
### Tabs vs Spaces ###
|
||||
|
||||
We _highly_ encourate the use of spaces. If you use tabs, please readjust them to 4 spaces per tab before submitting.
|
||||
|
||||
### Lines ###
|
||||
|
||||
Do not have trailing whitespace in your lines, if possible. Most IDEs check for this nowadays and clean it up for you.
|
||||
|
||||
Lines should be 120 characters or less, but you can exceed this if you find it necessary.
|
||||
|
||||
### Memory Management ###
|
||||
|
||||
New code should be written using references over pointers and stack allocation
|
||||
over heap allocation wherever possible.
|
||||
```c++
|
||||
// Good: uses stack allocation and references
|
||||
void showCard(const Card &card);
|
||||
int main()
|
||||
{
|
||||
Card card;
|
||||
showCard(card);
|
||||
}
|
||||
|
||||
// Bad: relies on manual memory management and doesn't give us much
|
||||
// null-safety.
|
||||
void showCard(const Card *card);
|
||||
int main()
|
||||
{
|
||||
Card *card = new Card;
|
||||
showCard(card);
|
||||
delete card;
|
||||
}
|
||||
```
|
||||
(Remember to pass by `const` reference wherever possible, to avoid accidentally
|
||||
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 ###
|
||||
|
||||
The servatrice database's schema can be found at `servatrice/servatrice.sql`.
|
||||
Everytime the schema gets modified, some other steps are due:
|
||||
1. Increment the value of `cockatrice_schema_version` in `servatrice.sql`;
|
||||
2. Increment the value of `DATABASE_SCHEMA_VERSION` in `servatrice_database_interface.h` accordingly;
|
||||
3. Create a new migration file inside the `servatrice/migrations` directory named after the new schema version.
|
||||
4. Run the `servatrice/check_schema_version.sh` script to ensure everything is fine.
|
||||
|
||||
The migration file should include the sql statements needed to migrate the database schema and data from the previous to the new version, and an additional statement that updates `cockatrice_schema_version` to the correct value.
|
||||
|
||||
### 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 files defines the way data contained in each message is serialized using Google's [protocol buffer](https://developers.google.com/protocol-buffers/).
|
||||
Any change to the `proto` file should be taken with caution and tested intensively before being merged, becaus a change to the protocol could make 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)
|
||||
|
||||
|
||||
# Translations #
|
||||
|
||||
**Basic workflow for translations:**
|
||||
1. Developer adds a `tr("foo")` string in the code;
|
||||
2. Every few days, a maintainer updates the `*_en.ts files` with the new strings;
|
||||
3. Transifex picks up the new files from github every 24 hours;
|
||||
4. Translators translate the new untraslated strings on Transifex;
|
||||
5. Before a release, a maintainer fetches the updated translations from Transifex.
|
||||
|
||||
### Translations (for developers) ###
|
||||
|
||||
**Step 1: Adding translatable strings to the code (`tr("foo")`)**
|
||||
|
||||
All the user-interface strings inside Cockatrice's source code must be written in
|
||||
english language.<br>
|
||||
Translations to other languages are managed using [Transifex](https://www.transifex.com/projects/p/cockatrice/).
|
||||
|
||||
If you're about to propose a change that adds or modifies any translatable string
|
||||
in the code, you don't need to take care of adding the new strings to the
|
||||
translation files. Every few days, or when a lot of new strings have been added,
|
||||
someone from the development team will take care of extracing all the new strings,
|
||||
adding them to the english translation files and making them available to
|
||||
translators on Transifex.
|
||||
|
||||
### Translations (for maintainers) ###
|
||||
|
||||
**Step 2: Updating `*_en.ts` files with new strings**
|
||||
|
||||
When new translatable strings have been added to the code, it would be nice to
|
||||
make them available to translators on Transifex. Every few days, or when a lot
|
||||
of new strings have been added, a maintainer should take care of extracing all
|
||||
the new strings and add them to the english translation files.
|
||||
|
||||
To update the english translation files, re-run cmake enabling the appropriate
|
||||
parameter and then run make:
|
||||
```sh
|
||||
cd cockatrice/build
|
||||
cmake .. -DUPDATE_TRANSLATIONS=ON
|
||||
make
|
||||
```
|
||||
If the parameter has been enabled correctly, when running "make" you should see
|
||||
a line similar to this one (the numbers may vary):
|
||||
```sh
|
||||
[ 76%] Generating ../../cockatrice/translations/cockatrice_en.ts
|
||||
Updating '../../cockatrice/translations/cockatrice_en.ts'...
|
||||
Found 857 source text(s) (8 new and 849 already existing)
|
||||
```
|
||||
You should then notice that the following files have uncommitted changes:
|
||||
|
||||
cockatrice/translations/cockatrice_en.ts
|
||||
oracle/translations/oracle_en.ts
|
||||
|
||||
It's now suggested to disable the parameter using:
|
||||
```sh
|
||||
cmake .. -DUPDATE_TRANSLATIONS=OFF
|
||||
```
|
||||
Now you are ready to propose your change.
|
||||
|
||||
**Step 3: Automatic pushing to Transifex**
|
||||
|
||||
Once your change gets merged, Transifex will pick up the modified files automatically (checks every 24 hours)
|
||||
and update the interface where translators will be able to translate the new strings.
|
||||
|
||||
**Step 5: Fetching new translations from Transifex**
|
||||
|
||||
Before rushing out a new release, it would be nice to 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/
|
||||
|
||||
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.
|
||||
|
||||
### Translations (for translators) ###
|
||||
|
||||
**Step 4: Editing translations at Transifex**
|
||||
|
||||
Please have a look at the specific [FAQ for translators](https://github.com/Cockatrice/Cockatrice/wiki/Translation-FAQ).
|
||||
|
||||
|
||||
# Release Management #
|
||||
|
||||
### Publishing A New Beta Release ###
|
||||
|
||||
Travis and AppVeyor have been configured to upload files to GitHub Releases whenever a <kbd>tag</kbd> is pushed.<br>
|
||||
Usually, tags are created through publishing a (pre-)release, but there's a way around that.
|
||||
|
||||
To trigger Travis and AppVeyor, simply do the following:
|
||||
```bash
|
||||
cd $COCKATRICE_REPO
|
||||
git checkout master
|
||||
git remote update -p
|
||||
git pull
|
||||
git tag $TAG_NAME
|
||||
git push upstream $TAG_NAME
|
||||
```
|
||||
You should define the variables as such:
|
||||
```
|
||||
upstream - git@github.com:Cockatrice/Cockatrice.git
|
||||
$COCKATRICE_REPO - /Location/of/repository/cockatrice.git
|
||||
`$TAG_NAME` should be:
|
||||
- `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!
|
||||
```
|
||||
|
||||
This will cause a tagged release to be established on the GitHub repository, which will then lead to the upload of binaries. If you use this method, the tags (releases) that you create will be marked as a "Pre-release". The `/latest` URL will not be impacted (for stable release downloads) so that's good.
|
||||
|
||||
If you accidentally push a tag incorrectly (the tag is outdated, you didn't pull in the latest branch accidentally, you named the tag wrong, etc.) you can revoke the tag by doing the following:
|
||||
```bash
|
||||
git push --delete upstream $TAG_NAME
|
||||
git tag -d $TAG_NAME
|
||||
```
|
||||
|
||||
**NOTE:** Unfortunately, due to the method of how Travis and AppVeyor work, to publish a stable release you will need to make a copy of the release notes locally and then paste them into the GitHub GUI once the binaries have been uploaded by them. These CI services will automatically overwrite the name of the release (to "Cockatrice $TAG_NAME"), the status of the release (to "Pre-release"), and the release body (to "Beta build of Cockatrice").
|
||||
|
||||
**NOTE 2:** In the first lines of https://github.com/Cockatrice/Cockatrice/blob/master/CMakeLists.txt there's an hardcoded version number used when compiling custom (not tagged) versions. While on tagged versions these numbers are overriden by the version numbers coming from the tag title, it's a good practice to keep them aligned with the real ones.
|
||||
The preferred flow of operations is:
|
||||
* just before a release, update the version number in CMakeLists.txt to "next release version";
|
||||
* tag the release following the previously described syntax in order to get it built by CI;
|
||||
* wait for CI to upload the binaries, double check if everything is in order
|
||||
* after the release is complete, update the version number again to "next targeted beta version", typically increasing `PROJECT_VERSION_PATCH` by one.
|
||||
|
||||
**NOTE 3:** When releasing a new stable version, all the previous beta versions should be deleted. This is needed for Cockatrice to pick up the stable release also for users that chose the "beta" release channel.
|
||||
14
.github/ISSUE_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<b>System Information:</b>
|
||||
<!-- Go to "Help → View Debug Log" and copy all lines above the separation here! -->
|
||||
|
||||
<!-- If you can't install Cockatrice to access that information, make
|
||||
sure to include your OS and the app version from the setup file here -->
|
||||
__________________________________________________________________________________________
|
||||
|
||||
<!-- Explain your issue/request/suggestion in detail here! -->
|
||||
|
||||
<!-- This repository is ONLY about development of the Cockatrice app.
|
||||
If you have any problems with a server (e.g. registering, connecting, ban...)
|
||||
you have to contact that server's owner/admin.
|
||||
Check this list of public servers with webpage links and contact details:
|
||||
https://github.com/Cockatrice/Cockatrice/wiki/Public-Servers -->
|
||||
12
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
## Related Ticket(s)
|
||||
- Fixes #IssueNumber
|
||||
|
||||
## Short roundup of the initial problem
|
||||
|
||||
|
||||
## What will change with this Pull Request?
|
||||
- this
|
||||
- and this
|
||||
|
||||
## Screenshots
|
||||
<!-- simply drag & drop image files directly into this description! -->
|
||||
4
.gitignore
vendored
@@ -4,4 +4,6 @@ build*
|
||||
.directory
|
||||
mysql.cnf
|
||||
.DS_Store
|
||||
.idea/
|
||||
.idea/
|
||||
*.aps
|
||||
cmake-build-debug/
|
||||
|
||||
139
.gitlab-ci.yml
Normal file
@@ -0,0 +1,139 @@
|
||||
---
|
||||
stages:
|
||||
- build
|
||||
|
||||
.artifacts: &artifacts
|
||||
artifacts:
|
||||
paths:
|
||||
- build/
|
||||
|
||||
.cache: &cache
|
||||
cache:
|
||||
key: "$CI_BUILD_NAME"
|
||||
paths:
|
||||
- cache/
|
||||
|
||||
.branches: &branches
|
||||
only:
|
||||
- master
|
||||
|
||||
.tags: &tags
|
||||
tags:
|
||||
- linux
|
||||
- docker
|
||||
|
||||
|
||||
#================================ DEBIAN-BASED ================================
|
||||
|
||||
.build_rc_package_deb: &build_rc_package_deb
|
||||
stage: build
|
||||
script:
|
||||
- mkdir -p build
|
||||
- cd build
|
||||
- cmake .. -DWITH_SERVER=1 -DCMAKE_BUILD_TYPE=Release -DCPACK_GENERATOR=DEB
|
||||
- make package -j2
|
||||
|
||||
.build_debug_package_deb: &build_debug_package_deb
|
||||
stage: build
|
||||
script:
|
||||
- mkdir -p build
|
||||
- cd build
|
||||
- cmake .. -DWITH_SERVER=1 -DCMAKE_BUILD_TYPE=Debug -DCPACK_GENERATOR=DEB
|
||||
- make package -j2
|
||||
|
||||
.deb-artifacts: &artifacts_deb
|
||||
artifacts:
|
||||
paths:
|
||||
- build/*.deb
|
||||
- build/CMakeFiles/*.log
|
||||
when: always
|
||||
|
||||
#----------------------------------- UBUNTU -----------------------------------
|
||||
|
||||
.requirements_16xx: &install_requirements_16xx
|
||||
before_script:
|
||||
- apt-get -o dir::cache::archives="cache" update -qq
|
||||
- apt-get -o dir::cache::archives="cache" install -y build-essential g++ cmake git
|
||||
- apt-get -o dir::cache::archives="cache" install -y libprotobuf-dev protobuf-compiler
|
||||
- apt-get -o dir::cache::archives="cache" install -y qt5-default qttools5-dev qttools5-dev-tools
|
||||
- apt-get -o dir::cache::archives="cache" install -y qtmultimedia5-dev libqt5multimedia5-plugins
|
||||
- apt-get -o dir::cache::archives="cache" install -y libqt5svg5-dev libqt5sql5-mysql
|
||||
- apt-get -o dir::cache::archives="cache" install -y libqt5websockets5-dev
|
||||
|
||||
.requirements_17xx: &install_requirements_17xx
|
||||
before_script:
|
||||
- apt-get -o dir::cache::archives="cache" update -qq
|
||||
- apt-get -o dir::cache::archives="cache" install -y build-essential g++ cmake git
|
||||
- apt-get -o dir::cache::archives="cache" install -y libprotobuf-dev protobuf-compiler
|
||||
- apt-get -o dir::cache::archives="cache" install -y qt5-default qttools5-dev qttools5-dev-tools
|
||||
- apt-get -o dir::cache::archives="cache" install -y qtmultimedia5-dev libqt5multimedia5-plugins
|
||||
- apt-get -o dir::cache::archives="cache" install -y libqt5svg5-dev libqt5sql5-mysql
|
||||
- apt-get -o dir::cache::archives="cache" install -y libqt5websockets5-dev
|
||||
|
||||
.build_1604: &1604
|
||||
image: ubuntu:16.04
|
||||
<<: *tags
|
||||
<<: *branches
|
||||
<<: *install_requirements_16xx
|
||||
<<: *artifacts_deb
|
||||
<<: *cache
|
||||
|
||||
.build_1710: &1710
|
||||
image: ubuntu:17.10
|
||||
<<: *tags
|
||||
<<: *branches
|
||||
<<: *install_requirements_17xx
|
||||
<<: *artifacts_deb
|
||||
<<: *cache
|
||||
|
||||
build_rc_1604:
|
||||
<<: *1604
|
||||
<<: *build_rc_package_deb
|
||||
when: always
|
||||
|
||||
build_debug_1604:
|
||||
<<: *1604
|
||||
<<: *build_debug_package_deb
|
||||
when: always
|
||||
|
||||
build_rc_1710:
|
||||
<<: *1710
|
||||
<<: *build_rc_package_deb
|
||||
when: always
|
||||
|
||||
build_debug_1710:
|
||||
<<: *1710
|
||||
<<: *build_debug_package_deb
|
||||
when: always
|
||||
allow_failure: true
|
||||
|
||||
#----------------------------------- DEBIAN -----------------------------------
|
||||
|
||||
.requirements_stretch: &install_requirements_stretch
|
||||
before_script:
|
||||
- apt-get -o dir::cache::archives="cache" update -qq
|
||||
- apt-get -o dir::cache::archives="cache" install -y build-essential g++ cmake git
|
||||
- apt-get -o dir::cache::archives="cache" install -y qt5-default qtbase5-dev-tools
|
||||
- apt-get -o dir::cache::archives="cache" install -y qttools5-dev-tools qtmultimedia5-dev
|
||||
- apt-get -o dir::cache::archives="cache" install -y libqt5svg5-dev libqt5websockets5-dev
|
||||
- apt-get -o dir::cache::archives="cache" install -y libprotobuf-dev protobuf-compiler
|
||||
|
||||
.build_stretch: &stretch
|
||||
image: debian:stretch
|
||||
<<: *tags
|
||||
<<: *branches
|
||||
<<: *install_requirements_stretch
|
||||
<<: *artifacts_deb
|
||||
<<: *cache
|
||||
|
||||
build_rc_stretch:
|
||||
<<: *stretch
|
||||
<<: *build_rc_package_deb
|
||||
when: always
|
||||
|
||||
build_debug_stretch:
|
||||
<<: *stretch
|
||||
<<: *build_debug_package_deb
|
||||
when: always
|
||||
allow_failure: true
|
||||
|
||||
121
.travis.yml
@@ -1,43 +1,98 @@
|
||||
language: cpp
|
||||
|
||||
cache: ccache
|
||||
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
include:
|
||||
# linux precise debug build, precise + gcc + qt4
|
||||
- os: linux
|
||||
env: QT4=1 BUILDTYPE=Debug DIST=precise
|
||||
# linux debug build, trusty + gcc + qt5
|
||||
- os: linux
|
||||
dist: trusty
|
||||
env: QT4=0 BUILDTYPE=Debug DIST=trusty
|
||||
# osx debug build, osx + clang + qt5
|
||||
- os: osx
|
||||
env: QT4=0 BUILDTYPE=Debug
|
||||
# linux precise release build, precise + gcc + qt4
|
||||
- os: linux
|
||||
env: QT4=1 BUILDTYPE=Release DIST=precise
|
||||
# linux trusty release build, precise + gcc + qt5
|
||||
- os: linux
|
||||
dist: trusty
|
||||
env: QT4=0 BUILDTYPE=Release DIST=trusty
|
||||
# osx release build, osx + gcc + qt5
|
||||
- os: osx
|
||||
env: QT4=0 BUILDTYPE=Release
|
||||
script: ./travis-compile.sh
|
||||
install: ./travis-dependencies.sh
|
||||
cache: apt
|
||||
- os: linux
|
||||
dist: trusty
|
||||
group: stable
|
||||
env: BUILDTYPE=Debug
|
||||
- os: linux
|
||||
dist: trusty
|
||||
group: stable
|
||||
env: BUILDTYPE=Release
|
||||
if: (branch = master AND NOT type = pull_request) OR tag IS present
|
||||
- os: osx
|
||||
osx_image: xcode8
|
||||
env: BUILDTYPE=Debug
|
||||
- os: osx
|
||||
osx_image: xcode8
|
||||
env: BUILDTYPE=Release
|
||||
if: (branch = master AND NOT type = pull_request) OR tag IS present
|
||||
|
||||
#install dependencies for container-based "linux" builds
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- sourceline: 'deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-5.0 main'
|
||||
key_url: 'http://llvm.org/apt/llvm-snapshot.gpg.key'
|
||||
packages:
|
||||
- bc
|
||||
- clang-format-5.0
|
||||
- cmake
|
||||
- libprotobuf-dev
|
||||
- protobuf-compiler
|
||||
- qt5-default
|
||||
- qttools5-dev
|
||||
- qttools5-dev-tools
|
||||
- qtmultimedia5-dev
|
||||
- libqt5multimedia5-plugins
|
||||
- libqt5svg5-dev
|
||||
- libqt5sql5-mysql
|
||||
|
||||
before_install: bash ./.ci/travis-dependencies.sh
|
||||
|
||||
script: bash ./.ci/travis-compile.sh
|
||||
|
||||
|
||||
# Builds for pull requests skip the deployment step altogether
|
||||
deploy:
|
||||
# Deploy configuration for "beta" releases
|
||||
- provider: releases
|
||||
api_key:
|
||||
secure: mLMF41q7xgOR1sjczsilEy7HQis2PkZCzhfOGbn/8FoOQnmmPOZjrsdhn06ZSl3SFsbfCLuClDYXAbFscQmdgjcGN5AmHV+JYfW650QEuQa/f4/lQFsVRtEqUA1O3FQ0OuRxdpCfJubZBdFVH8SbZ93GLC5zXJbkWQNq+xCX1fU=
|
||||
skip_cleanup: true
|
||||
name: "Cockatrice $TRAVIS_TAG"
|
||||
body: "Beta release of Cockatrice"
|
||||
file_glob: true
|
||||
file: "build/Cockatrice-*"
|
||||
overwrite: true
|
||||
draft: false
|
||||
prerelease: true
|
||||
on:
|
||||
tags: true
|
||||
repo: Cockatrice/Cockatrice
|
||||
condition: $BUILDTYPE = Release && $TRAVIS_TAG =~ ([0-9]|[1-9][0-9])(\.([0-9]|[1-9][0-9])){2}-beta(\.([2-9]|[1-9][0-9]))?$ # regex to match semver naming convention for beta pre-releases
|
||||
|
||||
# Deploy configuration for "stable" releases
|
||||
- provider: releases
|
||||
api_key:
|
||||
secure: mLMF41q7xgOR1sjczsilEy7HQis2PkZCzhfOGbn/8FoOQnmmPOZjrsdhn06ZSl3SFsbfCLuClDYXAbFscQmdgjcGN5AmHV+JYfW650QEuQa/f4/lQFsVRtEqUA1O3FQ0OuRxdpCfJubZBdFVH8SbZ93GLC5zXJbkWQNq+xCX1fU=
|
||||
skip_cleanup: true
|
||||
file_glob: true
|
||||
file: "build/Cockatrice-*"
|
||||
overwrite: true
|
||||
draft: false
|
||||
prerelease: false
|
||||
on:
|
||||
tags: true
|
||||
repo: Cockatrice/Cockatrice
|
||||
condition: $BUILDTYPE = Release && $TRAVIS_TAG =~ ([0-9]|[1-9][0-9])(\.([0-9]|[1-9][0-9])){2}$ # regex to match semver naming convention for stable full releases
|
||||
|
||||
|
||||
notifications:
|
||||
slack: cockatrice:dNA81maCU8SAHB7pYrCWiQg9
|
||||
webhooks:
|
||||
urls:
|
||||
- https://webhooks.gitter.im/e/d94969c3b01b22cbdcb7
|
||||
- https://webhooks.gitter.im/e/d94969c3b01b22cbdcb7
|
||||
on_success: change
|
||||
on_failure: change
|
||||
on_start: never
|
||||
deploy:
|
||||
provider: bintray
|
||||
file: "build/bintray_deploy.json"
|
||||
user: "ctrlaltca"
|
||||
key:
|
||||
secure: DtVeeLoi5fZG/RvLTecRnRQGW9fVNS4Oa5iut2vJa14PdKBAJiXACQ0EzcRJFsbtby7MyMc2IVtT5skpvsaSqkpaxoBaL1YtKwJ4CTkYcm2MDWHS7UlijuxxTjI6BnaL3lcCCIeG+NHBZa3dV2YNJ1sWv6Xmiiix1ujPPW8VtnM=
|
||||
on:
|
||||
condition: $BUILDTYPE = Release
|
||||
on_cancel: change
|
||||
on_error: change
|
||||
|
||||
|
||||
# official validator for ".travis.yml" config file: https://yaml.travis-ci.org
|
||||
# travis config documentation: https://docs.travis-ci.com/user/customizing-the-build
|
||||
|
||||
@@ -10,4 +10,3 @@ source_lang = en
|
||||
file_filter = oracle/translations/oracle_<lang>.ts
|
||||
source_file = oracle/translations/oracle_en.ts
|
||||
source_lang = en
|
||||
|
||||
|
||||
162
CMakeLists.txt
@@ -5,25 +5,16 @@
|
||||
# This file sets all the variables shared between the projects
|
||||
# like the installation path, compilation flags etc..
|
||||
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
|
||||
if(POLICY CMP0020)
|
||||
cmake_policy(SET CMP0020 OLD)
|
||||
endif()
|
||||
|
||||
if(POLICY CMP0043)
|
||||
cmake_policy(SET CMP0043 OLD)
|
||||
endif()
|
||||
|
||||
if(POLICY CMP0048)
|
||||
cmake_policy(SET CMP0048 OLD)
|
||||
endif()
|
||||
# Cmake 3.1 is required to enable C++11 support correctly
|
||||
cmake_minimum_required(VERSION 3.1)
|
||||
|
||||
if(POLICY CMP0064)
|
||||
cmake_policy(SET CMP0064 OLD)
|
||||
cmake_policy(SET CMP0064 NEW)
|
||||
endif()
|
||||
|
||||
set(PROJECT_NAME "Cockatrice")
|
||||
if(POLICY CMP0071)
|
||||
cmake_policy(SET CMP0071 NEW)
|
||||
endif()
|
||||
|
||||
# Default to "Release" build type
|
||||
# User-provided value for CMAKE_BUILD_TYPE must be checked before the PROJECT() call
|
||||
@@ -33,9 +24,21 @@ ELSE()
|
||||
SET(CMAKE_BUILD_TYPE Release CACHE STRING "Type of build")
|
||||
ENDIF()
|
||||
|
||||
# A project name is needed for CPack
|
||||
PROJECT("${PROJECT_NAME}")
|
||||
# Early detect ccache
|
||||
find_program(CCACHE_PROGRAM ccache)
|
||||
if(CCACHE_PROGRAM)
|
||||
# Support Unix Makefiles and Ninja
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
|
||||
MESSAGE(STATUS "Found CCache ${CCACHE_PROGRAM}")
|
||||
endif()
|
||||
|
||||
# A project name is needed for CPack
|
||||
# Version can be overriden by git tags, see cmake/getversion.cmake
|
||||
PROJECT("Cockatrice" VERSION 2.5.2)
|
||||
|
||||
# Use c++11 for all targets
|
||||
set(CMAKE_CXX_STANDARD 11 CACHE STRING "C++ ISO Standard")
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||
|
||||
# Set conventional loops
|
||||
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
|
||||
@@ -52,10 +55,28 @@ include(createversionfile)
|
||||
# Define a proper install path
|
||||
if(UNIX)
|
||||
if(APPLE)
|
||||
# MacOS X
|
||||
# macOS
|
||||
# Due to the special bundle structure ignore
|
||||
# the prefix eventually set by the user.
|
||||
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/release)
|
||||
|
||||
# Force ccache usage if available
|
||||
get_property(RULE_LAUNCH_COMPILE GLOBAL PROPERTY RULE_LAUNCH_COMPILE)
|
||||
if(RULE_LAUNCH_COMPILE)
|
||||
MESSAGE(STATUS "Force enabling CCache usage under macOS")
|
||||
# Set up wrapper scripts
|
||||
configure_file(${CMAKE_MODULE_PATH}/launch-c.in launch-c)
|
||||
configure_file(${CMAKE_MODULE_PATH}/launch-cxx.in launch-cxx)
|
||||
execute_process(COMMAND chmod a+rx
|
||||
"${CMAKE_BINARY_DIR}/launch-c"
|
||||
"${CMAKE_BINARY_DIR}/launch-cxx")
|
||||
|
||||
# Set Xcode project attributes to route compilation through our scripts
|
||||
set(CMAKE_XCODE_ATTRIBUTE_CC "${CMAKE_BINARY_DIR}/launch-c")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_CXX "${CMAKE_BINARY_DIR}/launch-cxx")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_LD "${CMAKE_BINARY_DIR}/launch-c")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_LDPLUSPLUS "${CMAKE_BINARY_DIR}/launch-cxx")
|
||||
endif()
|
||||
else()
|
||||
# Linux / BSD
|
||||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
@@ -73,10 +94,10 @@ endif()
|
||||
|
||||
# Define proper compilation flags
|
||||
IF(MSVC)
|
||||
# Visual Studio:
|
||||
# Maximum optimization
|
||||
# Visual Studio:
|
||||
# Maximum optimization
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "/Ox /MD")
|
||||
# Generate complete debugging information
|
||||
# Generate complete debugging information
|
||||
#set(CMAKE_CXX_FLAGS_DEBUG "/Zi")
|
||||
ELSEIF (CMAKE_COMPILER_IS_GNUCXX)
|
||||
# linux/gcc, bsd/gcc, windows/mingw
|
||||
@@ -104,58 +125,31 @@ IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
||||
ADD_DEFINITIONS("-DSFMT_MEXP=19937")
|
||||
ENDIF()
|
||||
|
||||
# Find Qt and enable the needed features
|
||||
# Default is Qt5 unless WITH_QT4 option is enabled
|
||||
option(WITH_QT4 "Force the use of Qt4 libraries" OFF)
|
||||
# Find Qt5
|
||||
OPTION(UPDATE_TRANSLATIONS "Update translations on compile" OFF)
|
||||
MESSAGE(STATUS "UPDATE TRANSLATIONS: ${UPDATE_TRANSLATIONS}")
|
||||
|
||||
IF(NOT WITH_QT4)
|
||||
# First known not-broken Qt5 version (5.0.2 available on old ubuntus is buggy).
|
||||
FIND_PACKAGE(Qt5Widgets 5.0.3)
|
||||
IF(WIN32)
|
||||
FIND_PACKAGE(Qt5Core 5.4.0 REQUIRED) # For QSysInfo::buildAbi()
|
||||
ELSE()
|
||||
FIND_PACKAGE(Qt5Core 5.0.3 REQUIRED)
|
||||
ENDIF()
|
||||
|
||||
IF(Qt5Widgets_FOUND)
|
||||
MESSAGE(STATUS "Found Qt ${Qt5Widgets_VERSION_STRING}")
|
||||
IF(Qt5Core_FOUND)
|
||||
MESSAGE(STATUS "Found Qt ${Qt5Core_VERSION_STRING}")
|
||||
|
||||
# FIX: Qt was built with -reduce-relocations
|
||||
if (Qt5_POSITION_INDEPENDENT_CODE)
|
||||
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
endif()
|
||||
|
||||
FIND_PACKAGE(Qt5LinguistTools)
|
||||
IF(UPDATE_TRANSLATIONS)
|
||||
IF(NOT Qt5_LUPDATE_EXECUTABLE)
|
||||
MESSAGE(WARNING "Qt's lupdate not found.")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(NOT Qt5_LRELEASE_EXECUTABLE)
|
||||
MESSAGE(WARNING "Qt's lrelease not found.")
|
||||
ENDIF()
|
||||
# guess plugins and libraries directory
|
||||
set(QT_PLUGINS_DIR "${Qt5Core_DIR}/../../../plugins")
|
||||
get_target_property(QT_LIBRARY_DIR Qt5::Core LOCATION)
|
||||
get_filename_component(QT_LIBRARY_DIR ${QT_LIBRARY_DIR} PATH)
|
||||
|
||||
ELSE()
|
||||
FIND_PACKAGE(Qt4 4.8.0 REQUIRED)
|
||||
IF(QT4_FOUND)
|
||||
# Old FindQt4.cmake modules used the same flag with different case
|
||||
SET(Qt4_FOUND TRUE)
|
||||
ENDIF()
|
||||
IF(Qt4_FOUND)
|
||||
MESSAGE(STATUS "Found Qt ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}")
|
||||
|
||||
IF(UPDATE_TRANSLATIONS)
|
||||
IF(NOT QT_LUPDATE_EXECUTABLE)
|
||||
MESSAGE(WARNING "Qt's lupdate not found.")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(NOT QT_LRELEASE_EXECUTABLE)
|
||||
MESSAGE(WARNING "Qt's lrelease not found.")
|
||||
ENDIF()
|
||||
|
||||
ELSE()
|
||||
MESSAGE(FATAL_ERROR "No Qt4 or Qt5 found!")
|
||||
ENDIF()
|
||||
MESSAGE(FATAL_ERROR "No Qt5 found!")
|
||||
ENDIF()
|
||||
|
||||
set(CMAKE_AUTOMOC TRUE)
|
||||
@@ -169,14 +163,15 @@ IF(WIN32)
|
||||
ENDIF()
|
||||
|
||||
# Package builder
|
||||
set(CPACK_PACKAGE_CONTACT "Daenyth+github@gmail.com")
|
||||
set(CPACK_PACKAGE_CONTACT "Gavin Bisesi <Daenyth+github@gmail.com>")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${PROJECT_NAME})
|
||||
set(CPACK_PACKAGE_VENDOR "Cockatrice Development Team")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README.md")
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/COPYING")
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
|
||||
set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
|
||||
set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_VERSION_FILENAME}")
|
||||
|
||||
if(UNIX)
|
||||
if(APPLE)
|
||||
@@ -185,35 +180,40 @@ if(UNIX)
|
||||
set(CPACK_DMG_FORMAT "UDBZ")
|
||||
set(CPACK_DMG_VOLUME_NAME "${PROJECT_NAME}")
|
||||
set(CPACK_SYSTEM_NAME "OSX")
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}")
|
||||
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/cockatrice/resources/appicon.icns")
|
||||
else()
|
||||
# linux
|
||||
set(CPACK_GENERATOR DEB ${CPACK_GENERATOR})
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}")
|
||||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
|
||||
set(CPACK_DEBIAN_PACKAGE_SECTION "games")
|
||||
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://github.com/Cockatrice/Cockatrice")
|
||||
IF(Qt5Widgets_FOUND)
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqt5multimedia5-plugins")
|
||||
IF(CPACK_GENERATOR STREQUAL "RPM")
|
||||
set(CPACK_RPM_PACKAGE_LICENSE "GPLv2")
|
||||
set(CPACK_RPM_PACKAGE_REQUIRES "protobuf, qt5-qttools, qt5-qtsvg, qt5-qtmultimedia")
|
||||
set(CPACK_RPM_PACKAGE_GROUP "Amusements/Games")
|
||||
set(CPACK_RPM_PACKAGE_URL "http://github.com/Cockatrice/Cockatrice")
|
||||
ELSE()
|
||||
set(CPACK_GENERATOR DEB)
|
||||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
|
||||
set(CPACK_DEBIAN_PACKAGE_SECTION "games")
|
||||
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://github.com/Cockatrice/Cockatrice")
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqt5multimedia5-plugins, libqt5svg5")
|
||||
ENDIF()
|
||||
endif()
|
||||
elseif(WIN32)
|
||||
set(CPACK_GENERATOR NSIS ${CPACK_GENERATOR})
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}")
|
||||
|
||||
# Configure file with custom definitions for NSIS.
|
||||
configure_file(
|
||||
${CMAKE_MODULE_PATH}/NSIS.definitions.nsh.in
|
||||
${PROJECT_BINARY_DIR}/NSIS.definitions.nsh
|
||||
)
|
||||
endif()
|
||||
|
||||
# Configure file with build deployment data for travis
|
||||
configure_file(
|
||||
${CMAKE_MODULE_PATH}/bintray_deploy.json.in
|
||||
${PROJECT_BINARY_DIR}/bintray_deploy.json
|
||||
)
|
||||
# include vcredist into the package; NSIS will take care of running it
|
||||
IF(MSVC)
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
INSTALL(FILES "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/redist/MSVC/14.13.26020/vc_redist.x64.exe" DESTINATION ./)
|
||||
else()
|
||||
INSTALL(FILES "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/redist/MSVC/14.13.26020/vc_redist.x86.exe" DESTINATION ./)
|
||||
endif()
|
||||
ENDIF()
|
||||
endif()
|
||||
|
||||
include(CPack)
|
||||
|
||||
@@ -222,23 +222,21 @@ option(WITH_SERVER "build servatrice" OFF)
|
||||
add_subdirectory(common)
|
||||
if(WITH_SERVER)
|
||||
add_subdirectory(servatrice)
|
||||
SET(CPACK_INSTALL_CMAKE_PROJECTS "servatrice;servatrice;ALL;/" ${CPACK_INSTALL_CMAKE_PROJECTS})
|
||||
SET(CPACK_INSTALL_CMAKE_PROJECTS "Servatrice;Servatrice;ALL;/" ${CPACK_INSTALL_CMAKE_PROJECTS})
|
||||
endif()
|
||||
|
||||
# Compile cockatrice (default on)
|
||||
option(WITH_CLIENT "build cockatrice" ON)
|
||||
if(WITH_CLIENT)
|
||||
add_subdirectory(cockatrice)
|
||||
add_subdirectory(sounds)
|
||||
add_subdirectory(themes)
|
||||
SET(CPACK_INSTALL_CMAKE_PROJECTS "cockatrice;cockatrice;ALL;/" ${CPACK_INSTALL_CMAKE_PROJECTS})
|
||||
SET(CPACK_INSTALL_CMAKE_PROJECTS "Cockatrice;Cockatrice;ALL;/" ${CPACK_INSTALL_CMAKE_PROJECTS})
|
||||
endif()
|
||||
|
||||
# Compile oracle (default on)
|
||||
option(WITH_ORACLE "build oracle" ON)
|
||||
if(WITH_ORACLE)
|
||||
add_subdirectory(oracle)
|
||||
SET(CPACK_INSTALL_CMAKE_PROJECTS "release/oracle.app;oracle;ALL;/" ${CPACK_INSTALL_CMAKE_PROJECTS})
|
||||
SET(CPACK_INSTALL_CMAKE_PROJECTS "Oracle;Oracle;ALL;/" ${CPACK_INSTALL_CMAKE_PROJECTS})
|
||||
endif()
|
||||
|
||||
# Compile tests (default off)
|
||||
|
||||
210
CONTRIBUTING.md
@@ -1,210 +0,0 @@
|
||||
# Style Guide #
|
||||
|
||||
### Compatibility ###
|
||||
|
||||
Cockatrice is written in C++-03, so do not use C++11 constructs such as `auto`.
|
||||
|
||||
Cockatrice support both Qt 4 and Qt 5, so make sure that your code compiles
|
||||
with both. If there have been breaking changes between Qt 4 and 5, use a
|
||||
statement such as
|
||||
|
||||
#if QT_VERSION >= 0x500000
|
||||
doSomethingWithQt5();
|
||||
#else
|
||||
doSomethingWithQt4();
|
||||
#endif
|
||||
|
||||
For consistency, use Qt data structures where possible, such as `QString` over
|
||||
`std::string` or `QList` over `std::vector`.
|
||||
|
||||
### Header files ###
|
||||
|
||||
Use header files with the extension `.h` and source files with the extension
|
||||
`.cpp`.
|
||||
|
||||
Use header guards in the form of `FILE_NAME_H`.
|
||||
|
||||
Simple functions, such as getters, may be written inline in the header file,
|
||||
but other functions should be written in the source file.
|
||||
|
||||
Keep library includes and project includes grouped together. So this is okay:
|
||||
|
||||
// Good:
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
#include "card.h"
|
||||
#include "deck.h"
|
||||
|
||||
// Good:
|
||||
#include "card.h"
|
||||
#include "deck.h"
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
|
||||
// Bad:
|
||||
#include <QList>
|
||||
#include "card.h"
|
||||
#include <QString>
|
||||
#include "deck.h"
|
||||
|
||||
### Naming ###
|
||||
|
||||
Use `UpperCamelCase` for classes, structs, enums, etc. and `lowerCamelCase` for
|
||||
function and variable names.
|
||||
|
||||
Member variables aren't decorated in any way. Don't prefix or suffix with
|
||||
underscores, etc.
|
||||
|
||||
For arguments to constructors which have the same names as member variables,
|
||||
prefix those arguments with underscores:
|
||||
|
||||
MyClass::MyClass(int _myData)
|
||||
: myData(_myData)
|
||||
{}
|
||||
|
||||
Pointers and references should be denoted with the `*` or `&` going with the
|
||||
variable name:
|
||||
|
||||
// Good:
|
||||
Foo *foo1 = new Foo;
|
||||
Foo &foo2 = *foo1;
|
||||
|
||||
// Bad:
|
||||
Bar* bar1 = new Bar;
|
||||
Bar& bar2 = *bar1;
|
||||
|
||||
Use `0` instead of `NULL` (or `nullptr`) for null pointers.
|
||||
|
||||
### Braces ###
|
||||
|
||||
Use K&R-style braces. Braces for function implementations go on their own
|
||||
lines, but they go on the same line everywhere else:
|
||||
|
||||
int main()
|
||||
{
|
||||
if (someCondition) {
|
||||
doSomething();
|
||||
} else {
|
||||
while (someOtherCondition) {
|
||||
doSomethingElse();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Braces can be omitted for single-statement if's and the like, as long as it is
|
||||
still legible.
|
||||
|
||||
### Tabs ###
|
||||
|
||||
Use only spaces. Four spaces per tab.
|
||||
|
||||
### Lines ###
|
||||
|
||||
Do not have trailing whitespace in your lines.
|
||||
|
||||
Lines should be 80 characters or less, as a soft limit.
|
||||
|
||||
### Memory Management ###
|
||||
|
||||
New code should be written using references over pointers and stack allocation
|
||||
over heap allocation wherever possible.
|
||||
|
||||
// Good: uses stack allocation and references
|
||||
void showCard(const Card &card);
|
||||
int main()
|
||||
{
|
||||
Card card;
|
||||
showCard(card);
|
||||
}
|
||||
|
||||
// Bad: relies on manual memory management and doesn't give us much
|
||||
// null-safety.
|
||||
void showCard(const Card *card);
|
||||
int main()
|
||||
{
|
||||
Card *card = new Card;
|
||||
showCard(card);
|
||||
delete card;
|
||||
}
|
||||
|
||||
(Remember to pass by `const` reference wherever possible, to avoid accidentally
|
||||
mutating objects.)
|
||||
|
||||
When pointers can't be avoided, try to use a smart pointer of some sort, such
|
||||
as `QScopedPointer`, or, less preferably, `QSharedPointer`.
|
||||
|
||||
### Translations: introduction ###
|
||||
|
||||
Basic workflow for translations:
|
||||
1. developer adds a `tr("foo")` string in the code;
|
||||
2. every few days, a maintainer updates the `*_en.ts files` adding the new strings;
|
||||
3. Transifex picks up the new files from github every 24 hours;
|
||||
4. translators translate the new untraslated strings on Transifex;
|
||||
5. before a release, a maintainer fetches the updated translations from Transifex.
|
||||
|
||||
### Translations (for developers) ###
|
||||
|
||||
All the user-interface strings inside Cockatrice's source code must be written in
|
||||
english language. Translations to other languages are managed using [Transifex](https://www.transifex.com/projects/p/cockatrice/).
|
||||
|
||||
If you're about to propose a change that adds or modifies any translatable string
|
||||
in the code, you don't need to take care of adding the new strings to the
|
||||
translation files. Every few days, or when a lot of new strings have been added,
|
||||
someone from the development team will take care of extracing all the new strings,
|
||||
adding them to the english translation files and making them available to
|
||||
translators on Transifex.
|
||||
|
||||
### Translations (for maintainers) ###
|
||||
|
||||
#### Step 2: updating *_en.ts files ####
|
||||
|
||||
When new translatable strings have been added to the code, it would be nice to
|
||||
make them available to translators on Transifex. Every few days, or when a lot
|
||||
of new strings have been added, a maintainer should take care of extracing all
|
||||
the new strings and add them to the english translation files.
|
||||
|
||||
To update the english translation files, re-run cmake enabling the appropriate
|
||||
parameter and then run make:
|
||||
|
||||
cd cockatrice/build
|
||||
cmake .. -DUPDATE_TRANSLATIONS=ON
|
||||
make
|
||||
|
||||
If the parameter has been enabled correctly, when running "make" you should see
|
||||
a line similar to this one (the numbers may vary):
|
||||
|
||||
[ 76%] Generating ../../cockatrice/translations/cockatrice_en.ts
|
||||
Updating '../../cockatrice/translations/cockatrice_en.ts'...
|
||||
Found 857 source text(s) (8 new and 849 already existing)
|
||||
|
||||
You should then notice that the following files have uncommitted changes:
|
||||
|
||||
cockatrice/translations/cockatrice_en.ts
|
||||
oracle/translations/oracle_en.ts
|
||||
|
||||
It's now suggested to disable the parameter using:
|
||||
|
||||
cmake .. -DUPDATE_TRANSLATIONS=OFF
|
||||
|
||||
Now you are ready to propose your change. Once your change gets merged,
|
||||
Transifex will pick up the modified files automatically (checks every 24 hours)
|
||||
and update the interface where translators will be able to translate the new
|
||||
strings.
|
||||
|
||||
#### Step 5: fetch new translations from Transifex ####
|
||||
|
||||
Before rushing out a new release, it would be nice to 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/
|
||||
|
||||
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.
|
||||
|
||||
### Translations (for translators) ###
|
||||
|
||||
Please have a look at the specific [FAQ for translators](https://github.com/Cockatrice/Cockatrice/wiki/Translation-FAQ).
|
||||
15
Dockerfile
@@ -3,26 +3,23 @@ MAINTAINER Gavin Bisesi <Daenyth@gmail.com>
|
||||
|
||||
RUN apt-get update && apt-get install -y software-properties-common
|
||||
RUN apt-add-repository ppa:ubuntu-sdk-team/ppa
|
||||
RUN add-apt-repository -y ppa:smspillaz/cmake-master
|
||||
RUN apt-get update && apt-get install -y\
|
||||
build-essential g++\
|
||||
cmake\
|
||||
git\
|
||||
libprotobuf-dev\
|
||||
libqt5sql5-mysql\
|
||||
libqt5svg5-dev\
|
||||
libqt5webkit5-dev\
|
||||
libsqlite3-dev\
|
||||
protobuf-compiler\
|
||||
qt5-default\
|
||||
qtbase5-dev\
|
||||
qtdeclarative5-dev\
|
||||
qtmultimedia5-dev\
|
||||
qttools5-dev-tools\
|
||||
qttools5-dev
|
||||
qttools5-dev\
|
||||
libqt5sql5-mysql
|
||||
|
||||
ENV dir /home/servatrice/code
|
||||
WORKDIR $dir
|
||||
RUN mkdir oracle
|
||||
COPY COPYING COPYING
|
||||
COPY LICENSE LICENSE
|
||||
COPY CMakeLists.txt CMakeLists.txt
|
||||
COPY cmake/ cmake/
|
||||
COPY common/ common/
|
||||
@@ -30,7 +27,7 @@ COPY servatrice/ servatrice/
|
||||
COPY README.md README.md
|
||||
|
||||
WORKDIR build
|
||||
RUN cmake .. -DWITH_QT4=0 -DWITH_SERVER=1 -DWITH_CLIENT=0 -DWITH_ORACLE=0 &&\
|
||||
RUN cmake .. -DWITH_SERVER=1 -DWITH_CLIENT=0 -DWITH_ORACLE=0 &&\
|
||||
make &&\
|
||||
make install
|
||||
|
||||
|
||||
102
README.md
@@ -2,53 +2,83 @@
|
||||
|
||||
---
|
||||
|
||||
**Table of Contents** [Cockatrice](#cockatrice) | [Downloads](#downloads) | [Get Involved] (#get-involved-) | [Community](#community-resources) | [Translation](#translation-status-) | [Building](#building--) | [Running](#running) | [License](#license-)
|
||||
<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>
|
||||
</p>
|
||||
|
||||
---
|
||||
|
||||
<br><pre>
|
||||
<b>If you're getting started ⇢ [view our webpage](https://cockatrice.github.io/)</b><br>
|
||||
<b>If you're trying to get support or suggest changes ⇢ [file an issue](https://github.com/Cockatrice/Cockatrice/issues/new)</b>
|
||||
<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>
|
||||
|
||||
|
||||
# Cockatrice
|
||||
|
||||
Cockatrice is an open-source multiplatform supported program for playing tabletop card games over a network. The program's server design prevents any kind of client modifications to gain an unfair advantage in a game. The client also has a built in single-player mode where you can brew without being connected to a server. This project is written in C++/Qt with support for both Qt4 and Qt5.<br>
|
||||
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>
|
||||
|
||||
|
||||
# Downloads
|
||||
# Download [](https://tooomm.github.io/github-release-stats/?username=Cockatrice&repository=Cockatrice)
|
||||
|
||||
We offer a download for all full releases and the latest development version (recommended). Full releases are checkpoints with major feature or UI enhancements between them, but are infrequently updated. The development version contains the most recently added features and bugfixes, but can be more unstable. Downloads for development versions are updated automatically with every change.
|
||||
Downloads are hosted on [BinTray](https://bintray.com/cockatrice/Cockatrice).
|
||||
Downloads are available for full releases and the current beta version in development.<br>
|
||||
Full releases are checkpoints featuring major feature or UI enhancements - we recommend to use those. There is no strict schedule for new full releases.
|
||||
|
||||
- Latest development version (recommended): [  ](https://bintray.com/cockatrice/Cockatrice/Cockatrice-git/_latestVersion#files)
|
||||
- Latest full release: [  ](https://bintray.com/cockatrice/Cockatrice/Cockatrice/_latestVersion#files)
|
||||
The beta release contains the most recently added features and bugfixes, but can be unstable. They are released as we feel need.
|
||||
|
||||
- Latest `stable` release (**recommended**): [](https://github.com/cockatrice/cockatrice/releases/latest) [](https://tooomm.github.io/github-release-stats/?username=Cockatrice&repository=Cockatrice)<br>
|
||||
|
||||
- Latest `beta` release: [](https://github.com/cockatrice/cockatrice/releases) [](https://tooomm.github.io/github-release-stats/?username=Cockatrice&repository=Cockatrice)
|
||||
- Beta versions may be unstable and contain bugs.
|
||||
- To be a Cockatrice Beta Tester, use this version. Find more information [here](https://github.com/Cockatrice/Cockatrice/wiki/Release-Channels)!
|
||||
|
||||
|
||||
# Get Involved [](https://gitter.im/Cockatrice/Cockatrice)
|
||||
# Get Involved [](https://gitter.im/Cockatrice/Cockatrice)
|
||||
|
||||
Chat with the Cockatrice developers on Gitter. Come here to talk about the application, features, or just to hang out. For support regarding specific servers, please contact that server's admin or forum for support rather than asking here.<br>
|
||||
[Chat](https://gitter.im/Cockatrice/Cockatrice) with the Cockatrice developers on Gitter. Come here to talk about the application, features, or just to hang out. 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.
|
||||
|
||||
Read the long-term project **roadmap** to see planned edits and milestones [here](https://docs.google.com/document/d/1Ewe5uSaRE2nR2pNPMaGmP6gVZdqgFbBgwSscGqIr4W0/edit).
|
||||
|
||||
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.
|
||||
|
||||
|
||||
# Community Resources
|
||||
|
||||
- [Cockatrice Official Site](https://cockatrice.github.io)
|
||||
- [Cockatrice Official Wiki](https://github.com/Cockatrice/Cockatrice/wiki)
|
||||
- [Cockatrice Official Discord](https://discord.gg/3Z9yzmA)
|
||||
- [reddit r/Cockatrice](https://reddit.com/r/cockatrice)
|
||||
|
||||
|
||||
# Translation Status [](https://www.transifex.com/projects/p/cockatrice/)
|
||||
|
||||
Cockatrice uses Transifex for translations. You can help us bring Cockatrice and Oracle to your language or just edit single wordings right from within your browser by simply visiting our [Transifex project page](https://www.transifex.com/projects/p/cockatrice/).<br>
|
||||
# Translations [](https://www.transifex.com/projects/p/cockatrice/)
|
||||
|
||||
Cockatrice uses Transifex for translations. You can help us bring Cockatrice and Oracle to your language or just edit single wordings right from within your browser by visiting our [Transifex project page](https://www.transifex.com/projects/p/cockatrice/).<br>
|
||||
|
||||
| Cockatrice | Oracle |
|
||||
|:-:|:-:|
|
||||
| [](https://www.transifex.com/projects/p/cockatrice/) | [](https://www.transifex.com/projects/p/cockatrice/) |
|
||||
| [](https://www.transifex.com/projects/p/cockatrice/) | [](https://www.transifex.com/projects/p/cockatrice/) |
|
||||
|
||||
Check out our [Translator FAQ](https://github.com/Cockatrice/Cockatrice/wiki/Translation-FAQ) for more information about contributing!<br>
|
||||
|
||||
|
||||
# Building [](https://travis-ci.org/Cockatrice/Cockatrice) [](https://ci.appveyor.com/project/Daenyth/cockatrice/branch/master)
|
||||
# Build [](https://travis-ci.org/Cockatrice/Cockatrice) [](https://ci.appveyor.com/project/Daenyth/cockatrice/branch/master)
|
||||
|
||||
**Detailed compiling instructions are on the Cockatrice wiki under [Compiling Cockatrice](https://github.com/Cockatrice/Cockatrice/wiki/Compiling-Cockatrice)**
|
||||
|
||||
@@ -58,11 +88,7 @@ Dependencies:
|
||||
- [CMake](https://www.cmake.org/)
|
||||
|
||||
Oracle can optionally use zlib to load zipped files:
|
||||
- [zlib](http://www.zlib.net/) (no https!)
|
||||
|
||||
The server requires an additional dependency when compiled under Qt4:
|
||||
- [libgcrypt](https://www.gnu.org/software/libgcrypt/)
|
||||
|
||||
- [zlib](https://www.zlib.net/)
|
||||
|
||||
To compile:
|
||||
|
||||
@@ -70,7 +96,7 @@ To compile:
|
||||
cd build
|
||||
cmake ..
|
||||
make
|
||||
|
||||
|
||||
You can then run
|
||||
|
||||
make install
|
||||
@@ -86,25 +112,33 @@ The following flags can be passed to `cmake`:
|
||||
- `-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).
|
||||
- `-DPORTABLE=1` Build portable versions of client & oracle (default 0 = no).
|
||||
- `-DWITH_QT4=1` Force compilation to use Qt4 instead of Qt5 (default 0 = no).
|
||||
- `-DCMAKE_BUILD_TYPE=Debug` Compile in debug mode. Enables extra logging output, debug symbols, and much more verbose compiler warnings (default `Release`).
|
||||
- `-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```.
|
||||
|
||||
|
||||
#### Building servatrice Docker container
|
||||
# Run
|
||||
|
||||
`Cockatrice` is the game client
|
||||
`Oracle` fetches card data
|
||||
`Servatrice` is the server<br>
|
||||
|
||||
|
||||
**Servatrice Docker container**
|
||||
|
||||
You can run an instance of Servatrice (the Cockatrice server) using [Docker](https://www.docker.com/what-docker) and the Cockatrice Dockerfile.<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.
|
||||
|
||||
# Running
|
||||
Find more information on how to use Servatrice with Docker in our [wiki](https://github.com/Cockatrice/Cockatrice/wiki/Setting-up-Servatrice#using-docker).
|
||||
|
||||
`oracle` fetches card data
|
||||
`cockatrice` is the game client
|
||||
`servatrice` is the server<br>
|
||||
|
||||
|
||||
# License [](https://github.com/Cockatrice/Cockatrice/blob/master/COPYING)
|
||||
|
||||
Cockatrice is free software, licensed under the [GPLv2](https://github.com/Cockatrice/Cockatrice/blob/master/COPYING).
|
||||
# License [](https://github.com/Cockatrice/Cockatrice/blob/master/LICENSE)
|
||||
|
||||
Cockatrice is free software, licensed under the [GPLv2](https://github.com/Cockatrice/Cockatrice/blob/master/LICENSE).
|
||||
|
||||
34
TODO.md
@@ -1,34 +0,0 @@
|
||||
#TODOs
|
||||
|
||||
This is an unordered list of possible todo items for Cockatrice.
|
||||
Note that "improve" and "write" always also means: "document and comment"
|
||||
|
||||
##Improve packaging:
|
||||
* Improve nsis file git hash extraction, it only works if the build directory is cleared as version_string.cpp does not seem to get updated by git pull/cmake
|
||||
* Create script/... for creating Linux packages (deb, rpm, ebuild, ...) or at least an official tarball/git tags; package maintainers dislike using git snapshots so much that they rather ignore software without stable tarballs.
|
||||
|
||||
##Scripts
|
||||
* Write example init script for servatrice.
|
||||
|
||||
##Improve usermanual:
|
||||
* Improve Layout, Text, Screenshots; nearly everything is still quick n dirty copy and paste.
|
||||
* Add missing TODOs
|
||||
* Translate the Documentation
|
||||
* Rename the picture filenames to something more meaningful.
|
||||
* Create an index, lists of tables/figures/...
|
||||
|
||||
##Create developer documentation:
|
||||
* Create developer manual
|
||||
* Add comments to code
|
||||
* Describe which components exist and how they work and interact
|
||||
* Describe the *.proto files
|
||||
* Comment and document servatrice.sql
|
||||
* Document everything!1!!
|
||||
|
||||
##Else
|
||||
|
||||
* Update SFMT library (http://www.math.sci.hiroshima-u.ac.jp/~m-mat@math.sci.hiroshima-u.ac.jp/MT/SFMT/) in common/sfmt and adapt common/rng_sfmt.cpp
|
||||
|
||||
* Move hardcoded URLs (especially from oracle and cockatrice) into a config file.
|
||||
|
||||
* Search git log for useful information/problems/bugs/...
|
||||
92
appveyor.yml
@@ -1,92 +0,0 @@
|
||||
version: 0.0.1-branch-{branch}-build-{build}
|
||||
cache:
|
||||
- c:\protobuf
|
||||
- c:\protoc
|
||||
- c:\zlib
|
||||
environment:
|
||||
matrix:
|
||||
- vc_arch: amd64
|
||||
choco_arch:
|
||||
nuget_arch: x64
|
||||
target_arch: x86_64
|
||||
qt_ver: 5.5\msvc2013_64
|
||||
bintray_path: Win64
|
||||
- vc_arch: amd64_x86 # cross-compile from amd64 to x86
|
||||
choco_arch: --x86
|
||||
nuget_arch: Win32
|
||||
target_arch: x86
|
||||
qt_ver: 5.5\msvc2013
|
||||
bintray_path: Win32
|
||||
install:
|
||||
- systeminfo
|
||||
# upgrade cmake in order to have c++11 support
|
||||
- choco install cmake -y
|
||||
- choco install nsis -y
|
||||
- ps: |
|
||||
if (Test-Path c:\protoc) {
|
||||
echo "using protoc from cache"
|
||||
} else {
|
||||
Invoke-WebRequest "https://github.com/google/protobuf/releases/download/v2.6.1/protoc-2.6.1-win32.zip" -OutFile c:\protoc-2.6.1-win32.zip
|
||||
c:\cygwin\bin\bash -lc "cd /cygdrive/c; 7z x -y protoc-2.6.1-win32.zip -oc:\protoc"
|
||||
}
|
||||
- ps: |
|
||||
if (Test-Path c:\protobuf) {
|
||||
echo "using protobuf from cache"
|
||||
} else {
|
||||
nuget install protobuf-v120 -OutputDirectory c:\protobuf
|
||||
}
|
||||
- ps: |
|
||||
if (Test-Path c:\zlib) {
|
||||
echo "using zlib from cache"
|
||||
} else {
|
||||
nuget install zlib -OutputDirectory c:\zlib
|
||||
}
|
||||
build_script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- '"c:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/vcvarsall" %vc_arch%'
|
||||
- path
|
||||
- ps: |
|
||||
$zlibinc = c:\cygwin\bin\find /cygdrive/c/zlib/ -path '*v120*/zlib.h'
|
||||
$zlibinc = c:\cygwin\bin\dirname $zlibinc
|
||||
$zlibinc = c:\cygwin\bin\cygpath -m $zlibinc
|
||||
$zliblib = c:\cygwin\bin\find /cygdrive/c/zlib/ -path "*v120*/$env:nuget_arch/Release/zlib.lib"
|
||||
$zliblib = c:\cygwin\bin\cygpath -m $zliblib
|
||||
$protoinc = c:\cygwin\bin\find /cygdrive/c/protobuf/ -name 'google'
|
||||
$protoinc = c:\cygwin\bin\dirname $protoinc
|
||||
$protoinc = c:\cygwin\bin\cygpath -m $protoinc
|
||||
$protolib = c:\cygwin\bin\find /cygdrive/c/protobuf/ -path "*/lib/$env:nuget_arch/v120/Release/libprotobuf.lib"
|
||||
$protolib = c:\cygwin\bin\cygpath -m $protolib
|
||||
$protoc = c:\cygwin\bin\find /cygdrive/c/protoc/ -name "protoc.exe"
|
||||
$protoc = c:\cygwin\bin\cygpath -m $protoc
|
||||
Write-Output "ZLIBINC = $zlibinc"
|
||||
Write-Output "ZLIBLIB = $zliblib"
|
||||
Write-Output "PROTOINC = $protoinc"
|
||||
Write-Output "PROTOLIB = $protolib"
|
||||
Write-Output "PROTOC = $protoc"
|
||||
cmake .. "-GNMake Makefiles" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_PREFIX_PATH=c:/Qt/$env:qt_ver" "-DWITH_SERVER=1" "-DZLIB_INCLUDE_DIR=$zlibinc" "-DZLIB_LIBRARY=$zliblib" "-DPROTOBUF_INCLUDE_DIR=$protoinc" "-DPROTOBUF_LIBRARIES=$protolib" "-DPROTOBUF_LIBRARIES=$protolib" "-DPROTOBUF_LIBRARY=$protolib" "-DPROTOBUF_PROTOC_EXECUTABLE=$protoc"
|
||||
- nmake package
|
||||
- c:\cygwin\bin\ls -l
|
||||
- ps: |
|
||||
$exe = dir -name *.exe
|
||||
$new_name = $exe.Replace(".exe", "-${env:target_arch}_qt5.exe")
|
||||
Push-AppveyorArtifact $exe -FileName $new_name
|
||||
$cmake_name = $exe.Replace(".exe", "-${env:target_arch}_qt5.cmake.txt")
|
||||
Push-AppveyorArtifact CMakeCache.txt -FileName $cmake_name
|
||||
$json = New-Object PSObject
|
||||
(New-Object PSObject | Add-Member -PassThru NoteProperty bin $new_name | Add-Member -PassThru NoteProperty cmake $cmake_name | Add-Member -PassThru NoteProperty commit $env:APPVEYOR_REPO_COMMIT) | ConvertTo-JSON | Out-File -FilePath "latest-$env:target_arch" -Encoding ASCII
|
||||
Push-AppveyorArtifact "latest-$env:target_arch"
|
||||
$bt_password = ConvertTo-SecureString $Env:BINTRAY_APIKEY -AsPlainText -Force
|
||||
$bt_credentials = New-Object System.Management.Automation.PSCredential ($Env:BINTRAY_USER, $bt_password)
|
||||
$exe -match "Cockatrice-(?<content>.*)\.exe"
|
||||
$version = $matches['content']
|
||||
$bt_headers = @{
|
||||
"X-Bintray-Package" = "Cockatrice-git";
|
||||
"X-Bintray-Version" = $version;
|
||||
"X-Bintray-Publish" = 1;
|
||||
"X-Bintray-Override" = 1;
|
||||
}
|
||||
$url = "https://api.bintray.com/content/cockatrice/Cockatrice/$env:bintray_path/$new_name"
|
||||
$result = Invoke-WebRequest -Uri $url -Credential $bt_credentials -Method PUT -Headers $bt_headers -InFile "$exe"
|
||||
Write-Host $result
|
||||
test: off
|
||||
22
clangify.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This script will run clang-format on all modified, non-3rd-party C++/Header files.
|
||||
|
||||
set -e
|
||||
|
||||
if hash clang-format 2>/dev/null && hash git 2>/dev/null; then
|
||||
files_to_clean=($(git diff --name-only $(git merge-base origin/master HEAD)))
|
||||
|
||||
printf "%s\n" ${files_to_clean[@]} | \
|
||||
xargs -I{} find '{}' \( -name "*.cpp" -o -name "*.h" \) \
|
||||
-not -path "./cockatrice/src/qt-json/*" \
|
||||
-not -path "./servatrice/src/smtp/*" \
|
||||
-not -path "./common/sfmt/*" \
|
||||
-not -path "./oracle/src/zip/*" \
|
||||
-not -path "./build*/*" \
|
||||
-exec clang-format -style=file -i {} \;
|
||||
echo "Successfully formatted following files:"
|
||||
printf "%s\n" ${files_to_clean[@]}
|
||||
else
|
||||
echo "Please install clang-format and git to use this program"
|
||||
fi
|
||||
@@ -1,46 +0,0 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
# Copied from http://code.google.com/p/emeraldviewer/
|
||||
|
||||
# - Find libgcrypt
|
||||
# Find the libgcrypt includes and library
|
||||
# This module defines
|
||||
# LIBGCRYPT_INCLUDE_DIR, where to find gcrypt.h, etc.
|
||||
# LIBGCRYPT_LIBRARIES, the libraries needed to use libgcrypt.
|
||||
# LIBGCRYPT_FOUND, If false, do not try to use libgcrypt.
|
||||
# also defined, but not for general use are
|
||||
# LIBGCRYPT_LIBRARY, where to find the libgcrypt library.
|
||||
|
||||
FIND_PATH(LIBGCRYPT_INCLUDE_DIR gcrypt.h)
|
||||
|
||||
SET(LIBGCRYPT_NAMES ${LIBGCRYPT_NAMES} gcrypt)
|
||||
FIND_LIBRARY(LIBGCRYPT_LIBRARY
|
||||
NAMES ${LIBGCRYPT_NAMES}
|
||||
)
|
||||
|
||||
IF (LIBGCRYPT_LIBRARY AND LIBGCRYPT_INCLUDE_DIR)
|
||||
SET(LIBGCRYPT_LIBRARIES ${LIBGCRYPT_LIBRARY})
|
||||
SET(LIBGCRYPT_FOUND "YES")
|
||||
ELSE (LIBGCRYPT_LIBRARY AND LIBGCRYPT_INCLUDE_DIR)
|
||||
SET(LIBGCRYPT_FOUND "NO")
|
||||
ENDIF (LIBGCRYPT_LIBRARY AND LIBGCRYPT_INCLUDE_DIR)
|
||||
|
||||
|
||||
IF (LIBGCRYPT_FOUND)
|
||||
IF (NOT LIBGCRYPT_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found libgcrypt: '${LIBGCRYPT_LIBRARIES}' and header in '${LIBGCRYPT_INCLUDE_DIR}'")
|
||||
ENDIF (NOT LIBGCRYPT_FIND_QUIETLY)
|
||||
ELSE (LIBGCRYPT_FOUND)
|
||||
IF (LIBGCRYPT_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR "Could not find libgcrypt library")
|
||||
ENDIF (LIBGCRYPT_FIND_REQUIRED)
|
||||
ENDIF (LIBGCRYPT_FOUND)
|
||||
|
||||
# Deprecated declarations.
|
||||
SET (NATIVE_LIBGCRYPT_INCLUDE_PATH ${LIBGCRYPT_INCLUDE_DIR} )
|
||||
GET_FILENAME_COMPONENT (NATIVE_LIBGCRYPT_LIB_PATH ${LIBGCRYPT_LIBRARY} PATH)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
LIBGCRYPT_LIBRARY
|
||||
LIBGCRYPT_INCLUDE_DIR
|
||||
)
|
||||
@@ -1,158 +0,0 @@
|
||||
INCLUDE(FindQt4)
|
||||
|
||||
set(MOBILITY_CONFIG_MKSPECS_FILE "")
|
||||
IF(EXISTS "${QT_MKSPECS_DIR}/features/mobilityconfig.prf")
|
||||
set(MOBILITY_CONFIG_MKSPECS_FILE "${QT_MKSPECS_DIR}/features/mobilityconfig.prf")
|
||||
ELSEIF(EXISTS "${QT_MKSPECS_DIR}/features/mobility.prf")
|
||||
set(MOBILITY_CONFIG_MKSPECS_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/mobilityconfig.prf")
|
||||
ENDIF()
|
||||
|
||||
macro(export_component component)
|
||||
IF(NOT ${MOBILITY_CONFIG_MKSPECS_FILE} STREQUAL "")
|
||||
FILE(READ ${MOBILITY_CONFIG_MKSPECS_FILE} MOBILITY_FILE_CONTENTS)
|
||||
STRING(TOLOWER ${component} _COMPONENT)
|
||||
IF(${MOBILITY_FILE_CONTENTS} MATCHES "MOBILITY_CONFIG=.*${_COMPONENT}.*")
|
||||
STRING(TOUPPER ${component} _COMPONENT)
|
||||
SET(QT_MOBILITY_${_COMPONENT}_FOUND 1)
|
||||
SET(QT_MOBILITY_${_COMPONENT}_INCLUDE_DIR ${QT_MOBILITY_PARENT_INCLUDE_DIR}/Qt${component})
|
||||
SET(QT_MOBILITY_${_COMPONENT}_LIBRARY Qt${component})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
endmacro()
|
||||
|
||||
set(VERSION_INFO "")
|
||||
set(FEATURE_FILE_PREFIX "${QT_MKSPECS_DIR}/features/mobility")
|
||||
|
||||
if(DEFINED MOBILITY_VERSION)
|
||||
if(MOBILITY_VERSION STREQUAL "1.1" AND EXISTS "${FEATURE_FILE_PREFIX}11.prf")
|
||||
set(MOBILITY_PRF_FILE "${FEATURE_FILE_PREFIX}11.prf")
|
||||
set(VERSION_INFO "1.1")
|
||||
elseif(MOBILITY_VERSION STREQUAL "1.2" AND EXISTS "${FEATURE_FILE_PREFIX}12.prf")
|
||||
set(MOBILITY_PRF_FILE "${FEATURE_FILE_PREFIX}12.prf")
|
||||
set(VERSION_INFO "1.2")
|
||||
elseif(MOBILITY_VERSION STREQUAL "default" AND EXISTS "${FEATURE_FILE_PREFIX}.prf")
|
||||
set(MOBILITY_PRF_FILE "${FEATURE_FILE_PREFIX}.prf")
|
||||
set(VERSION_INFO "system's default")
|
||||
else()
|
||||
message(STATUS "Couldn't find QtMobility version: ${MOBILITY_VERSION}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED MOBILITY_PRF_FILE)
|
||||
if(EXISTS "${FEATURE_FILE_PREFIX}.prf")
|
||||
set(MOBILITY_PRF_FILE "${FEATURE_FILE_PREFIX}.prf")
|
||||
set(VERSION_INFO "system's default")
|
||||
elseif(EXISTS "${FEATURE_FILE_PREFIX}12.prf")
|
||||
set(MOBILITY_PRF_FILE "${FEATURE_FILE_PREFIX}12.prf")
|
||||
set(VERSION_INFO "1.2")
|
||||
elseif(EXISTS "${FEATURE_FILE_PREFIX}11.prf")
|
||||
set(MOBILITY_PRF_FILE "${FEATURE_FILE_PREFIX}11.prf")
|
||||
set(VERSION_INFO "1.1")
|
||||
else()
|
||||
message(FATAL_ERROR "Couldn't find any version of QtMobility.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
message(STATUS "Using QtMobility version: ${VERSION_INFO}")
|
||||
|
||||
IF(DEFINED MOBILITY_PRF_FILE)
|
||||
FILE(READ ${MOBILITY_PRF_FILE} MOBILITY_FILE_CONTENTS)
|
||||
|
||||
STRING(REGEX MATCH "MOBILITY_PREFIX=([^\n]+)" QT_MOBILITY_PREFIX "${MOBILITY_FILE_CONTENTS}")
|
||||
SET(QT_MOBILITY_PREFIX ${CMAKE_MATCH_1})
|
||||
|
||||
STRING(REGEX MATCH "MOBILITY_INCLUDE=([^\n]+)" QT_MOBILITY_INCLUDE_DIR "${MOBILITY_FILE_CONTENTS}")
|
||||
SET(QT_MOBILITY_INCLUDE_DIR ${CMAKE_MATCH_1})
|
||||
|
||||
STRING(REGEX MATCH "MOBILITY_LIB=([^\n]+)" "\\1" QT_MOBILITY_LIBRARY "${MOBILITY_FILE_CONTENTS}")
|
||||
SET(QT_MOBILITY_LIBRARY_DIR ${CMAKE_MATCH_1})
|
||||
|
||||
#VERSION
|
||||
IF(NOT ${MOBILITY_CONFIG_MKSPECS_FILE} STREQUAL "")
|
||||
FILE(READ ${MOBILITY_CONFIG_MKSPECS_FILE} MOBILITY_CONFIG_FILE_CONTENTS)
|
||||
STRING(REGEX MATCH "MOBILITY_VERSION = ([^\n]+)" QT_MOBILITY_VERSION "${MOBILITY_CONFIG_FILE_CONTENTS}")
|
||||
SET(QT_MOBILITY_VERSION ${CMAKE_MATCH_1})
|
||||
|
||||
STRING(REGEX MATCH "MOBILITY_MAJOR_VERSION = ([^\n]+)" QT_MOBILITY_MAJOR_VERSION "${MOBILITY_CONFIG_FILE_CONTENTS}")
|
||||
SET(QT_MOBILITY_MAJOR_VERSION ${CMAKE_MATCH_1})
|
||||
|
||||
STRING(REGEX MATCH "MOBILITY_MINOR_VERSION = ([^\n]+)" QT_MOBILITY_MINOR_VERSION "${MOBILITY_CONFIG_FILE_CONTENTS}")
|
||||
SET(QT_MOBILITY_MINOR_VERSION ${CMAKE_MATCH_1})
|
||||
|
||||
STRING(REGEX MATCH "MOBILITY_PATCH_VERSION = ([^\n]+)" QT_MOBILITY_PATCH_VERSION "${MOBILITY_CONFIG_FILE_CONTENTS}")
|
||||
SET(QT_MOBILITY_PATCH_VERSION ${CMAKE_MATCH_1})
|
||||
ELSE()
|
||||
SET(QT_MOBILITY_VERSION 1.0.0)
|
||||
SET(QT_MOBILITY_MAJOR_VERSION 1)
|
||||
SET(QT_MOBILITY_MINOR_VERSION 0)
|
||||
SET(QT_MOBILITY_PATCH_VERSION 0)
|
||||
ENDIF()
|
||||
|
||||
SET(QT_MOBILITY_PARENT_INCLUDE_DIR ${QT_MOBILITY_INCLUDE_DIR})
|
||||
SET(QT_MOBILITY_INCLUDE_DIR ${QT_MOBILITY_INCLUDE_DIR}/QtMobility)
|
||||
|
||||
IF(QtMobility_FIND_VERSION_EXACT)
|
||||
IF(QT_MOBILITY_VERSION VERSION_EQUAL QtMobility_FIND_VERSION)
|
||||
SET(QT_MOBILITY_FOUND TRUE)
|
||||
ELSE()
|
||||
SET(QT_MOBILITY_FOUND FALSE)
|
||||
IF(QT_MOBILITY_VERSION VERSION_LESS QtMobility_FIND_VERSION)
|
||||
SET(QT_MOBILITY_TOO_OLD TRUE)
|
||||
ELSE()
|
||||
SET(QT_MOBILITY_TOO_NEW TRUE)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ELSE()
|
||||
IF(QT_MOBILITY_VERSION VERSION_LESS QtMobility_FIND_VERSION)
|
||||
SET(QT_MOBILITY_FOUND FALSE)
|
||||
SET(QT_MOBILITY_TOO_OLD TRUE)
|
||||
ELSE()
|
||||
SET(QT_MOBILITY_FOUND TRUE)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ELSE()
|
||||
SET(QT_MOBILITY_FOUND NOTFOUND)
|
||||
SET(QT_MOBILITY_PREFIX NOTFOUND)
|
||||
SET(QT_MOBILITY_INCLUDE NOTFOUND)
|
||||
SET(QT_MOBILITY_LIB NOTFOUND)
|
||||
ENDIF()
|
||||
|
||||
IF(NOT QT_MOBILITY_FOUND)
|
||||
if(QT_MOBILITY_TOO_OLD)
|
||||
MESSAGE(FATAL_ERROR "The installed QtMobility version ${QT_MOBILITY_VERSION} it too old, version ${QtMobility_FIND_VERSION} is required.")
|
||||
ELSEIF(QT_MOBILITY_TOO_NEW)
|
||||
MESSAGE(FATAL_ERROR "The installed QtMobility version ${QT_MOBILITY_VERSION} it too new, version ${QtMobility_FIND_VERSION} is required.")
|
||||
ELSE()
|
||||
MESSAGE(FATAL_ERROR "QtMobility not found.")
|
||||
ENDIF()
|
||||
ELSE()
|
||||
export_component(Bearer)
|
||||
export_component(Feedback)
|
||||
export_component(Gallery)
|
||||
export_component(PublishSubscribe)
|
||||
export_component(Location)
|
||||
export_component(Organizer)
|
||||
export_component(ServiceFramework)
|
||||
export_component(SystemInfo)
|
||||
export_component(Contacts)
|
||||
export_component(Messaging)
|
||||
export_component(Versit)
|
||||
export_component(Sensors)
|
||||
# VersitOrganizer
|
||||
if(${QT_MOBILITY_CONTACTS_FOUND} AND ${QT_MOBILITY_VERSIT_FOUND})
|
||||
SET(QT_MOBILITY_VERSITORGANIZER_FOUND 1)
|
||||
SET(QT_MOBILITY_VERSITORGANIZER_INCLUDE_DIR ${QT_MOBILITY_PARENT_INCLUDE_DIR}/QtVersitOrganizer)
|
||||
SET(QT_MOBILITY_VERSITORGANIZER_LIBRARY QtVersitOrganizer)
|
||||
endif()
|
||||
|
||||
# MultimediaKit - it's just 'multimedia' in the .prf file.
|
||||
IF(NOT ${MOBILITY_CONFIG_MKSPECS_FILE} STREQUAL "")
|
||||
FILE(READ ${MOBILITY_CONFIG_MKSPECS_FILE} MOBILITY_FILE_CONTENTS)
|
||||
IF(${MOBILITY_FILE_CONTENTS} MATCHES "MOBILITY_CONFIG=.*multimedia.*")
|
||||
SET(QT_MOBILITY_MULTIMEDIAKIT_FOUND 1)
|
||||
SET(QT_MOBILITY_MULTIMEDIAKIT_INCLUDE_DIR ${QT_MOBILITY_PARENT_INCLUDE_DIR}/QtMultimediaKit)
|
||||
SET(QT_MOBILITY_MULTIMEDIAKIT_LIBRARY QtMultimediaKit)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
ENDIF()
|
||||
@@ -5,22 +5,37 @@ if (WIN32)
|
||||
# Get standard installation paths for OpenSSL under Windows
|
||||
|
||||
# http://www.slproweb.com/products/Win32OpenSSL.html
|
||||
set(_OPENSSL_ROOT_HINTS
|
||||
${OPENSSL_ROOT_DIR}
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;Inno Setup: App Path]"
|
||||
ENV OPENSSL_ROOT_DIR
|
||||
)
|
||||
file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles)
|
||||
set(_OPENSSL_ROOT_PATHS
|
||||
"${_programfiles}/OpenSSL"
|
||||
"${_programfiles}/OpenSSL-Win32"
|
||||
"${_programfiles}/OpenSSL-Win64"
|
||||
"C:/OpenSSL/"
|
||||
"C:/OpenSSL-Win32/"
|
||||
"C:/OpenSSL-Win64/"
|
||||
)
|
||||
unset(_programfiles)
|
||||
|
||||
if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
|
||||
# target win64
|
||||
set(_OPENSSL_ROOT_HINTS
|
||||
${OPENSSL_ROOT_DIR}
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;Inno Setup: App Path]"
|
||||
ENV OPENSSL_ROOT_DIR
|
||||
)
|
||||
file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles)
|
||||
set(_OPENSSL_ROOT_PATHS
|
||||
"${_programfiles}/OpenSSL-Win64"
|
||||
"C:/OpenSSL-Win64/"
|
||||
)
|
||||
unset(_programfiles)
|
||||
else( CMAKE_SIZEOF_VOID_P EQUAL 8 )
|
||||
# target win32
|
||||
set(_OPENSSL_ROOT_HINTS
|
||||
${OPENSSL_ROOT_DIR}
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]"
|
||||
ENV OPENSSL_ROOT_DIR
|
||||
)
|
||||
file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles)
|
||||
set(_OPENSSL_ROOT_PATHS
|
||||
"${_programfiles}/OpenSSL"
|
||||
"${_programfiles}/OpenSSL-Win32"
|
||||
"C:/OpenSSL/"
|
||||
"C:/OpenSSL-Win32/"
|
||||
)
|
||||
unset(_programfiles)
|
||||
endif( CMAKE_SIZEOF_VOID_P EQUAL 8 )
|
||||
|
||||
else ()
|
||||
set(_OPENSSL_ROOT_HINTS
|
||||
${OPENSSL_ROOT_DIR}
|
||||
@@ -33,8 +48,10 @@ set(_OPENSSL_ROOT_HINTS_AND_PATHS
|
||||
PATHS ${_OPENSSL_ROOT_PATHS}
|
||||
)
|
||||
|
||||
FIND_FILE(WIN32SSLRUNTIME_LIBEAY NAMES libeay32.dll ${_OPENSSL_ROOT_HINTS_AND_PATHS})
|
||||
FIND_FILE(WIN32SSLRUNTIME_SSLEAY NAMES ssleay32.dll ${_OPENSSL_ROOT_HINTS_AND_PATHS})
|
||||
# For OpenSSL < 1.1, they are named libeay32 and ssleay32 and even if the dll is 64bit, it's still suffixed as *32.dll
|
||||
# For OpenSSL >= 1.1, they are named libcrypto and libssl with no suffix
|
||||
FIND_FILE(WIN32SSLRUNTIME_LIBEAY NAMES libeay32.dll libcrypto.dll ${_OPENSSL_ROOT_HINTS_AND_PATHS})
|
||||
FIND_FILE(WIN32SSLRUNTIME_SSLEAY NAMES ssleay32.dll libssl.dll ${_OPENSSL_ROOT_HINTS_AND_PATHS})
|
||||
|
||||
|
||||
IF(WIN32SSLRUNTIME_LIBEAY AND WIN32SSLRUNTIME_SSLEAY)
|
||||
|
||||
@@ -1,14 +1,24 @@
|
||||
!include ..\..\..\NSIS.definitions.nsh
|
||||
!include "MUI2.nsh"
|
||||
!include "FileFunc.nsh"
|
||||
|
||||
Name "@CPACK_PACKAGE_NAME@"
|
||||
BrandingText "@CPACK_PACKAGE_NAME@-@CPACK_PACKAGE_VERSION_MAJOR@"
|
||||
BrandingText "@CPACK_PACKAGE_FILE_NAME@"
|
||||
OutFile "@CPACK_TOPLEVEL_DIRECTORY@/@CPACK_OUTPUT_FILE_NAME@"
|
||||
SetCompressor /SOLID lzma
|
||||
InstallDir "$PROGRAMFILES\Cockatrice"
|
||||
|
||||
!define UNINSTKEY "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice"
|
||||
!define DEFAULTNORMALDESTINATON "$ProgramFiles\Cockatrice"
|
||||
!define DEFAULTPORTABLEDESTINATON "$Desktop\CockatricePortable"
|
||||
!define INST_DIR "@CPACK_TEMPORARY_DIRECTORY@"
|
||||
|
||||
RequestExecutionlevel highest
|
||||
SetCompressor LZMA
|
||||
|
||||
Var NormalDestDir
|
||||
Var PortableDestDir
|
||||
Var PortableMode
|
||||
|
||||
!include LogicLib.nsh
|
||||
!include FileFunc.nsh
|
||||
!include MUI2.nsh
|
||||
|
||||
!define MUI_ABORTWARNING
|
||||
!define MUI_WELCOMEFINISHPAGE_BITMAP "${NSIS_SOURCE_PATH}\cmake\leftimage.bmp"
|
||||
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "${NSIS_SOURCE_PATH}\cmake\leftimage.bmp"
|
||||
@@ -16,12 +26,13 @@ InstallDir "$PROGRAMFILES\Cockatrice"
|
||||
!define MUI_HEADERIMAGE_BITMAP "${NSIS_SOURCE_PATH}\cmake\headerimage.bmp"
|
||||
!define MUI_HEADERIMAGE_UNBITMAP "${NSIS_SOURCE_PATH}\cmake\headerimage.bmp"
|
||||
!define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of Cockatrice.$\r$\n$\r$\nClick Next to continue."
|
||||
!define MUI_FINISHPAGE_RUN "$INSTDIR/oracle.exe"
|
||||
!define MUI_FINISHPAGE_RUN_TEXT "Run 'Oracle' now to update your card database"
|
||||
!define MUI_FINISHPAGE_RUN_PARAMETERS "-dlsets"
|
||||
!define MUI_FINISHPAGE_RUN "$INSTDIR/cockatrice.exe"
|
||||
!define MUI_FINISHPAGE_RUN_TEXT "Run 'Cockatrice' now"
|
||||
|
||||
!insertmacro MUI_PAGE_WELCOME
|
||||
!insertmacro MUI_PAGE_LICENSE "${NSIS_SOURCE_PATH}\COPYING"
|
||||
!insertmacro MUI_PAGE_LICENSE "${NSIS_SOURCE_PATH}\LICENSE"
|
||||
Page Custom PortableModePageCreate PortableModePageLeave
|
||||
!define MUI_PAGE_CUSTOMFUNCTION_PRE componentsPagePre
|
||||
!insertmacro MUI_PAGE_COMPONENTS
|
||||
!insertmacro MUI_PAGE_DIRECTORY
|
||||
!insertmacro MUI_PAGE_INSTFILES
|
||||
@@ -32,15 +43,150 @@ InstallDir "$PROGRAMFILES\Cockatrice"
|
||||
!insertmacro MUI_UNPAGE_INSTFILES
|
||||
!insertmacro MUI_UNPAGE_FINISH
|
||||
|
||||
!insertmacro MUI_LANGUAGE "English"
|
||||
!insertmacro MUI_LANGUAGE English
|
||||
|
||||
Function .onInit
|
||||
StrCpy $NormalDestDir "${DEFAULTNORMALDESTINATON}"
|
||||
StrCpy $PortableDestDir "${DEFAULTPORTABLEDESTINATON}"
|
||||
|
||||
${GetParameters} $9
|
||||
|
||||
ClearErrors
|
||||
${GetOptions} $9 "/?" $8
|
||||
${IfNot} ${Errors}
|
||||
MessageBox MB_ICONINFORMATION|MB_SETFOREGROUND "\
|
||||
/PORTABLE : Install in portable mode$\n\
|
||||
/S : Silent install$\n\
|
||||
/D=%directory% : Specify destination directory$\n"
|
||||
Quit
|
||||
${EndIf}
|
||||
|
||||
ClearErrors
|
||||
${GetOptions} $9 "/PORTABLE" $8
|
||||
${IfNot} ${Errors}
|
||||
StrCpy $PortableMode 1
|
||||
StrCpy $0 $PortableDestDir
|
||||
${Else}
|
||||
StrCpy $PortableMode 0
|
||||
StrCpy $0 $NormalDestDir
|
||||
${If} ${Silent}
|
||||
Call RequireAdmin
|
||||
${EndIf}
|
||||
${EndIf}
|
||||
|
||||
${If} $InstDir == ""
|
||||
; User did not use /D to specify a directory,
|
||||
; we need to set a default based on the install mode
|
||||
StrCpy $InstDir $0
|
||||
${EndIf}
|
||||
Call SetModeDestinationFromInstdir
|
||||
|
||||
FunctionEnd
|
||||
|
||||
|
||||
Function RequireAdmin
|
||||
UserInfo::GetAccountType
|
||||
Pop $8
|
||||
${If} $8 != "admin"
|
||||
MessageBox MB_ICONSTOP "You need administrator rights to install Cockatrice"
|
||||
SetErrorLevel 740 ;ERROR_ELEVATION_REQUIRED
|
||||
Abort
|
||||
${EndIf}
|
||||
FunctionEnd
|
||||
|
||||
|
||||
Function SetModeDestinationFromInstdir
|
||||
${If} $PortableMode = 0
|
||||
StrCpy $NormalDestDir $InstDir
|
||||
${Else}
|
||||
StrCpy $PortableDestDir $InstDir
|
||||
${EndIf}
|
||||
FunctionEnd
|
||||
|
||||
|
||||
Function PortableModePageCreate
|
||||
Call SetModeDestinationFromInstdir ; If the user clicks BACK on the directory page we will remember their mode specific directory
|
||||
!insertmacro MUI_HEADER_TEXT "Install Mode" "Choose how you want to install Cockatrice."
|
||||
nsDialogs::Create 1018
|
||||
Pop $0
|
||||
${NSD_CreateLabel} 0 10u 100% 24u "Select install mode:"
|
||||
Pop $0
|
||||
${NSD_CreateRadioButton} 30u 50u -30u 8u "Normal installation"
|
||||
Pop $1
|
||||
${NSD_CreateRadioButton} 30u 70u -30u 8u "Portable mode (all files in a single folder)"
|
||||
Pop $2
|
||||
${If} $PortableMode = 0
|
||||
SendMessage $1 ${BM_SETCHECK} ${BST_CHECKED} 0
|
||||
${Else}
|
||||
SendMessage $2 ${BM_SETCHECK} ${BST_CHECKED} 0
|
||||
${EndIf}
|
||||
nsDialogs::Show
|
||||
FunctionEnd
|
||||
|
||||
Function PortableModePageLeave
|
||||
${NSD_GetState} $1 $0
|
||||
${If} $0 <> ${BST_UNCHECKED}
|
||||
StrCpy $PortableMode 0
|
||||
StrCpy $InstDir $NormalDestDir
|
||||
Call RequireAdmin
|
||||
${Else}
|
||||
StrCpy $PortableMode 1
|
||||
StrCpy $InstDir $PortableDestDir
|
||||
${EndIf}
|
||||
FunctionEnd
|
||||
|
||||
Function componentsPagePre
|
||||
${If} $PortableMode = 0
|
||||
SetShellVarContext all
|
||||
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "UninstallString"
|
||||
StrCmp $R0 "" done
|
||||
|
||||
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "A previous version of Cockatrice must be uninstalled before installing the new one." IDOK uninst
|
||||
Abort
|
||||
|
||||
uninst:
|
||||
ClearErrors
|
||||
ExecWait "$R0"
|
||||
|
||||
done:
|
||||
${Else}
|
||||
Abort
|
||||
${EndIf}
|
||||
FunctionEnd
|
||||
|
||||
Section "Application" SecApplication
|
||||
SetShellVarContext all
|
||||
SetOutPath "$INSTDIR"
|
||||
|
||||
@CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS@
|
||||
@CPACK_NSIS_FULL_INSTALL@
|
||||
SetShellVarContext all
|
||||
SetOutPath "$INSTDIR"
|
||||
|
||||
${If} $PortableMode = 1
|
||||
${AndIf} ${FileExists} "$INSTDIR\portable.dat"
|
||||
; upgrade portable mode
|
||||
RMDir /r "$INSTDIR\plugins"
|
||||
RMDir /r "$INSTDIR\sounds"
|
||||
RMDir /r "$INSTDIR\themes"
|
||||
RMDir /r "$INSTDIR\translations"
|
||||
Delete "$INSTDIR\uninstall.exe"
|
||||
Delete "$INSTDIR\cockatrice.exe"
|
||||
Delete "$INSTDIR\oracle.exe"
|
||||
Delete "$INSTDIR\servatrice.exe"
|
||||
Delete "$INSTDIR\Qt*.dll"
|
||||
Delete "$INSTDIR\libmysql.dll"
|
||||
Delete "$INSTDIR\icu*.dll"
|
||||
Delete "$INSTDIR\libeay32.dll"
|
||||
Delete "$INSTDIR\ssleay32.dll"
|
||||
Delete "$INSTDIR\qt.conf"
|
||||
Delete "$INSTDIR\qdebug.txt"
|
||||
Delete "$INSTDIR\servatrice.sql"
|
||||
Delete "$INSTDIR\servatrice.ini.example"
|
||||
Delete "$INSTDIR\zlib*.dll"
|
||||
RMDir "$INSTDIR"
|
||||
${EndIf}
|
||||
|
||||
@CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS@
|
||||
@CPACK_NSIS_FULL_INSTALL@
|
||||
|
||||
${If} $PortableMode = 0
|
||||
WriteUninstaller "$INSTDIR\uninstall.exe"
|
||||
${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
|
||||
IntFmt $0 "0x%08X" $0
|
||||
@@ -50,48 +196,47 @@ Section "Application" SecApplication
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "InstallLocation" "$INSTDIR"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "DisplayIcon" "$INSTDIR\cockatrice.exe"
|
||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "EstimatedSize" "$0"
|
||||
SectionEnd
|
||||
|
||||
Section "Update configuration" SecUpdateConfig
|
||||
SetShellVarContext current
|
||||
WriteRegStr HKCU "Software\Cockatrice\Cockatrice\paths" "carddatabase" "$LOCALAPPDATA\Cockatrice\cards.xml"
|
||||
WriteRegStr HKCU "Software\Cockatrice\Cockatrice\paths" "tokendatabase" "$LOCALAPPDATA\Cockatrice\tokens.xml"
|
||||
WriteRegStr HKCU "Software\Cockatrice\Cockatrice\paths" "decks" "$LOCALAPPDATA\Cockatrice\decks"
|
||||
WriteRegStr HKCU "Software\Cockatrice\Cockatrice\paths" "pics" "$LOCALAPPDATA\Cockatrice\pics"
|
||||
WriteRegStr HKCU "Software\Cockatrice\Cockatrice\replays" "pics" "$LOCALAPPDATA\Cockatrice\replays"
|
||||
WriteRegStr HKCU "Software\Cockatrice\Cockatrice\sound" "path" "$INSTDIR\sounds"
|
||||
IfFileExists "$INSTDIR\vc_redist.x86.exe" VcRedist86Exists PastVcRedist86Check
|
||||
VcRedist86Exists:
|
||||
ExecWait '"$INSTDIR\vc_redist.x86.exe" /passive /norestart'
|
||||
PastVcRedist86Check:
|
||||
|
||||
IfFileExists "$INSTDIR\vc_redist.x64.exe" VcRedist64Exists PastVcRedist64Check
|
||||
VcRedist64Exists:
|
||||
ExecWait '"$INSTDIR\vc_redist.x64.exe" /passive /norestart'
|
||||
PastVcRedist64Check:
|
||||
|
||||
${Else}
|
||||
; Create the file the application uses to detect portable mode
|
||||
FileOpen $0 "$INSTDIR\portable.dat" w
|
||||
FileWrite $0 "PORTABLE"
|
||||
FileClose $0
|
||||
${EndIf}
|
||||
SectionEnd
|
||||
|
||||
Section "Start menu item" SecStartMenu
|
||||
${If} $PortableMode = 0
|
||||
SetShellVarContext all
|
||||
createDirectory "$SMPROGRAMS\Cockatrice"
|
||||
createShortCut "$SMPROGRAMS\Cockatrice\Cockatrice.lnk" "$INSTDIR\cockatrice.exe"
|
||||
createShortCut "$SMPROGRAMS\Cockatrice\Oracle.lnk" "$INSTDIR\oracle.exe"
|
||||
createShortCut "$SMPROGRAMS\Cockatrice\Servatrice.lnk" "$INSTDIR\servatrice.exe"
|
||||
createShortCut "$SMPROGRAMS\Cockatrice\Usermanual.lnk" "$INSTDIR\Usermanual.pdf"
|
||||
${EndIf}
|
||||
SectionEnd
|
||||
|
||||
Section "un.Application" UnSecApplication
|
||||
SetShellVarContext all
|
||||
RMDir /r "$INSTDIR\zonebg"
|
||||
RMDir /r "$INSTDIR\plugins"
|
||||
RMDir /r "$INSTDIR\sounds"
|
||||
RMDir /r "$INSTDIR\themes"
|
||||
RMDir /r "$INSTDIR\translations"
|
||||
Delete "$INSTDIR\uninstall.exe"
|
||||
Delete "$INSTDIR\cockatrice.exe"
|
||||
Delete "$INSTDIR\oracle.exe"
|
||||
Delete "$INSTDIR\servatrice.exe"
|
||||
Delete "$INSTDIR\Usermanual.pdf"
|
||||
Delete "$INSTDIR\libprotobuf.lib"
|
||||
Delete "$INSTDIR\Qt*.dll"
|
||||
Delete "$INSTDIR\icu*.dll"
|
||||
Delete "$INSTDIR\libeay32.dll"
|
||||
Delete "$INSTDIR\ssleay32.dll"
|
||||
Delete "$INSTDIR\*.exe"
|
||||
Delete "$INSTDIR\*.dll"
|
||||
Delete "$INSTDIR\qt.conf"
|
||||
Delete "$INSTDIR\qdebug.txt"
|
||||
Delete "$INSTDIR\servatrice.sql"
|
||||
Delete "$INSTDIR\servatrice.ini.example"
|
||||
Delete "$INSTDIR\zlib1.dll"
|
||||
RMDir "$INSTDIR"
|
||||
|
||||
RMDir "$SMPROGRAMS\Cockatrice"
|
||||
@@ -108,11 +253,9 @@ Section /o "un.Configurations, decks, cards, pics" UnSecConfiguration
|
||||
SectionEnd
|
||||
|
||||
LangString DESC_SecApplication ${LANG_ENGLISH} "Cockatrice program files"
|
||||
LangString DESC_SecUpdateConfig ${LANG_ENGLISH} "Update the paths in the application settings according to the installation paths."
|
||||
LangString DESC_SecStartMenu ${LANG_ENGLISH} "Create start menu items for Cockatrice and Oracle."
|
||||
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SecApplication} $(DESC_SecApplication)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SecUpdateConfig} $(DESC_SecUpdateConfig)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SecStartMenu} $(DESC_SecStartMenu)
|
||||
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
||||
|
||||
@@ -121,21 +264,4 @@ LangString DESC_UnSecConfiguration ${LANG_ENGLISH} "Configurations, decks, card
|
||||
!insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${UnSecApplication} $(DESC_UnSecApplication)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${UnSecConfiguration} $(DESC_UnSecConfiguration)
|
||||
!insertmacro MUI_UNFUNCTION_DESCRIPTION_END
|
||||
|
||||
|
||||
Function .onInit
|
||||
SetShellVarContext all
|
||||
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "UninstallString"
|
||||
StrCmp $R0 "" done
|
||||
|
||||
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "A previous version of Cockatrice must be uninstalled before installing the new one." IDOK uninst
|
||||
Abort
|
||||
|
||||
uninst:
|
||||
ClearErrors
|
||||
ExecWait "$R0"
|
||||
|
||||
done:
|
||||
|
||||
FunctionEnd
|
||||
!insertmacro MUI_UNFUNCTION_DESCRIPTION_END
|
||||
@@ -1,28 +0,0 @@
|
||||
{
|
||||
"package": {
|
||||
"name": "Cockatrice-git",
|
||||
"repo": "Cockatrice",
|
||||
"subject": "cockatrice",
|
||||
"desc": "Cockatrice master branch automated builds",
|
||||
"website_url": "https://github.com/Cockatrice/Cockatrice",
|
||||
"issue_tracker_url": "https://github.com/Cockatrice/Cockatrice/issues",
|
||||
"vcs_url": "https://github.com/Cockatrice/Cockatrice.git",
|
||||
"github_use_tag_release_notes": true,
|
||||
"github_release_notes_file": "RELEASE.txt",
|
||||
"licenses": ["GPL-2.0"],
|
||||
"labels": ["card", "tabletop", "game"],
|
||||
"public_download_numbers": false,
|
||||
"public_stats": true
|
||||
},
|
||||
"version": {
|
||||
"name": "@PROJECT_VERSION@",
|
||||
"desc": "Unstable builds from master",
|
||||
"vcs_tag": "@GIT_COMMIT_ID@",
|
||||
"gpgSign": false
|
||||
},
|
||||
"files": [
|
||||
{ "includePattern": "build/(Cockatrice.*\\.deb)", "uploadPattern": "Ubuntu/$ENV{DIST}/$1" },
|
||||
{ "includePattern": "build/(Cockatrice.*\\.dmg)", "uploadPattern": "MacOSX/$1" }
|
||||
],
|
||||
"publish": true
|
||||
}
|
||||
@@ -3,8 +3,10 @@ set(VERSION_STRING_H "${PROJECT_BINARY_DIR}/version_string.h")
|
||||
INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR})
|
||||
|
||||
set( hstring "extern const char *VERSION_STRING\;
|
||||
extern const char *VERSION_COMMIT\;
|
||||
extern const char *VERSION_DATE\;\n" )
|
||||
set( cppstring "const char *VERSION_STRING = \"${PROJECT_VERSION_FRIENDLY}\"\;
|
||||
const char *VERSION_COMMIT = \"${GIT_COMMIT_ID}\"\;
|
||||
const char *VERSION_DATE = \"${GIT_COMMIT_DATE_FRIENDLY}\"\;\n")
|
||||
|
||||
file(WRITE ${PROJECT_BINARY_DIR}/version_string.cpp.txt ${cppstring} )
|
||||
|
||||
@@ -1,40 +1,223 @@
|
||||
find_package(Git)
|
||||
if(GIT_FOUND)
|
||||
# HELPER FUNCTIONS
|
||||
|
||||
function(get_commit_id)
|
||||
# get last commit hash
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} log -1 --date=short "--pretty=%h"
|
||||
COMMAND ${GIT_EXECUTABLE} log -1 --abbrev=7 --date=short "--pretty=%h"
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
RESULT_VARIABLE res_var
|
||||
OUTPUT_VARIABLE GIT_COM_ID
|
||||
)
|
||||
if( NOT ${res_var} EQUAL 0 )
|
||||
set( GIT_COMMIT_ID "unknown")
|
||||
message( WARNING "Git failed (not a repo, or no tags). Build will not contain git revision info." )
|
||||
if(NOT ${res_var} EQUAL 0)
|
||||
message(WARNING "Git failed (not a repo, or no tags). Build will not contain git revision info.")
|
||||
return()
|
||||
endif()
|
||||
string( REPLACE "\n" "" GIT_COMMIT_ID "${GIT_COM_ID}" )
|
||||
|
||||
string(REPLACE "\n" "" GIT_COM_ID "${GIT_COM_ID}")
|
||||
set(GIT_COMMIT_ID "${GIT_COM_ID}" PARENT_SCOPE)
|
||||
set(PROJECT_VERSION_LABEL "custom(${GIT_COM_ID})" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(get_commit_date)
|
||||
# get last commit date
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} log -1 --date=short "--pretty=%cd"
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
RESULT_VARIABLE res_var
|
||||
OUTPUT_VARIABLE GIT_COM_DATE
|
||||
)
|
||||
if( NOT ${res_var} EQUAL 0 )
|
||||
set( GIT_COMMIT_DATE "unknown")
|
||||
set( GIT_COMMIT_DATE_FRIENDLY "unknown")
|
||||
message( WARNING "Git failed (not a repo, or no tags). Build will not contain git revision info." )
|
||||
if(NOT ${res_var} EQUAL 0)
|
||||
message(WARNING "Git failed (not a repo, or no tags). Build will not contain git revision info.")
|
||||
return()
|
||||
endif()
|
||||
string( REPLACE "\n" "" GIT_COMMIT_DATE_FRIENDLY "${GIT_COM_DATE}" )
|
||||
string( REPLACE "-" "" GIT_COMMIT_DATE "${GIT_COMMIT_DATE_FRIENDLY}" )
|
||||
|
||||
string(REPLACE "\n" "" GIT_COM_DATE "${GIT_COM_DATE}")
|
||||
set(GIT_COMMIT_DATE_FRIENDLY "${GIT_COM_DATE}" PARENT_SCOPE)
|
||||
|
||||
string(REPLACE "-" "" GIT_COM_DATE "${GIT_COM_DATE}")
|
||||
set(GIT_COMMIT_DATE "${GIT_COM_DATE}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(clean_release_name name)
|
||||
# "name": "Cockatrice: Thopter Pie Network, Revision 2"
|
||||
|
||||
# Remove all double quotes
|
||||
STRING(REPLACE "\"" "" name "${name}")
|
||||
# Remove json prefix "name: "
|
||||
STRING(REPLACE " name: " "" name "${name}")
|
||||
# Remove "cockatrice" name
|
||||
STRING(REPLACE "Cockatrice" "" name "${name}")
|
||||
# Remove all unwanted chars
|
||||
STRING(REGEX REPLACE "[^A-Za-z0-9_ ]" "" name "${name}")
|
||||
# Strip (trim) whitespaces
|
||||
STRING(STRIP "${name}" name)
|
||||
# Replace all spaces with underscores
|
||||
STRING(REPLACE " " "_" name "${name}")
|
||||
|
||||
set(GIT_TAG_RELEASENAME "${name}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(get_tag_name commit)
|
||||
if(${commit} STREQUAL "unknown")
|
||||
return()
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} describe --exact-match --tags ${commit}
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
RESULT_VARIABLE res_var
|
||||
OUTPUT_VARIABLE GIT_TAG
|
||||
ERROR_VARIABLE GIT_TAG_ERR
|
||||
)
|
||||
|
||||
if((NOT ${res_var} EQUAL 0) OR (${GIT_TAG_ERR} MATCHES "fatal: no tag exactly matches.*"))
|
||||
message(STATUS "Commit is not a release or prerelease (no git tag found)")
|
||||
return()
|
||||
endif()
|
||||
|
||||
string(REPLACE "\n" "" GIT_TAG "${GIT_TAG}")
|
||||
message(STATUS "Commit is a release or prerelease, git tag: ${GIT_TAG}")
|
||||
|
||||
# Extract information from tag:
|
||||
# YYYY-MM-DD-Release-MAJ.MIN.PATCH
|
||||
# YYYY-MM-DD-Development-MAJ.MIN.PATCH-beta.X
|
||||
string(REPLACE "-" ";" GIT_TAG_EXPLODED "${GIT_TAG}")
|
||||
string(REPLACE "." ";" GIT_TAG_EXPLODED "${GIT_TAG_EXPLODED}")
|
||||
|
||||
# Sanity checks: length
|
||||
list(LENGTH GIT_TAG_EXPLODED GIT_TAG_LISTCOUNT)
|
||||
if(${GIT_TAG_LISTCOUNT} LESS 7 OR ${GIT_TAG_LISTCOUNT} GREATER 9)
|
||||
message(WARNING "Invalid tag format, got ${GIT_TAG_LISTCOUNT} tokens")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Year
|
||||
list(GET GIT_TAG_EXPLODED 0 GIT_TAG_YEAR)
|
||||
if(${GIT_TAG_YEAR} LESS 2017 OR ${GIT_TAG_LISTCOUNT} GREATER 2100)
|
||||
message(WARNING "Invalid tag year ${GIT_TAG_YEAR}")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Month
|
||||
list(GET GIT_TAG_EXPLODED 1 GIT_TAG_MONTH)
|
||||
if(${GIT_TAG_MONTH} LESS 1 OR ${GIT_TAG_MONTH} GREATER 12)
|
||||
message(WARNING "Invalid tag month ${GIT_TAG_MONTH}")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Day
|
||||
list(GET GIT_TAG_EXPLODED 2 GIT_TAG_DAY)
|
||||
if(${GIT_TAG_DAY} LESS 1 OR ${GIT_TAG_DAY} GREATER 31)
|
||||
message(WARNING "Invalid tag day ${GIT_TAG_DAY}")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Type
|
||||
list(GET GIT_TAG_EXPLODED 3 GIT_TAG_TYPE)
|
||||
if(NOT(${GIT_TAG_TYPE} STREQUAL "Release" OR ${GIT_TAG_TYPE} STREQUAL "Development"))
|
||||
message(WARNING "Invalid tag type ${GIT_TAG_TYPE}")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Major
|
||||
list(GET GIT_TAG_EXPLODED 4 GIT_TAG_MAJOR)
|
||||
if(${GIT_TAG_MAJOR} LESS 0 OR ${GIT_TAG_MAJOR} GREATER 99)
|
||||
message(WARNING "Invalid tag major version ${GIT_TAG_MAJOR}")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Minor
|
||||
list(GET GIT_TAG_EXPLODED 5 GIT_TAG_MINOR)
|
||||
if(${GIT_TAG_MINOR} LESS 0 OR ${GIT_TAG_MINOR} GREATER 99)
|
||||
message(WARNING "Invalid tag minor version ${GIT_TAG_MINOR}")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Patch
|
||||
list(GET GIT_TAG_EXPLODED 6 GIT_TAG_PATCH)
|
||||
if(${GIT_TAG_PATCH} LESS 0 OR ${GIT_TAG_PATCH} GREATER 99)
|
||||
message(WARNING "Invalid tag patch version ${GIT_TAG_PATCH}")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Label
|
||||
# 7 = Stable release
|
||||
# 8 = Dev release, first beta so only "beta" attached
|
||||
# 9 = Dev release, subsequent beta so "beta.N" attached (N>=2)
|
||||
if(${GIT_TAG_LISTCOUNT} EQUAL 8)
|
||||
list(GET GIT_TAG_EXPLODED 7 GIT_TAG_LABEL)
|
||||
elseif(${GIT_TAG_LISTCOUNT} EQUAL 9)
|
||||
list(GET GIT_TAG_EXPLODED 7 GIT_TAG_LABEL)
|
||||
list(GET GIT_TAG_EXPLODED 8 GIT_TAG_LABEL_NUM)
|
||||
set(GIT_TAG_LABEL ${GIT_TAG_LABEL} ${GIT_TAG_LABEL_NUM})
|
||||
string(REPLACE ";" "." GIT_TAG_LABEL "${GIT_TAG_LABEL}")
|
||||
else()
|
||||
SET(GIT_TAG_LABEL "")
|
||||
endif()
|
||||
|
||||
# Override hardcoded version with the informations from the tag
|
||||
set(PROJECT_VERSION_MAJOR ${GIT_TAG_MAJOR} PARENT_SCOPE)
|
||||
set(PROJECT_VERSION_MINOR ${GIT_TAG_MINOR} PARENT_SCOPE)
|
||||
set(PROJECT_VERSION_PATCH ${GIT_TAG_PATCH} PARENT_SCOPE)
|
||||
set(PROJECT_VERSION_LABEL ${GIT_TAG_LABEL} PARENT_SCOPE)
|
||||
|
||||
if(${GIT_TAG_TYPE} STREQUAL "Development")
|
||||
set(PROJECT_VERSION_LABEL ${GIT_TAG_LABEL} PARENT_SCOPE)
|
||||
elseif(${GIT_TAG_TYPE} STREQUAL "Release")
|
||||
set(PROJECT_VERSION_LABEL "" PARENT_SCOPE)
|
||||
|
||||
# get version name from github
|
||||
set(GIT_TAG_TEMP_FILE "${PROJECT_BINARY_DIR}/tag_informations.txt")
|
||||
set(GIT_TAG_TEMP_URL "https://api.github.com/repos/Cockatrice/Cockatrice/releases/tags/${GIT_TAG}")
|
||||
message(STATUS "Fetching tag informations from ${GIT_TAG_TEMP_URL}")
|
||||
file(REMOVE "${GIT_TAG_TEMP_FILE}")
|
||||
file(DOWNLOAD "${GIT_TAG_TEMP_URL}" "${GIT_TAG_TEMP_FILE}" STATUS status LOG log INACTIVITY_TIMEOUT 30 TIMEOUT 300 SHOW_PROGRESS)
|
||||
list(GET status 0 err)
|
||||
list(GET status 1 msg)
|
||||
if(err)
|
||||
message(WARNING "Download failed with error ${msg}: ${log}")
|
||||
return()
|
||||
endif()
|
||||
file(STRINGS "${GIT_TAG_TEMP_FILE}" GIT_TAG_RAW_RELEASENAME REGEX "\"name\": \"" LIMIT_COUNT 1)
|
||||
|
||||
clean_release_name("${GIT_TAG_RAW_RELEASENAME}")
|
||||
set(PROJECT_VERSION_RELEASENAME "${GIT_TAG_RELEASENAME}" PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
endfunction()
|
||||
|
||||
# START OF MAIN
|
||||
|
||||
# fallback defaults
|
||||
set(GIT_COMMIT_ID "unknown")
|
||||
set(GIT_COMMIT_DATE "unknown")
|
||||
set(GIT_COMMIT_DATE_FRIENDLY "unknown")
|
||||
set(PROJECT_VERSION_LABEL "custom(unknown)")
|
||||
set(PROJECT_VERSION_RELEASENAME "")
|
||||
|
||||
find_package(Git)
|
||||
if(GIT_FOUND)
|
||||
get_commit_id()
|
||||
get_commit_date()
|
||||
get_tag_name(${GIT_COMMIT_ID})
|
||||
else()
|
||||
set( GIT_COMMIT_ID "unknown")
|
||||
set( GIT_COMMIT_DATE "unknown")
|
||||
set( GIT_COMMIT_DATE_FRIENDLY "unknown")
|
||||
message( WARNING "Git not found. Build will not contain git revision info." )
|
||||
endif()
|
||||
|
||||
set(PROJECT_VERSION_MAJOR "0")
|
||||
set(PROJECT_VERSION_MINOR "0")
|
||||
set(PROJECT_VERSION_PATCH "1~git${GIT_COMMIT_DATE}.${GIT_COMMIT_ID}")
|
||||
set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
|
||||
set(PROJECT_VERSION_FRIENDLY "${GIT_COMMIT_ID} (${GIT_COMMIT_DATE_FRIENDLY})")
|
||||
if(PROJECT_VERSION_LABEL)
|
||||
set(PROJECT_VERSION "${PROJECT_VERSION}-${PROJECT_VERSION_LABEL}")
|
||||
endif()
|
||||
|
||||
set(PROJECT_VERSION_FRIENDLY "${PROJECT_VERSION} (${GIT_COMMIT_DATE_FRIENDLY})")
|
||||
|
||||
# Format: <program name>[-ReleaseName]-MAJ.MIN.PATCH[-prerelease_label]
|
||||
set(PROJECT_VERSION_FILENAME "${PROJECT_NAME}")
|
||||
if(PROJECT_VERSION_RELEASENAME)
|
||||
set(PROJECT_VERSION_FILENAME "${PROJECT_VERSION_FILENAME}-${PROJECT_VERSION_RELEASENAME}")
|
||||
endif()
|
||||
set(PROJECT_VERSION_FILENAME "${PROJECT_VERSION_FILENAME}-${PROJECT_VERSION}")
|
||||
|
||||
message(STATUS "Project version: ${PROJECT_VERSION}")
|
||||
message(STATUS "Friendly project version: ${PROJECT_VERSION_FRIENDLY}")
|
||||
message(STATUS "Project version filename: ${PROJECT_VERSION_FILENAME}")
|
||||
|
||||
@@ -4,8 +4,8 @@ project(gtest-download LANGUAGES NONE)
|
||||
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(googletest
|
||||
URL https://googletest.googlecode.com/files/gtest-1.7.0.zip
|
||||
URL_HASH SHA1=f85f6d2481e2c6c4a18539e391aa4ea8ab0394af
|
||||
URL https://github.com/google/googletest/archive/release-1.7.0.zip
|
||||
URL_HASH SHA1=f89bc9f55477df2fde082481e2d709bfafdb057b
|
||||
SOURCE_DIR "${CMAKE_BINARY_DIR}/gtest-src"
|
||||
BINARY_DIR "${CMAKE_BINARY_DIR}/gtest-build"
|
||||
CONFIGURE_COMMAND ""
|
||||
|
||||
3
cmake/launch-c.in
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
export CCACHE_CPP2=true
|
||||
exec "${RULE_LAUNCH_COMPILE}" "${CMAKE_C_COMPILER}" "$@"
|
||||
3
cmake/launch-cxx.in
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
export CCACHE_CPP2=true
|
||||
exec "${RULE_LAUNCH_COMPILE}" "${CMAKE_CXX_COMPILER}" "$@"
|
||||
@@ -2,45 +2,51 @@
|
||||
#
|
||||
# provides the cockatrice binary
|
||||
|
||||
PROJECT(cockatrice)
|
||||
PROJECT(Cockatrice)
|
||||
|
||||
SET(cockatrice_SOURCES
|
||||
src/abstractcounter.cpp
|
||||
src/abstractcounter.cpp
|
||||
src/counter_general.cpp
|
||||
src/dlg_creategame.cpp
|
||||
src/dlg_filter_games.cpp
|
||||
src/dlg_connect.cpp
|
||||
src/dlg_create_token.cpp
|
||||
src/dlg_connect.cpp
|
||||
src/dlg_create_token.cpp
|
||||
src/dlg_edit_avatar.cpp
|
||||
src/dlg_edit_password.cpp
|
||||
src/dlg_edit_tokens.cpp
|
||||
src/dlg_edit_user.cpp
|
||||
src/dlg_register.cpp
|
||||
src/dlg_forgotpasswordrequest.cpp
|
||||
src/dlg_forgotpasswordreset.cpp
|
||||
src/dlg_forgotpasswordchallenge.cpp
|
||||
src/dlg_register.cpp
|
||||
src/dlg_tip_of_the_day.cpp
|
||||
src/tip_of_the_day.cpp
|
||||
src/dlg_update.cpp
|
||||
src/dlg_viewlog.cpp
|
||||
src/abstractclient.cpp
|
||||
src/remoteclient.cpp
|
||||
src/main.cpp
|
||||
src/window_main.cpp
|
||||
src/gamesmodel.cpp
|
||||
src/player.cpp
|
||||
src/playertarget.cpp
|
||||
src/cardzone.cpp
|
||||
src/selectzone.cpp
|
||||
src/cardlist.cpp
|
||||
src/abstractcarditem.cpp
|
||||
src/carditem.cpp
|
||||
src/tablezone.cpp
|
||||
src/handzone.cpp
|
||||
src/handcounter.cpp
|
||||
src/carddatabase.cpp
|
||||
src/remoteclient.cpp
|
||||
src/main.cpp
|
||||
src/window_main.cpp
|
||||
src/gamesmodel.cpp
|
||||
src/player.cpp
|
||||
src/playertarget.cpp
|
||||
src/cardzone.cpp
|
||||
src/selectzone.cpp
|
||||
src/cardlist.cpp
|
||||
src/abstractcarditem.cpp
|
||||
src/carditem.cpp
|
||||
src/tablezone.cpp
|
||||
src/handzone.cpp
|
||||
src/handcounter.cpp
|
||||
src/carddatabase.cpp
|
||||
src/keysignals.cpp
|
||||
src/gameview.cpp
|
||||
src/gameselector.cpp
|
||||
src/decklistmodel.cpp
|
||||
src/deck_loader.cpp
|
||||
src/dlg_load_deck_from_clipboard.cpp
|
||||
src/dlg_load_remote_deck.cpp
|
||||
src/cardinfowidget.cpp
|
||||
src/gameview.cpp
|
||||
src/gameselector.cpp
|
||||
src/decklistmodel.cpp
|
||||
src/deck_loader.cpp
|
||||
src/dlg_load_deck_from_clipboard.cpp
|
||||
src/dlg_load_remote_deck.cpp
|
||||
src/cardinfowidget.cpp
|
||||
src/cardframe.cpp
|
||||
src/cardinfopicture.cpp
|
||||
src/cardinfotext.cpp
|
||||
@@ -48,52 +54,52 @@ SET(cockatrice_SOURCES
|
||||
src/cardfilter.cpp
|
||||
src/filtertreemodel.cpp
|
||||
src/filtertree.cpp
|
||||
src/messagelogwidget.cpp
|
||||
src/zoneviewzone.cpp
|
||||
src/zoneviewwidget.cpp
|
||||
src/pilezone.cpp
|
||||
src/stackzone.cpp
|
||||
src/carddragitem.cpp
|
||||
src/carddatabasemodel.cpp
|
||||
src/setsmodel.cpp
|
||||
src/window_sets.cpp
|
||||
src/abstractgraphicsitem.cpp
|
||||
src/abstractcarddragitem.cpp
|
||||
src/dlg_settings.cpp
|
||||
src/dlg_cardsearch.cpp
|
||||
src/phasestoolbar.cpp
|
||||
src/gamescene.cpp
|
||||
src/arrowitem.cpp
|
||||
src/arrowtarget.cpp
|
||||
src/tab.cpp
|
||||
src/tab_server.cpp
|
||||
src/tab_room.cpp
|
||||
src/tab_message.cpp
|
||||
src/tab_game.cpp
|
||||
src/tab_deck_storage.cpp
|
||||
src/tab_replays.cpp
|
||||
src/tab_supervisor.cpp
|
||||
src/tab_admin.cpp
|
||||
src/tab_userlists.cpp
|
||||
src/messagelogwidget.cpp
|
||||
src/zoneviewzone.cpp
|
||||
src/zoneviewwidget.cpp
|
||||
src/pilezone.cpp
|
||||
src/stackzone.cpp
|
||||
src/carddragitem.cpp
|
||||
src/carddatabasemodel.cpp
|
||||
src/setsmodel.cpp
|
||||
src/window_sets.cpp
|
||||
src/abstractgraphicsitem.cpp
|
||||
src/abstractcarddragitem.cpp
|
||||
src/dlg_settings.cpp
|
||||
src/phasestoolbar.cpp
|
||||
src/gamescene.cpp
|
||||
src/arrowitem.cpp
|
||||
src/arrowtarget.cpp
|
||||
src/tab.cpp
|
||||
src/tab_server.cpp
|
||||
src/tab_room.cpp
|
||||
src/tab_message.cpp
|
||||
src/tab_game.cpp
|
||||
src/tab_deck_storage.cpp
|
||||
src/tab_replays.cpp
|
||||
src/tab_supervisor.cpp
|
||||
src/tab_admin.cpp
|
||||
src/tab_userlists.cpp
|
||||
src/tab_deck_editor.cpp
|
||||
src/tab_logs.cpp
|
||||
src/replay_timeline_widget.cpp
|
||||
src/deckstats_interface.cpp
|
||||
src/chatview.cpp
|
||||
src/userlist.cpp
|
||||
src/userinfobox.cpp
|
||||
src/tappedout_interface.cpp
|
||||
src/chatview/chatview.cpp
|
||||
src/chatview/userlistProxy.h
|
||||
src/userlist.cpp
|
||||
src/userinfobox.cpp
|
||||
src/user_context_menu.cpp
|
||||
src/remotedecklist_treewidget.cpp
|
||||
src/remotereplaylist_treewidget.cpp
|
||||
src/deckview.cpp
|
||||
src/playerlistwidget.cpp
|
||||
src/pixmapgenerator.cpp
|
||||
src/settingscache.cpp
|
||||
src/thememanager.cpp
|
||||
src/localserver.cpp
|
||||
src/localserverinterface.cpp
|
||||
src/localclient.cpp
|
||||
src/priceupdater.cpp
|
||||
src/remotedecklist_treewidget.cpp
|
||||
src/remotereplaylist_treewidget.cpp
|
||||
src/deckview.cpp
|
||||
src/playerlistwidget.cpp
|
||||
src/pixmapgenerator.cpp
|
||||
src/settingscache.cpp
|
||||
src/thememanager.cpp
|
||||
src/localserver.cpp
|
||||
src/localserverinterface.cpp
|
||||
src/localclient.cpp
|
||||
src/qt-json/json.cpp
|
||||
src/soundengine.cpp
|
||||
src/pending_command.cpp
|
||||
@@ -108,16 +114,24 @@ SET(cockatrice_SOURCES
|
||||
src/settings/messagesettings.cpp
|
||||
src/settings/gamefilterssettings.cpp
|
||||
src/settings/layoutssettings.cpp
|
||||
src/update_checker.cpp
|
||||
src/update_downloader.cpp
|
||||
src/logger.cpp
|
||||
src/releasechannel.cpp
|
||||
src/userconnection_information.cpp
|
||||
src/spoilerbackgroundupdater.cpp
|
||||
src/handle_public_servers.cpp
|
||||
src/carddbparser/cockatricexml3.cpp
|
||||
${VERSION_STRING_CPP}
|
||||
)
|
||||
|
||||
add_subdirectory(sounds)
|
||||
add_subdirectory(themes)
|
||||
|
||||
set(cockatrice_RESOURCES cockatrice.qrc)
|
||||
|
||||
IF(UPDATE_TRANSLATIONS)
|
||||
FILE(GLOB_RECURSE translate_cockatrice_SRCS ${CMAKE_SOURCE_DIR}/cockatrice/src/*.cpp ${CMAKE_SOURCE_DIR}/cockatrice/src/*.h)
|
||||
FILE(GLOB_RECURSE translate_common_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/common/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/common/*.h)
|
||||
FILE(GLOB_RECURSE translate_common_SRCS ${CMAKE_SOURCE_DIR}/common/*.cpp ${CMAKE_SOURCE_DIR}/common/*.h)
|
||||
SET(translate_SRCS ${translate_cockatrice_SRCS} ${translate_common_SRCS})
|
||||
SET(cockatrice_TS "${CMAKE_CURRENT_SOURCE_DIR}/translations/cockatrice_en.ts")
|
||||
ELSE()
|
||||
@@ -134,94 +148,33 @@ if(APPLE)
|
||||
set(cockatrice_SOURCES ${cockatrice_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/resources/appicon.icns)
|
||||
ENDIF(APPLE)
|
||||
|
||||
set(COCKATRICE_LIBS)
|
||||
# Qt5
|
||||
find_package(Qt5 COMPONENTS Concurrent Multimedia Network PrintSupport Svg Widgets REQUIRED)
|
||||
include_directories(${Qt5Concurrent_INCLUDE_DIRS} ${Qt5Multimedia_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} ${Qt5PrintSupport_INCLUDE_DIRS} ${Qt5Svg_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS})
|
||||
set(COCKATRICE_QT_MODULES Concurrent Multimedia Network PrintSupport Svg Widgets)
|
||||
|
||||
# Qt4 stuff
|
||||
if(Qt4_FOUND)
|
||||
if (NOT QT_QTMULTIMEDIA_FOUND)
|
||||
FIND_PACKAGE(QtMobility REQUIRED)
|
||||
# Qt5LinguistTools
|
||||
find_package(Qt5LinguistTools)
|
||||
if(Qt5LinguistTools_FOUND)
|
||||
include_directories(${Qt5LinguistTools_INCLUDE_DIRS})
|
||||
list(APPEND COCKATRICE_LIBS LinguistTools)
|
||||
|
||||
if(NOT Qt5_LRELEASE_EXECUTABLE)
|
||||
MESSAGE(WARNING "Qt's lrelease not found.")
|
||||
endif()
|
||||
|
||||
SET(QT_USE_QTNETWORK TRUE)
|
||||
SET(QT_USE_QTMULTIMEDIA TRUE)
|
||||
SET(QT_USE_QTSVG TRUE)
|
||||
|
||||
# Include directories
|
||||
INCLUDE(${QT_USE_FILE})
|
||||
INCLUDE_DIRECTORIES(${QT_INCLUDES})
|
||||
INCLUDE_DIRECTORIES(${QT_MOBILITY_INCLUDE_DIR})
|
||||
INCLUDE_DIRECTORIES(${QT_MOBILITY_MULTIMEDIAKIT_INCLUDE_DIR})
|
||||
LIST(APPEND COCKATRICE_LIBS ${QT_LIBRARIES})
|
||||
LIST(APPEND COCKATRICE_LIBS ${QT_QTMAIN_LIBRARY})
|
||||
LIST(APPEND COCKATRICE_LIBS ${QT_MOBILITY_MULTIMEDIAKIT_LIBRARY})
|
||||
|
||||
# Let cmake chew Qt4's translations and resource files
|
||||
# Note: header files are MOC-ed automatically by cmake
|
||||
IF(UPDATE_TRANSLATIONS)
|
||||
QT4_CREATE_TRANSLATION(cockatrice_QM ${translate_SRCS} ${cockatrice_TS})
|
||||
ELSE(UPDATE_TRANSLATIONS)
|
||||
QT4_ADD_TRANSLATION(cockatrice_QM ${cockatrice_TS})
|
||||
ENDIF(UPDATE_TRANSLATIONS)
|
||||
|
||||
QT4_ADD_RESOURCES(cockatrice_RESOURCES_RCC ${cockatrice_RESOURCES})
|
||||
endif()
|
||||
|
||||
# qt5 stuff
|
||||
if(Qt5Widgets_FOUND)
|
||||
include_directories(${Qt5Widgets_INCLUDE_DIRS})
|
||||
list(APPEND COCKATRICE_LIBS Widgets)
|
||||
|
||||
# QtNetwork
|
||||
find_package(Qt5Network)
|
||||
if(Qt5Network_FOUND)
|
||||
include_directories(${Qt5Network_INCLUDE_DIRS})
|
||||
list(APPEND COCKATRICE_LIBS Network)
|
||||
endif()
|
||||
|
||||
# QtMultimedia
|
||||
find_package(Qt5Multimedia)
|
||||
if(Qt5Multimedia_FOUND)
|
||||
include_directories(${Qt5Multimedia_INCLUDE_DIRS})
|
||||
list(APPEND COCKATRICE_LIBS Multimedia)
|
||||
endif()
|
||||
|
||||
# QtPrinter
|
||||
find_package(Qt5PrintSupport)
|
||||
if(Qt5PrintSupport_FOUND)
|
||||
include_directories(${Qt5PrintSupport_INCLUDE_DIRS})
|
||||
list(APPEND COCKATRICE_LIBS PrintSupport)
|
||||
endif()
|
||||
|
||||
# QtSvg
|
||||
find_package(Qt5Svg)
|
||||
if(Qt5Svg_FOUND)
|
||||
include_directories(${Qt5Svg_INCLUDE_DIRS})
|
||||
list(APPEND COCKATRICE_LIBS Svg)
|
||||
endif()
|
||||
|
||||
# Qt5LinguistTools
|
||||
find_package(Qt5LinguistTools)
|
||||
if(Qt5LinguistTools_FOUND)
|
||||
include_directories(${Qt5LinguistTools_INCLUDE_DIRS})
|
||||
list(APPEND COCKATRICE_LIBS LinguistTools)
|
||||
endif()
|
||||
|
||||
# Let cmake chew Qt5's translations and resource files
|
||||
# Note: header files are MOC-ed automatically by cmake
|
||||
IF(UPDATE_TRANSLATIONS)
|
||||
if(UPDATE_TRANSLATIONS)
|
||||
if(NOT Qt5_LUPDATE_EXECUTABLE)
|
||||
MESSAGE(WARNING "Qt's lupdate not found.")
|
||||
endif()
|
||||
QT5_CREATE_TRANSLATION(cockatrice_QM ${translate_SRCS} ${cockatrice_TS})
|
||||
ELSE()
|
||||
else()
|
||||
QT5_ADD_TRANSLATION(cockatrice_QM ${cockatrice_TS})
|
||||
ENDIF()
|
||||
|
||||
QT5_ADD_RESOURCES(cockatrice_RESOURCES_RCC ${cockatrice_RESOURCES})
|
||||
|
||||
# guess plugins and libraries directory
|
||||
set(QT_PLUGINS_DIR "${Qt5Widgets_DIR}/../../../plugins")
|
||||
get_target_property(QT_LIBRARY_DIR Qt5::Core LOCATION)
|
||||
get_filename_component(QT_LIBRARY_DIR ${QT_LIBRARY_DIR} PATH)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
QT5_ADD_RESOURCES(cockatrice_RESOURCES_RCC ${cockatrice_RESOURCES})
|
||||
|
||||
# Declare path variables
|
||||
set(ICONDIR share/icons CACHE STRING "icon dir")
|
||||
set(DESKTOPDIR share/applications CACHE STRING "desktop file destination")
|
||||
@@ -234,30 +187,16 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
# Build cockatrice binary and link it
|
||||
ADD_EXECUTABLE(cockatrice WIN32 MACOSX_BUNDLE ${cockatrice_SOURCES} ${cockatrice_QM} ${cockatrice_RESOURCES_RCC} ${cockatrice_MOC_SRCS})
|
||||
set_property(TARGET cockatrice PROPERTY CXX_STANDARD 11)
|
||||
set_property(TARGET cockatrice PROPERTY CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
if(Qt4_FOUND)
|
||||
if(MSVC)
|
||||
set(QT_USE_QTMAIN true)
|
||||
endif()
|
||||
TARGET_LINK_LIBRARIES(cockatrice cockatrice_common ${COCKATRICE_LIBS})
|
||||
endif()
|
||||
if(Qt5Widgets_FOUND)
|
||||
if(MSVC)
|
||||
TARGET_LINK_LIBRARIES(cockatrice cockatrice_common Qt5::WinMain)
|
||||
else()
|
||||
TARGET_LINK_LIBRARIES(cockatrice cockatrice_common)
|
||||
endif()
|
||||
qt5_use_modules(cockatrice ${COCKATRICE_LIBS})
|
||||
endif()
|
||||
TARGET_LINK_LIBRARIES(cockatrice cockatrice_common)
|
||||
qt5_use_modules(cockatrice ${COCKATRICE_QT_MODULES})
|
||||
|
||||
if(UNIX)
|
||||
if(APPLE)
|
||||
set(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME}")
|
||||
set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.cockatrice.${PROJECT_NAME}")
|
||||
set(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_NAME}-${PROJECT_VERSION}")
|
||||
set(MACOSX_BUNDLE_BUNDLE_NAME ${PROJECT_NAME})
|
||||
set(MACOSX_BUNDLE_BUNDLE_NAME "${PROJECT_NAME}")
|
||||
set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION})
|
||||
set(MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION})
|
||||
set_target_properties(cockatrice PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/cmake/Info.plist)
|
||||
@@ -283,12 +222,18 @@ if(APPLE)
|
||||
set(qtconf_dest_dir cockatrice.app/Contents/Resources)
|
||||
get_filename_component(QT_LIBRARY_DIR "${QT_LIBRARY_DIR}/.." ABSOLUTE)
|
||||
|
||||
# qt4: codecs, iconengines, imageformats
|
||||
# qt5: audio, iconengines, imageformats, platforms, printsupport
|
||||
|
||||
# qt5 plugins: audio, iconengines, imageformats, platforms, printsupport
|
||||
install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime
|
||||
FILES_MATCHING REGEX "(audio|codecs|iconengines|imageformats|platforms|printsupport)/.*\\.dylib"
|
||||
REGEX ".*_debug\\.dylib" EXCLUDE)
|
||||
FILES_MATCHING
|
||||
PATTERN "*.dSYM" EXCLUDE
|
||||
PATTERN "*_debug.dylib" EXCLUDE
|
||||
PATTERN "audio/*.dylib"
|
||||
PATTERN "iconengines/*.dylib"
|
||||
PATTERN "imageformats/*.dylib"
|
||||
PATTERN "platforms/*.dylib"
|
||||
PATTERN "printsupport/*.dylib"
|
||||
PATTERN "styles/*.dylib"
|
||||
)
|
||||
|
||||
install(CODE "
|
||||
file(WRITE \"\${CMAKE_INSTALL_PREFIX}/${qtconf_dest_dir}/qt.conf\" \"[Paths]
|
||||
@@ -311,11 +256,9 @@ if(WIN32)
|
||||
set(plugin_dest_dir Plugins)
|
||||
set(qtconf_dest_dir .)
|
||||
|
||||
# qt4: codecs, iconengines, imageformats
|
||||
# qt5: audio, iconengines, imageformats, platforms, printsupport
|
||||
|
||||
# qt5 plugins: audio, iconengines, imageformats, platforms, printsupport
|
||||
install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime
|
||||
FILES_MATCHING REGEX "(audio|codecs|iconengines|imageformats|platforms|printsupport)/.*[^d]\\.dll")
|
||||
FILES_MATCHING REGEX "(audio|iconengines|imageformats|platforms|printsupport)/.*[^d]\\.dll")
|
||||
|
||||
install(CODE "
|
||||
file(WRITE \"\${CMAKE_INSTALL_PREFIX}/${qtconf_dest_dir}/qt.conf\" \"[Paths]
|
||||
@@ -329,15 +272,10 @@ Data = Resources\")
|
||||
\"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/*.dll\")
|
||||
set(BU_CHMOD_BUNDLE_ITEMS ON)
|
||||
include(BundleUtilities)
|
||||
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/cockatrice.exe\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR}\")
|
||||
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/Cockatrice.exe\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR}\")
|
||||
" COMPONENT Runtime)
|
||||
|
||||
if(WIN32SSLRUNTIME_FOUND)
|
||||
install(FILES ${WIN32SSLRUNTIME_LIBRARIES} DESTINATION ./)
|
||||
endif()
|
||||
endif()
|
||||
#Compile a portable version, default off
|
||||
option(PORTABLE "portable build" OFF)
|
||||
IF(PORTABLE)
|
||||
add_definitions(-DPORTABLE_BUILD)
|
||||
endif()
|
||||
@@ -327,9 +327,34 @@
|
||||
<file>resources/userlevels/normal.svg</file>
|
||||
<file>resources/userlevels/registered.svg</file>
|
||||
<file>resources/userlevels/registered_buddy.svg</file>
|
||||
<file>resources/userlevels/registered_vip.svg</file>
|
||||
<file>resources/userlevels/registered_vip_buddy.svg</file>
|
||||
<file>resources/userlevels/registered_donator.svg</file>
|
||||
<file>resources/userlevels/registered_donator_buddy.svg</file>
|
||||
|
||||
<file>resources/userlevels/moderator.svg</file>
|
||||
<file>resources/userlevels/moderator_buddy.svg</file>
|
||||
<file>resources/userlevels/moderator_vip.svg</file>
|
||||
<file>resources/userlevels/moderator_vip_buddy.svg</file>
|
||||
|
||||
<file>resources/userlevels/admin.svg</file>
|
||||
<file>resources/userlevels/admin_buddy.svg</file>
|
||||
<file>resources/userlevels/admin_vip.svg</file>
|
||||
<file>resources/userlevels/admin_vip_buddy.svg</file>
|
||||
|
||||
<!-- ADD TIP OF THE DAY IMAGES HERE -->
|
||||
<file>resources/tips/tips_of_the_day.xml</file>
|
||||
<file>resources/tips/images/accounts_tab.png</file>
|
||||
<file>resources/tips/images/arrows.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/face_down.png</file>
|
||||
<file>resources/tips/images/filter_games.png</file>
|
||||
<file>resources/tips/images/github_logo.png</file>
|
||||
<file>resources/tips/images/gitter.png</file>
|
||||
<file>resources/tips/images/themes.png</file>
|
||||
<file>resources/tips/images/tip_of_the_day.png</file>
|
||||
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
|
Before Width: | Height: | Size: 236 KiB After Width: | Height: | Size: 106 KiB |
176
cockatrice/resources/countries/eu.svg
Normal file
@@ -0,0 +1,176 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.1"
|
||||
width="640"
|
||||
height="480"
|
||||
id="svg2"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="eu.svg">
|
||||
<metadata
|
||||
id="metadata43">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="640"
|
||||
inkscape:window-height="480"
|
||||
id="namedview41"
|
||||
showgrid="false"
|
||||
inkscape:zoom="0.35308642"
|
||||
inkscape:cx="405"
|
||||
inkscape:cy="229.84832"
|
||||
inkscape:window-x="695"
|
||||
inkscape:window-y="86"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="svg2" />
|
||||
<desc
|
||||
id="desc4">European flag</desc>
|
||||
<defs
|
||||
id="defs6">
|
||||
<g
|
||||
id="s">
|
||||
<g
|
||||
id="c">
|
||||
<path
|
||||
id="t"
|
||||
d="M 0,0 0,1 0.5,1 Z"
|
||||
transform="matrix(0.95105652,0.30901699,-0.30901699,0.95105652,0,-1)"
|
||||
inkscape:connector-curvature="0" />
|
||||
<use
|
||||
xlink:href="#t"
|
||||
transform="scale(-1,1)"
|
||||
id="use11"
|
||||
x="0"
|
||||
y="0"
|
||||
width="100%"
|
||||
height="100%" />
|
||||
</g>
|
||||
<g
|
||||
id="a">
|
||||
<use
|
||||
xlink:href="#c"
|
||||
transform="matrix(0.30901699,0.95105652,-0.95105652,0.30901699,0,0)"
|
||||
id="use14"
|
||||
x="0"
|
||||
y="0"
|
||||
width="100%"
|
||||
height="100%" />
|
||||
<use
|
||||
xlink:href="#c"
|
||||
transform="matrix(-0.80901699,0.58778525,-0.58778525,-0.80901699,0,0)"
|
||||
id="use16"
|
||||
x="0"
|
||||
y="0"
|
||||
width="100%"
|
||||
height="100%" />
|
||||
</g>
|
||||
<use
|
||||
xlink:href="#a"
|
||||
transform="scale(-1,1)"
|
||||
id="use18"
|
||||
x="0"
|
||||
y="0"
|
||||
width="100%"
|
||||
height="100%" />
|
||||
</g>
|
||||
</defs>
|
||||
<rect
|
||||
width="642.9021"
|
||||
height="483.35666"
|
||||
id="rect20"
|
||||
x="2.8321679"
|
||||
y="2.3076911"
|
||||
style="fill:#003399" />
|
||||
<g
|
||||
transform="matrix(23.811189,0,0,23.981809,322.28322,245.88665)"
|
||||
id="g22"
|
||||
style="fill:#ffcc00">
|
||||
<use
|
||||
xlink:href="#s"
|
||||
y="-6"
|
||||
id="use24"
|
||||
x="0"
|
||||
width="100%"
|
||||
height="100%" />
|
||||
<use
|
||||
xlink:href="#s"
|
||||
y="6"
|
||||
id="use26"
|
||||
x="0"
|
||||
width="100%"
|
||||
height="100%" />
|
||||
<g
|
||||
id="l">
|
||||
<use
|
||||
xlink:href="#s"
|
||||
x="-6"
|
||||
id="use29"
|
||||
y="0"
|
||||
width="100%"
|
||||
height="100%" />
|
||||
<use
|
||||
xlink:href="#s"
|
||||
transform="matrix(-0.80901699,-0.58778525,0.58778525,-0.80901699,-3,-5.1961524)"
|
||||
id="use31"
|
||||
x="0"
|
||||
y="0"
|
||||
width="100%"
|
||||
height="100%" />
|
||||
<use
|
||||
xlink:href="#s"
|
||||
transform="matrix(-0.80901699,0.58778525,-0.58778525,-0.80901699,-5.1961524,-3)"
|
||||
id="use33"
|
||||
x="0"
|
||||
y="0"
|
||||
width="100%"
|
||||
height="100%" />
|
||||
<use
|
||||
xlink:href="#s"
|
||||
transform="matrix(0.30901699,0.95105652,-0.95105652,0.30901699,-5.1961524,3)"
|
||||
id="use35"
|
||||
x="0"
|
||||
y="0"
|
||||
width="100%"
|
||||
height="100%" />
|
||||
<use
|
||||
xlink:href="#s"
|
||||
transform="matrix(0.30901699,0.95105652,-0.95105652,0.30901699,-3,5.1961524)"
|
||||
id="use37"
|
||||
x="0"
|
||||
y="0"
|
||||
width="100%"
|
||||
height="100%" />
|
||||
</g>
|
||||
<use
|
||||
xlink:href="#l"
|
||||
transform="scale(-1,1)"
|
||||
id="use39"
|
||||
x="0"
|
||||
y="0"
|
||||
width="100%"
|
||||
height="100%" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 28 KiB |
BIN
cockatrice/resources/tips/images/accounts_tab.png
Normal file
|
After Width: | Height: | Size: 75 KiB |
BIN
cockatrice/resources/tips/images/arrows.png
Normal file
|
After Width: | Height: | Size: 114 KiB |
BIN
cockatrice/resources/tips/images/cockatrice_register.png
Normal file
|
After Width: | Height: | Size: 99 KiB |
BIN
cockatrice/resources/tips/images/cockatrice_wiki.png
Normal file
|
After Width: | Height: | Size: 167 KiB |
BIN
cockatrice/resources/tips/images/coin_flip.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
cockatrice/resources/tips/images/face_down.png
Normal file
|
After Width: | Height: | Size: 51 KiB |
BIN
cockatrice/resources/tips/images/filter_games.png
Normal file
|
After Width: | Height: | Size: 227 KiB |
BIN
cockatrice/resources/tips/images/github_logo.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
cockatrice/resources/tips/images/gitter.png
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
BIN
cockatrice/resources/tips/images/themes.png
Normal file
|
After Width: | Height: | Size: 82 KiB |
BIN
cockatrice/resources/tips/images/tip_of_the_day.png
Normal file
|
After Width: | Height: | Size: 92 KiB |
86
cockatrice/resources/tips/tips_of_the_day.xml
Normal file
@@ -0,0 +1,86 @@
|
||||
<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://gitter.im/cockatrice/cockatrice">Gitter</a>!</text>
|
||||
<image>gitter.png</image>
|
||||
<date>2018-03-01</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>
|
||||
<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>
|
||||
</tips>
|
||||
363
cockatrice/resources/userlevels/admin_vip.svg
Normal file
@@ -0,0 +1,363 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="100"
|
||||
height="100"
|
||||
id="svg5322"
|
||||
version="1.1"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="admin_vip.svg">
|
||||
<defs
|
||||
id="defs3">
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient3419">
|
||||
<stop
|
||||
style="stop-color:#ffec79;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop3421" />
|
||||
<stop
|
||||
style="stop-color:#f2c15b;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop3423" />
|
||||
</linearGradient>
|
||||
<inkscape:perspective
|
||||
sodipodi:type="inkscape:persp3d"
|
||||
inkscape:vp_x="0 : 526.18109 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_z="744.09448 : 526.18109 : 1"
|
||||
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
|
||||
id="perspective5328" />
|
||||
<inkscape:perspective
|
||||
id="perspective5305"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<linearGradient
|
||||
id="linearGradient5181">
|
||||
<stop
|
||||
style="stop-color:#0fbb00;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5183" />
|
||||
<stop
|
||||
style="stop-color:#064400;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop5185" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3600-2"
|
||||
id="radialGradient3606-7"
|
||||
cx="324.32715"
|
||||
cy="131.40274"
|
||||
fx="324.32715"
|
||||
fy="131.40274"
|
||||
r="25.501276"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)" />
|
||||
<linearGradient
|
||||
id="linearGradient3600-2">
|
||||
<stop
|
||||
style="stop-color:#ffc33d;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3602-4" />
|
||||
<stop
|
||||
style="stop-color:#e09900;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3604-9" />
|
||||
</linearGradient>
|
||||
<inkscape:perspective
|
||||
id="perspective5478"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<linearGradient
|
||||
id="linearGradient5189">
|
||||
<stop
|
||||
style="stop-color:#000ec9;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5191" />
|
||||
<stop
|
||||
style="stop-color:#000657;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop5193" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3600-4"
|
||||
id="radialGradient3606-1"
|
||||
cx="324.32715"
|
||||
cy="131.40274"
|
||||
fx="324.32715"
|
||||
fy="131.40274"
|
||||
r="25.501276"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)" />
|
||||
<linearGradient
|
||||
id="linearGradient3600-4">
|
||||
<stop
|
||||
style="stop-color:#ffc33d;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3602-3" />
|
||||
<stop
|
||||
style="stop-color:#e09900;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3604-5" />
|
||||
</linearGradient>
|
||||
<inkscape:perspective
|
||||
id="perspective5559"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5173"
|
||||
id="linearGradient5179"
|
||||
x1="167.33386"
|
||||
y1="178.83276"
|
||||
x2="244.78181"
|
||||
y2="178.83276"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
id="linearGradient5173">
|
||||
<stop
|
||||
style="stop-color:#f50000;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5175" />
|
||||
<stop
|
||||
style="stop-color:#950000;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop5177" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3600"
|
||||
id="radialGradient5169"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)"
|
||||
cx="324.32715"
|
||||
cy="131.40274"
|
||||
fx="324.32715"
|
||||
fy="131.40274"
|
||||
r="25.501276" />
|
||||
<linearGradient
|
||||
id="linearGradient3600">
|
||||
<stop
|
||||
style="stop-color:#ffc13d;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3602" />
|
||||
<stop
|
||||
style="stop-color:#e09900;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3604" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
r="25.501276"
|
||||
fy="131.40274"
|
||||
fx="324.32715"
|
||||
cy="131.40274"
|
||||
cx="324.32715"
|
||||
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient5574"
|
||||
xlink:href="#linearGradient3600"
|
||||
inkscape:collect="always" />
|
||||
<inkscape:perspective
|
||||
id="perspective5663"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3600-7"
|
||||
id="radialGradient3606-8"
|
||||
cx="324.32715"
|
||||
cy="131.40274"
|
||||
fx="324.32715"
|
||||
fy="131.40274"
|
||||
r="25.501276"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)" />
|
||||
<linearGradient
|
||||
id="linearGradient3600-7">
|
||||
<stop
|
||||
style="stop-color:#ffc13d;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3602-7" />
|
||||
<stop
|
||||
style="stop-color:#e09900;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3604-6" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3600-7"
|
||||
id="radialGradient5254"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)"
|
||||
cx="324.32715"
|
||||
cy="131.40274"
|
||||
fx="324.32715"
|
||||
fy="131.40274"
|
||||
r="25.501276" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5189-1"
|
||||
id="linearGradient5394"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="385.03503"
|
||||
y1="180.09546"
|
||||
x2="462.48297"
|
||||
y2="180.09546"
|
||||
gradientTransform="matrix(0.96839241,0,0,0.96839241,-360.365,847.52359)" />
|
||||
<linearGradient
|
||||
id="linearGradient5189-1">
|
||||
<stop
|
||||
style="stop-color:#000ec9;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5191-0" />
|
||||
<stop
|
||||
style="stop-color:#000657;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop5193-4" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5173-1"
|
||||
id="linearGradient5581"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="167.33386"
|
||||
y1="178.83276"
|
||||
x2="244.78181"
|
||||
y2="178.83276"
|
||||
gradientTransform="matrix(0.96839241,0,0,0.96839241,-149.54484,848.74636)" />
|
||||
<linearGradient
|
||||
id="linearGradient5173-1">
|
||||
<stop
|
||||
style="stop-color:#f50000;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5175-5" />
|
||||
<stop
|
||||
style="stop-color:#950000;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop5177-3" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5181-9"
|
||||
id="linearGradient5782"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="282.50455"
|
||||
y1="181.61069"
|
||||
x2="359.95248"
|
||||
y2="181.61069"
|
||||
gradientTransform="matrix(0.96839241,0,0,0.96839241,-261.07526,846.05625)" />
|
||||
<linearGradient
|
||||
id="linearGradient5181-9">
|
||||
<stop
|
||||
style="stop-color:#80d600;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5183-3" />
|
||||
<stop
|
||||
style="stop-color:#80d600;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop5185-0" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
y2="181.61069"
|
||||
x2="359.95248"
|
||||
y1="181.61069"
|
||||
x1="282.50455"
|
||||
gradientTransform="matrix(0.96839241,0,0,0.96839241,-175.71812,893.2775)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient5799"
|
||||
xlink:href="#linearGradient5181-9"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3419"
|
||||
id="linearGradient3425"
|
||||
x1="-126.90256"
|
||||
y1="941.52618"
|
||||
x2="-125.73831"
|
||||
y2="984.13751"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(154.2532,0.90556908)" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
inkscape:document-units="mm"
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="4.2946338"
|
||||
inkscape:cx="0.39222903"
|
||||
inkscape:cy="65.175571"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1440"
|
||||
inkscape:window-height="792"
|
||||
inkscape:window-x="11"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="0" />
|
||||
<metadata
|
||||
id="metadata4">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-952.36218)">
|
||||
<path
|
||||
style="fill:#ff0000;fill-opacity:1;stroke:black;stroke-width:2.78220296;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="M 49.84375 1.71875 C 36.719738 1.71875 26.0625 12.375988 26.0625 25.5 C 26.0625 32.977454 29.538325 39.612734 34.9375 43.96875 C 24.439951 49.943698 17.919149 62.196126 14.3125 75.65625 C 9.0380874 95.34065 30.224013 98.21875 49.84375 98.21875 C 69.463486 98.21875 90.549327 94.96715 85.375 75.65625 C 81.693381 61.916246 75.224585 49.827177 64.8125 43.9375 C 70.181573 39.580662 73.59375 32.953205 73.59375 25.5 C 73.59375 12.375988 62.967762 1.71875 49.84375 1.71875 z "
|
||||
transform="translate(0,952.36218)"
|
||||
id="path3597-8" />
|
||||
<path
|
||||
sodipodi:type="star"
|
||||
style="fill:url(#linearGradient3425);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
id="path3415"
|
||||
sodipodi:sides="5"
|
||||
sodipodi:cx="27.80283"
|
||||
sodipodi:cy="970.9433"
|
||||
sodipodi:r1="17.189852"
|
||||
sodipodi:r2="8.5949249"
|
||||
sodipodi:arg1="0.9349579"
|
||||
sodipodi:arg2="1.5632764"
|
||||
inkscape:flatsided="false"
|
||||
inkscape:rounded="0"
|
||||
inkscape:randomized="0"
|
||||
d="m 38.011063,984.77381 -10.143601,-5.23583 -10.063711,5.38779 1.845023,-11.2651 -8.233948,-7.90624 11.283888,-1.72639 4.974851,-10.27411 5.128803,10.19813 11.308575,1.55649 -8.114112,8.02918 z"
|
||||
inkscape:transform-center-x="0.094945927"
|
||||
inkscape:transform-center-y="-3.9764964"
|
||||
transform="matrix(2.3768784,0,0,2.4799382,-16.393468,-1400.3733)" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 12 KiB |
136
cockatrice/resources/userlevels/admin_vip_buddy.svg
Normal file
@@ -0,0 +1,136 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
viewBox="0 0 64 64"
|
||||
enable-background="new 0 0 64 64"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.5 r10040"
|
||||
width="100%"
|
||||
height="100%"
|
||||
sodipodi:docname="admin_buddy.svg">
|
||||
<metadata
|
||||
id="metadata12">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs10">
|
||||
<linearGradient
|
||||
id="linearGradient3766">
|
||||
<stop
|
||||
style="stop-color:#ff2700;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3768" />
|
||||
<stop
|
||||
style="stop-color:#820000;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3770" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient5225">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5227" />
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop5229" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient5219"
|
||||
osb:paint="solid">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5221" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3758">
|
||||
<stop
|
||||
id="stop3760"
|
||||
offset="0"
|
||||
style="stop-color:#0fbb00;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3762"
|
||||
offset="1"
|
||||
style="stop-color:#064400;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3750">
|
||||
<stop
|
||||
style="stop-color:#ece400;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3752" />
|
||||
<stop
|
||||
style="stop-color:#ece400;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop3754" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3758-7"
|
||||
id="linearGradient3756-1"
|
||||
x1="1.960216"
|
||||
y1="31.261461"
|
||||
x2="60.456024"
|
||||
y2="31.261461"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
id="linearGradient3758-7">
|
||||
<stop
|
||||
id="stop3760-4"
|
||||
offset="0"
|
||||
style="stop-color:#ece400;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3762-0"
|
||||
offset="1"
|
||||
style="stop-color:#ec8b00;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1028"
|
||||
id="namedview8"
|
||||
showgrid="false"
|
||||
inkscape:zoom="5.2149125"
|
||||
inkscape:cx="-37.840247"
|
||||
inkscape:cy="51.245759"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg2" />
|
||||
<path
|
||||
d="M 61.442826,23.621762 38.532402,23.515555 31.556101,0.331013 24.578789,23.515555 1.6673502,23.621765 20.267785,38.422001 10.863888,63.668987 31.556101,47.626631 52.258426,63.668987 42.843404,38.422001 z"
|
||||
id="path4-9"
|
||||
style="fill:#000000;fill-opacity:1"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
d="M 57.150089,25.064396 37.504323,24.973324 31.522122,5.092503 25.539054,24.973324 5.8924192,25.064399 21.842354,37.75565 13.778482,59.405024 31.522122,45.64865 49.274434,59.405024 41.201022,37.75565 z"
|
||||
id="path4"
|
||||
style="fill:#ff2700;fill-opacity:1;fill-rule:nonzero"
|
||||
inkscape:connector-curvature="0" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.1 KiB |
368
cockatrice/resources/userlevels/moderator_vip.svg
Normal file
@@ -0,0 +1,368 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="100"
|
||||
height="100"
|
||||
id="svg5322"
|
||||
version="1.1"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="moderator_vip.svg">
|
||||
<defs
|
||||
id="defs3">
|
||||
<inkscape:perspective
|
||||
sodipodi:type="inkscape:persp3d"
|
||||
inkscape:vp_x="0 : 526.18109 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_z="744.09448 : 526.18109 : 1"
|
||||
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
|
||||
id="perspective5328" />
|
||||
<inkscape:perspective
|
||||
id="perspective5305"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<linearGradient
|
||||
id="linearGradient5181">
|
||||
<stop
|
||||
style="stop-color:#0fbb00;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5183" />
|
||||
<stop
|
||||
style="stop-color:#064400;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop5185" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3600-2"
|
||||
id="radialGradient3606-7"
|
||||
cx="324.32715"
|
||||
cy="131.40274"
|
||||
fx="324.32715"
|
||||
fy="131.40274"
|
||||
r="25.501276"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)" />
|
||||
<linearGradient
|
||||
id="linearGradient3600-2">
|
||||
<stop
|
||||
style="stop-color:#ffc33d;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3602-4" />
|
||||
<stop
|
||||
style="stop-color:#e09900;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3604-9" />
|
||||
</linearGradient>
|
||||
<inkscape:perspective
|
||||
id="perspective5478"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<linearGradient
|
||||
id="linearGradient5189">
|
||||
<stop
|
||||
style="stop-color:#000ec9;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5191" />
|
||||
<stop
|
||||
style="stop-color:#000657;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop5193" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3600-4"
|
||||
id="radialGradient3606-1"
|
||||
cx="324.32715"
|
||||
cy="131.40274"
|
||||
fx="324.32715"
|
||||
fy="131.40274"
|
||||
r="25.501276"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)" />
|
||||
<linearGradient
|
||||
id="linearGradient3600-4">
|
||||
<stop
|
||||
style="stop-color:#ffc33d;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3602-3" />
|
||||
<stop
|
||||
style="stop-color:#e09900;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3604-5" />
|
||||
</linearGradient>
|
||||
<inkscape:perspective
|
||||
id="perspective5559"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5173"
|
||||
id="linearGradient5179"
|
||||
x1="167.33386"
|
||||
y1="178.83276"
|
||||
x2="244.78181"
|
||||
y2="178.83276"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
id="linearGradient5173">
|
||||
<stop
|
||||
style="stop-color:#f50000;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5175" />
|
||||
<stop
|
||||
style="stop-color:#950000;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop5177" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3600"
|
||||
id="radialGradient5169"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)"
|
||||
cx="324.32715"
|
||||
cy="131.40274"
|
||||
fx="324.32715"
|
||||
fy="131.40274"
|
||||
r="25.501276" />
|
||||
<linearGradient
|
||||
id="linearGradient3600">
|
||||
<stop
|
||||
style="stop-color:#ffc13d;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3602" />
|
||||
<stop
|
||||
style="stop-color:#e09900;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3604" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
r="25.501276"
|
||||
fy="131.40274"
|
||||
fx="324.32715"
|
||||
cy="131.40274"
|
||||
cx="324.32715"
|
||||
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient5574"
|
||||
xlink:href="#linearGradient3600"
|
||||
inkscape:collect="always" />
|
||||
<inkscape:perspective
|
||||
id="perspective5663"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3600-7"
|
||||
id="radialGradient3606-8"
|
||||
cx="324.32715"
|
||||
cy="131.40274"
|
||||
fx="324.32715"
|
||||
fy="131.40274"
|
||||
r="25.501276"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)" />
|
||||
<linearGradient
|
||||
id="linearGradient3600-7">
|
||||
<stop
|
||||
style="stop-color:#ffc13d;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3602-7" />
|
||||
<stop
|
||||
style="stop-color:#e09900;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3604-6" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3600-7"
|
||||
id="radialGradient5254"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)"
|
||||
cx="324.32715"
|
||||
cy="131.40274"
|
||||
fx="324.32715"
|
||||
fy="131.40274"
|
||||
r="25.501276" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5189-1"
|
||||
id="linearGradient5394"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="385.03503"
|
||||
y1="180.09546"
|
||||
x2="462.48297"
|
||||
y2="180.09546"
|
||||
gradientTransform="matrix(0.96839241,0,0,0.96839241,-360.365,847.52359)" />
|
||||
<linearGradient
|
||||
id="linearGradient5189-1">
|
||||
<stop
|
||||
style="stop-color:#000ec9;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5191-0" />
|
||||
<stop
|
||||
style="stop-color:#000657;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop5193-4" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5173-1"
|
||||
id="linearGradient5581"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="167.33386"
|
||||
y1="178.83276"
|
||||
x2="244.78181"
|
||||
y2="178.83276"
|
||||
gradientTransform="matrix(0.96839241,0,0,0.96839241,-149.54484,848.74636)" />
|
||||
<linearGradient
|
||||
id="linearGradient5173-1">
|
||||
<stop
|
||||
style="stop-color:#f50000;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5175-5" />
|
||||
<stop
|
||||
style="stop-color:#950000;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop5177-3" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5181-9"
|
||||
id="linearGradient5782"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="282.50455"
|
||||
y1="181.61069"
|
||||
x2="359.95248"
|
||||
y2="181.61069"
|
||||
gradientTransform="matrix(0.96839241,0,0,0.96839241,-261.07526,846.05625)" />
|
||||
<linearGradient
|
||||
id="linearGradient5181-9">
|
||||
<stop
|
||||
style="stop-color:#80d600;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5183-3" />
|
||||
<stop
|
||||
style="stop-color:#80d600;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop5185-0" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
y2="181.61069"
|
||||
x2="359.95248"
|
||||
y1="181.61069"
|
||||
x1="282.50455"
|
||||
gradientTransform="matrix(0.96839241,0,0,0.96839241,-175.71812,893.2775)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient5799"
|
||||
xlink:href="#linearGradient5181-9"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient3419">
|
||||
<stop
|
||||
style="stop-color:#ffec79;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop3421" />
|
||||
<stop
|
||||
style="stop-color:#f2c15b;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop3423" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3419"
|
||||
id="linearGradient3425-5"
|
||||
x1="-126.90256"
|
||||
y1="941.52618"
|
||||
x2="-125.73831"
|
||||
y2="984.13751"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(154.2532,0.90556908)" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
inkscape:document-units="mm"
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="4.2946338"
|
||||
inkscape:cx="34.155294"
|
||||
inkscape:cy="65.175571"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1440"
|
||||
inkscape:window-height="792"
|
||||
inkscape:window-x="11"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="0" />
|
||||
<metadata
|
||||
id="metadata4">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-952.36218)">
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:black;stroke-width:2.78220296;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="M 49.84375 1.71875 C 36.719738 1.71875 26.0625 12.375988 26.0625 25.5 C 26.0625 32.977454 29.538325 39.612734 34.9375 43.96875 C 24.439951 49.943698 17.919149 62.196126 14.3125 75.65625 C 9.0380874 95.34065 30.224013 98.21875 49.84375 98.21875 C 69.463486 98.21875 90.549327 94.96715 85.375 75.65625 C 81.693381 61.916246 75.224585 49.827177 64.8125 43.9375 C 70.181573 39.580662 73.59375 32.953205 73.59375 25.5 C 73.59375 12.375988 62.967762 1.71875 49.84375 1.71875 z "
|
||||
transform="translate(0,952.36218)"
|
||||
id="path3597-8" />
|
||||
<path
|
||||
style="opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.73577702;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 51.28696,1001.834 0,-46.98372 1.434151,0.16768 c 5.155008,0.60274 9.462857,2.72154 12.938257,6.36366 4.74393,4.9715 6.87913,11.35611 6.16464,18.43328 -0.53702,5.31935 -3.09008,10.59498 -6.83833,14.13074 l -1.94072,1.83069 3.04083,2.20427 c 3.58084,2.5957 7.18975,6.4912 9.55296,10.3116 4.89572,7.9144 9.23593,21.4918 8.50487,26.6055 -0.81312,5.6877 -5.43872,9.6977 -13.62216,11.8093 -3.80822,0.9826 -7.68056,1.4713 -14.763321,1.8633 l -4.471177,0.2474 0,-46.9837 z"
|
||||
id="path5355"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
sodipodi:type="star"
|
||||
style="fill:url(#linearGradient3425-5);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
id="path3415-0"
|
||||
sodipodi:sides="5"
|
||||
sodipodi:cx="27.80283"
|
||||
sodipodi:cy="970.9433"
|
||||
sodipodi:r1="17.189852"
|
||||
sodipodi:r2="8.5949249"
|
||||
sodipodi:arg1="0.9349579"
|
||||
sodipodi:arg2="1.5632764"
|
||||
inkscape:flatsided="false"
|
||||
inkscape:rounded="0"
|
||||
inkscape:randomized="0"
|
||||
d="m 38.011063,984.77381 -10.143601,-5.23583 -10.063711,5.38779 1.845023,-11.2651 -8.233948,-7.90624 11.283888,-1.72639 4.974851,-10.27411 5.128803,10.19813 11.308575,1.55649 -8.114112,8.02918 z"
|
||||
inkscape:transform-center-x="0.094945927"
|
||||
inkscape:transform-center-y="-3.9764964"
|
||||
transform="matrix(2.3768784,0,0,2.4799382,-15.920285,-1400.1716)" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 12 KiB |
131
cockatrice/resources/userlevels/moderator_vip_buddy.svg
Normal file
@@ -0,0 +1,131 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
viewBox="0 0 64 64"
|
||||
enable-background="new 0 0 64 64"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.5 r10040"
|
||||
width="100%"
|
||||
height="100%"
|
||||
sodipodi:docname="moderator_buddy.svg">
|
||||
<metadata
|
||||
id="metadata12">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs10">
|
||||
<linearGradient
|
||||
id="linearGradient5225">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5227" />
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop5229" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient5219"
|
||||
osb:paint="solid">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5221" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3758">
|
||||
<stop
|
||||
id="stop3760"
|
||||
offset="0"
|
||||
style="stop-color:#0fbb00;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3762"
|
||||
offset="1"
|
||||
style="stop-color:#064400;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3750">
|
||||
<stop
|
||||
style="stop-color:#ece400;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3752" />
|
||||
<stop
|
||||
style="stop-color:#ece400;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop3754" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3758-7"
|
||||
id="linearGradient3756-1"
|
||||
x1="1.960216"
|
||||
y1="31.261461"
|
||||
x2="60.456024"
|
||||
y2="31.261461"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
id="linearGradient3758-7">
|
||||
<stop
|
||||
id="stop3760-4"
|
||||
offset="0"
|
||||
style="stop-color:#ece400;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3762-0"
|
||||
offset="1"
|
||||
style="stop-color:#ec8b00;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1028"
|
||||
id="namedview8"
|
||||
showgrid="false"
|
||||
inkscape:zoom="5.2149125"
|
||||
inkscape:cx="-26.445493"
|
||||
inkscape:cy="31.598459"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg2" />
|
||||
<path
|
||||
d="M 61.442826,23.621762 38.532402,23.515555 31.556101,0.331013 24.578789,23.515555 1.6673502,23.621765 20.267785,38.422001 10.863888,63.668987 31.556101,47.626631 52.258426,63.668987 42.843404,38.422001 z"
|
||||
id="path4-9"
|
||||
style="fill:#000000;fill-opacity:1"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
d="M 55.041981,25.814432 36.921945,25.730432 31.404334,7.3935963 25.885923,25.730432 7.7650846,25.814434 22.476316,37.520057 15.0387,57.488097 31.404334,44.800071 47.777965,57.488097 40.331551,37.520057 z"
|
||||
id="path4"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
d="M 56.276895,25.211993 37.3433,24.856806 31.486705,5.7742084 c 0.04705,37.4359336 -0.01851,2.6744908 -0.0678,40.1841446 L 48.19932,58.580578 40.956295,37.527792 z"
|
||||
id="path4-1"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccccc" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.1 KiB |
291
cockatrice/resources/userlevels/registered_donator.svg
Normal file
@@ -0,0 +1,291 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="100"
|
||||
height="100"
|
||||
id="svg5322"
|
||||
version="1.1"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="vip.svg">
|
||||
<defs
|
||||
id="defs3">
|
||||
<inkscape:perspective
|
||||
sodipodi:type="inkscape:persp3d"
|
||||
inkscape:vp_x="0 : 526.18109 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_z="744.09448 : 526.18109 : 1"
|
||||
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
|
||||
id="perspective5328" />
|
||||
<inkscape:perspective
|
||||
id="perspective5305"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<linearGradient
|
||||
id="linearGradient5181">
|
||||
<stop
|
||||
style="stop-color:#0fbb00;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5183" />
|
||||
<stop
|
||||
style="stop-color:#064400;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop5185" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3600-2"
|
||||
id="radialGradient3606-7"
|
||||
cx="324.32715"
|
||||
cy="131.40274"
|
||||
fx="324.32715"
|
||||
fy="131.40274"
|
||||
r="25.501276"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)" />
|
||||
<linearGradient
|
||||
id="linearGradient3600-2">
|
||||
<stop
|
||||
style="stop-color:#ffc33d;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3602-4" />
|
||||
<stop
|
||||
style="stop-color:#e09900;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3604-9" />
|
||||
</linearGradient>
|
||||
<inkscape:perspective
|
||||
id="perspective5478"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<linearGradient
|
||||
id="linearGradient5189">
|
||||
<stop
|
||||
style="stop-color:#000ec9;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5191" />
|
||||
<stop
|
||||
style="stop-color:#000657;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop5193" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3600-4"
|
||||
id="radialGradient3606-1"
|
||||
cx="324.32715"
|
||||
cy="131.40274"
|
||||
fx="324.32715"
|
||||
fy="131.40274"
|
||||
r="25.501276"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)" />
|
||||
<linearGradient
|
||||
id="linearGradient3600-4">
|
||||
<stop
|
||||
style="stop-color:#ffc33d;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3602-3" />
|
||||
<stop
|
||||
style="stop-color:#e09900;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3604-5" />
|
||||
</linearGradient>
|
||||
<inkscape:perspective
|
||||
id="perspective5559"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5173"
|
||||
id="linearGradient5179"
|
||||
x1="167.33386"
|
||||
y1="178.83276"
|
||||
x2="244.78181"
|
||||
y2="178.83276"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
id="linearGradient5173">
|
||||
<stop
|
||||
style="stop-color:#f50000;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5175" />
|
||||
<stop
|
||||
style="stop-color:#950000;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop5177" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3600"
|
||||
id="radialGradient5169"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)"
|
||||
cx="324.32715"
|
||||
cy="131.40274"
|
||||
fx="324.32715"
|
||||
fy="131.40274"
|
||||
r="25.501276" />
|
||||
<linearGradient
|
||||
id="linearGradient3600">
|
||||
<stop
|
||||
style="stop-color:#ffc13d;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3602" />
|
||||
<stop
|
||||
style="stop-color:#e09900;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3604" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
r="25.501276"
|
||||
fy="131.40274"
|
||||
fx="324.32715"
|
||||
cy="131.40274"
|
||||
cx="324.32715"
|
||||
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient5574"
|
||||
xlink:href="#linearGradient3600"
|
||||
inkscape:collect="always" />
|
||||
<inkscape:perspective
|
||||
id="perspective5663"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3600-7"
|
||||
id="radialGradient3606-8"
|
||||
cx="324.32715"
|
||||
cy="131.40274"
|
||||
fx="324.32715"
|
||||
fy="131.40274"
|
||||
r="25.501276"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)" />
|
||||
<linearGradient
|
||||
id="linearGradient3600-7">
|
||||
<stop
|
||||
style="stop-color:#ffc13d;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3602-7" />
|
||||
<stop
|
||||
style="stop-color:#e09900;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3604-6" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5189-1"
|
||||
id="linearGradient5394"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="385.03503"
|
||||
y1="180.09546"
|
||||
x2="462.48297"
|
||||
y2="180.09546"
|
||||
gradientTransform="matrix(0.96839241,0,0,0.96839241,-360.365,847.52359)" />
|
||||
<linearGradient
|
||||
id="linearGradient5189-1">
|
||||
<stop
|
||||
style="stop-color:#000ec9;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5191-0" />
|
||||
<stop
|
||||
style="stop-color:#000657;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop5193-4" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5173-1"
|
||||
id="linearGradient5581"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="167.33386"
|
||||
y1="178.83276"
|
||||
x2="244.78181"
|
||||
y2="178.83276"
|
||||
gradientTransform="matrix(0.96839241,0,0,0.96839241,-149.54484,848.74636)" />
|
||||
<linearGradient
|
||||
id="linearGradient5173-1">
|
||||
<stop
|
||||
style="stop-color:#ff2700;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5175-5" />
|
||||
<stop
|
||||
style="stop-color:#ff2700;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop5177-3" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
y2="178.83276"
|
||||
x2="244.78181"
|
||||
y1="178.83276"
|
||||
x1="167.33386"
|
||||
gradientTransform="matrix(0.96839241,0,0,0.96839241,-52.401983,877.75333)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient5598"
|
||||
xlink:href="#linearGradient5173-1"
|
||||
inkscape:collect="always" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
inkscape:document-units="mm"
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="1.979899"
|
||||
inkscape:cx="-59.166471"
|
||||
inkscape:cy="4.9508223"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1440"
|
||||
inkscape:window-height="792"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1" />
|
||||
<metadata
|
||||
id="metadata4">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-952.36218)">
|
||||
<path
|
||||
style="fill:#8d5fd3;fill-opacity:1;stroke:black;stroke-width:2.78220296;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="M 49.84375 1.71875 C 36.719738 1.71875 26.0625 12.375988 26.0625 25.5 C 26.0625 32.977454 29.538325 39.612734 34.9375 43.96875 C 24.439951 49.943698 17.919149 62.196126 14.3125 75.65625 C 9.0380874 95.34065 30.224013 98.21875 49.84375 98.21875 C 69.463486 98.21875 90.549327 94.96715 85.375 75.65625 C 81.693381 61.916246 75.224585 49.827177 64.8125 43.9375 C 70.181573 39.580662 73.59375 32.953205 73.59375 25.5 C 73.59375 12.375988 62.967762 1.71875 49.84375 1.71875 z "
|
||||
id="path3597-8"
|
||||
transform="translate(0,952.36218)" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 9.2 KiB |
137
cockatrice/resources/userlevels/registered_donator_buddy.svg
Normal file
@@ -0,0 +1,137 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
viewBox="0 0 64 64"
|
||||
enable-background="new 0 0 64 64"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.91 r13725"
|
||||
width="100%"
|
||||
height="100%"
|
||||
sodipodi:docname="vip_buddy.svg">
|
||||
<metadata
|
||||
id="metadata12">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs10">
|
||||
<linearGradient
|
||||
id="linearGradient3766">
|
||||
<stop
|
||||
style="stop-color:#ff2700;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3768" />
|
||||
<stop
|
||||
style="stop-color:#820000;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3770" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient5225">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5227" />
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop5229" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient5219"
|
||||
osb:paint="solid">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5221" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3758">
|
||||
<stop
|
||||
id="stop3760"
|
||||
offset="0"
|
||||
style="stop-color:#0fbb00;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3762"
|
||||
offset="1"
|
||||
style="stop-color:#064400;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3750">
|
||||
<stop
|
||||
style="stop-color:#ece400;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3752" />
|
||||
<stop
|
||||
style="stop-color:#ece400;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop3754" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3758-7"
|
||||
id="linearGradient3756-1"
|
||||
x1="1.960216"
|
||||
y1="31.261461"
|
||||
x2="60.456024"
|
||||
y2="31.261461"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
id="linearGradient3758-7">
|
||||
<stop
|
||||
id="stop3760-4"
|
||||
offset="0"
|
||||
style="stop-color:#ece400;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3762-0"
|
||||
offset="1"
|
||||
style="stop-color:#ec8b00;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1440"
|
||||
inkscape:window-height="792"
|
||||
id="namedview8"
|
||||
showgrid="false"
|
||||
inkscape:zoom="5.2149125"
|
||||
inkscape:cx="14.509163"
|
||||
inkscape:cy="51.245759"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg2" />
|
||||
<path
|
||||
d="M 61.442826,23.621762 38.532402,23.515555 31.556101,0.331013 24.578789,23.515555 1.6673502,23.621765 20.267785,38.422001 10.863888,63.668987 31.556101,47.626631 52.258426,63.668987 42.843404,38.422001 z"
|
||||
id="path4-9"
|
||||
style="fill:#000000;fill-opacity:1"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
d="M 57.150089,25.064396 37.504323,24.973324 31.522122,5.092503 25.539054,24.973324 5.8924192,25.064399 21.842354,37.75565 13.778482,59.405024 31.522122,45.64865 49.274434,59.405024 41.201022,37.75565 z"
|
||||
id="path4"
|
||||
style="fill:#8d5fd3;fill-opacity:1;fill-rule:nonzero"
|
||||
inkscape:connector-curvature="0" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.1 KiB |
344
cockatrice/resources/userlevels/registered_vip.svg
Normal file
@@ -0,0 +1,344 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="100"
|
||||
height="100"
|
||||
id="svg5322"
|
||||
version="1.1"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="registered_vip.svg">
|
||||
<defs
|
||||
id="defs3">
|
||||
<linearGradient
|
||||
id="linearGradient5181-9-1">
|
||||
<stop
|
||||
id="stop4188"
|
||||
offset="0"
|
||||
style="stop-color:#ece400;stop-opacity:1" />
|
||||
<stop
|
||||
id="stop4190"
|
||||
offset="1"
|
||||
style="stop-color:#ec8b00;stop-opacity:1" />
|
||||
</linearGradient>
|
||||
<inkscape:perspective
|
||||
sodipodi:type="inkscape:persp3d"
|
||||
inkscape:vp_x="0 : 526.18109 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_z="744.09448 : 526.18109 : 1"
|
||||
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
|
||||
id="perspective5328" />
|
||||
<inkscape:perspective
|
||||
id="perspective5305"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<linearGradient
|
||||
id="linearGradient5181">
|
||||
<stop
|
||||
style="stop-color:#0fbb00;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5183" />
|
||||
<stop
|
||||
style="stop-color:#064400;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop5185" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3600-2"
|
||||
id="radialGradient3606-7"
|
||||
cx="324.32715"
|
||||
cy="131.40274"
|
||||
fx="324.32715"
|
||||
fy="131.40274"
|
||||
r="25.501276"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)" />
|
||||
<linearGradient
|
||||
id="linearGradient3600-2">
|
||||
<stop
|
||||
style="stop-color:#ffc33d;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3602-4" />
|
||||
<stop
|
||||
style="stop-color:#e09900;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3604-9" />
|
||||
</linearGradient>
|
||||
<inkscape:perspective
|
||||
id="perspective5478"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<linearGradient
|
||||
id="linearGradient5189">
|
||||
<stop
|
||||
style="stop-color:#000ec9;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5191" />
|
||||
<stop
|
||||
style="stop-color:#000657;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop5193" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3600-4"
|
||||
id="radialGradient3606-1"
|
||||
cx="324.32715"
|
||||
cy="131.40274"
|
||||
fx="324.32715"
|
||||
fy="131.40274"
|
||||
r="25.501276"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)" />
|
||||
<linearGradient
|
||||
id="linearGradient3600-4">
|
||||
<stop
|
||||
style="stop-color:#ffc33d;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3602-3" />
|
||||
<stop
|
||||
style="stop-color:#e09900;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3604-5" />
|
||||
</linearGradient>
|
||||
<inkscape:perspective
|
||||
id="perspective5559"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5173"
|
||||
id="linearGradient5179"
|
||||
x1="167.33386"
|
||||
y1="178.83276"
|
||||
x2="244.78181"
|
||||
y2="178.83276"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
id="linearGradient5173">
|
||||
<stop
|
||||
style="stop-color:#f50000;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5175" />
|
||||
<stop
|
||||
style="stop-color:#950000;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop5177" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3600"
|
||||
id="radialGradient5169"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)"
|
||||
cx="324.32715"
|
||||
cy="131.40274"
|
||||
fx="324.32715"
|
||||
fy="131.40274"
|
||||
r="25.501276" />
|
||||
<linearGradient
|
||||
id="linearGradient3600">
|
||||
<stop
|
||||
style="stop-color:#ffc13d;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3602" />
|
||||
<stop
|
||||
style="stop-color:#e09900;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3604" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
r="25.501276"
|
||||
fy="131.40274"
|
||||
fx="324.32715"
|
||||
cy="131.40274"
|
||||
cx="324.32715"
|
||||
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient5574"
|
||||
xlink:href="#linearGradient3600"
|
||||
inkscape:collect="always" />
|
||||
<inkscape:perspective
|
||||
id="perspective5663"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3600-7"
|
||||
id="radialGradient3606-8"
|
||||
cx="324.32715"
|
||||
cy="131.40274"
|
||||
fx="324.32715"
|
||||
fy="131.40274"
|
||||
r="25.501276"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)" />
|
||||
<linearGradient
|
||||
id="linearGradient3600-7">
|
||||
<stop
|
||||
style="stop-color:#ffc13d;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3602-7" />
|
||||
<stop
|
||||
style="stop-color:#e09900;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3604-6" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3600-7"
|
||||
id="radialGradient5254"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.92332021,0.38403097,-0.41592401,1.0000002,78.192026,-120.05314)"
|
||||
cx="324.32715"
|
||||
cy="131.40274"
|
||||
fx="324.32715"
|
||||
fy="131.40274"
|
||||
r="25.501276" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5189-1"
|
||||
id="linearGradient5394"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="385.03503"
|
||||
y1="180.09546"
|
||||
x2="462.48297"
|
||||
y2="180.09546"
|
||||
gradientTransform="matrix(0.96839241,0,0,0.96839241,-360.365,847.52359)" />
|
||||
<linearGradient
|
||||
id="linearGradient5189-1">
|
||||
<stop
|
||||
style="stop-color:#000ec9;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5191-0" />
|
||||
<stop
|
||||
style="stop-color:#000657;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop5193-4" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5181-9-1"
|
||||
id="linearGradient5436"
|
||||
x1="47.268291"
|
||||
y1="933.14362"
|
||||
x2="48.665382"
|
||||
y2="1050.2666"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(0,-952.36218)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5173-1"
|
||||
id="linearGradient5581"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="167.33386"
|
||||
y1="178.83276"
|
||||
x2="244.78181"
|
||||
y2="178.83276"
|
||||
gradientTransform="matrix(0.96839241,0,0,0.96839241,-149.54484,848.74636)" />
|
||||
<linearGradient
|
||||
id="linearGradient5173-1">
|
||||
<stop
|
||||
style="stop-color:#f50000;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5175-5" />
|
||||
<stop
|
||||
style="stop-color:#950000;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop5177-3" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5181-9"
|
||||
id="linearGradient5782"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="282.50455"
|
||||
y1="181.61069"
|
||||
x2="359.95248"
|
||||
y2="181.61069"
|
||||
gradientTransform="matrix(0.96839241,0,0,0.96839241,-261.07526,846.05625)" />
|
||||
<linearGradient
|
||||
id="linearGradient5181-9">
|
||||
<stop
|
||||
style="stop-color:#80d600;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5183-3" />
|
||||
<stop
|
||||
style="stop-color:#80d600;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop5185-0" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
y2="181.61069"
|
||||
x2="359.95248"
|
||||
y1="181.61069"
|
||||
x1="282.50455"
|
||||
gradientTransform="matrix(0.96839241,0,0,0.96839241,-175.71812,893.2775)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient5799"
|
||||
xlink:href="#linearGradient5181-9"
|
||||
inkscape:collect="always" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
inkscape:document-units="mm"
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="4.2946338"
|
||||
inkscape:cx="35.27742"
|
||||
inkscape:cy="65.175571"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1152"
|
||||
inkscape:window-height="811"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1" />
|
||||
<metadata
|
||||
id="metadata4">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-952.36218)">
|
||||
<path
|
||||
style="fill:url(#linearGradient5436);fill-opacity:1;stroke:black;stroke-width:2.78149606;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="M 49.84375 1.71875 C 36.719738 1.71875 26.0625 12.375988 26.0625 25.5 C 26.0625 32.977454 29.538325 39.612734 34.9375 43.96875 C 24.439951 49.943698 17.919149 62.196126 14.3125 75.65625 C 9.0380874 95.34065 30.224013 98.21875 49.84375 98.21875 C 69.463486 98.21875 90.549327 94.96715 85.375 75.65625 C 81.693381 61.916246 75.224585 49.827177 64.8125 43.9375 C 70.181573 39.580662 73.59375 32.953205 73.59375 25.5 C 73.59375 12.375988 62.967762 1.71875 49.84375 1.71875 z "
|
||||
transform="translate(0,952.36218)"
|
||||
id="path3597-8" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 11 KiB |
127
cockatrice/resources/userlevels/registered_vip_buddy.svg
Normal file
@@ -0,0 +1,127 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
viewBox="0 0 64 64"
|
||||
enable-background="new 0 0 64 64"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.91 r13725"
|
||||
width="100%"
|
||||
height="100%"
|
||||
sodipodi:docname="registered_vip_buddy.svg">
|
||||
<metadata
|
||||
id="metadata12">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs10">
|
||||
<linearGradient
|
||||
id="linearGradient4153">
|
||||
<stop
|
||||
style="stop-color:#ffec79;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop4155" />
|
||||
<stop
|
||||
style="stop-color:#f2c15b;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop4157" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3758">
|
||||
<stop
|
||||
id="stop3760"
|
||||
offset="0"
|
||||
style="stop-color:#80d600;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3762"
|
||||
offset="1"
|
||||
style="stop-color:#80d600;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3750">
|
||||
<stop
|
||||
style="stop-color:#ece400;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3752" />
|
||||
<stop
|
||||
style="stop-color:#ece400;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop3754" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3758-7"
|
||||
id="linearGradient3756"
|
||||
x1="31.290251"
|
||||
y1="-19.003599"
|
||||
x2="31.135509"
|
||||
y2="67.496323"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.87626222,0,0,0.87626222,4.174756,4.8555263)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3758-7"
|
||||
id="linearGradient3756-1"
|
||||
x1="1.960216"
|
||||
y1="31.261461"
|
||||
x2="60.456024"
|
||||
y2="31.261461"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
id="linearGradient3758-7">
|
||||
<stop
|
||||
id="stop3760-4"
|
||||
offset="0"
|
||||
style="stop-color:#ece400;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3762-0"
|
||||
offset="1"
|
||||
style="stop-color:#ec8b00;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1152"
|
||||
inkscape:window-height="811"
|
||||
id="namedview8"
|
||||
showgrid="false"
|
||||
inkscape:zoom="7.375"
|
||||
inkscape:cx="29.258475"
|
||||
inkscape:cy="35.341768"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg2" />
|
||||
<path
|
||||
d="M 61.442826,23.621762 38.532402,23.515555 31.556101,0.331013 24.578789,23.515555 1.6673502,23.621765 20.267785,38.422001 10.863888,63.668987 31.556101,47.626631 52.258426,63.668987 42.843404,38.422001 z"
|
||||
id="path4-9"
|
||||
style="fill:#000000;fill-opacity:1"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
d="M 57.150089,25.064396 37.504323,24.973324 31.522122,5.092503 25.539054,24.973324 5.8924192,25.064399 21.842354,37.75565 13.778482,59.405024 31.522122,45.64865 49.274434,59.405024 41.201022,37.75565 z"
|
||||
id="path4"
|
||||
style="fill:url(#linearGradient3756);fill-opacity:1"
|
||||
inkscape:connector-curvature="0" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.9 KiB |
@@ -9,7 +9,7 @@ SET(defsounds
|
||||
|
||||
if(UNIX)
|
||||
if(APPLE)
|
||||
INSTALL(DIRECTORY ${defsounds} DESTINATION cockatrice.app/Contents/Resources/sounds/)
|
||||
INSTALL(DIRECTORY ${defsounds} DESTINATION Cockatrice.app/Contents/Resources/sounds/)
|
||||
else()
|
||||
# Assume linux
|
||||
INSTALL(DIRECTORY ${defsounds} DESTINATION share/cockatrice/sounds/)
|
||||
@@ -1,15 +1,17 @@
|
||||
#include "abstractcarddragitem.h"
|
||||
#include "carddatabase.h"
|
||||
#include <QCursor>
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
#include <QDebug>
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
#include <QPainter>
|
||||
|
||||
static const float CARD_WIDTH_HALF = CARD_WIDTH / 2;
|
||||
static const float CARD_HEIGHT_HALF = CARD_HEIGHT / 2;
|
||||
const QColor GHOST_MASK = QColor(255, 255, 255, 50);
|
||||
|
||||
AbstractCardDragItem::AbstractCardDragItem(AbstractCardItem *_item, const QPointF &_hotSpot, AbstractCardDragItem *parentDrag)
|
||||
AbstractCardDragItem::AbstractCardDragItem(AbstractCardItem *_item,
|
||||
const QPointF &_hotSpot,
|
||||
AbstractCardDragItem *parentDrag)
|
||||
: QGraphicsItem(), item(_item), hotSpot(_hotSpot)
|
||||
{
|
||||
if (parentDrag) {
|
||||
@@ -27,7 +29,10 @@ AbstractCardDragItem::AbstractCardDragItem(AbstractCardItem *_item, const QPoint
|
||||
setZValue(2000000007);
|
||||
}
|
||||
if (item->getTapped())
|
||||
setTransform(QTransform().translate(CARD_WIDTH_HALF, CARD_HEIGHT_HALF).rotate(90).translate(-CARD_WIDTH_HALF, -CARD_HEIGHT_HALF));
|
||||
setTransform(QTransform()
|
||||
.translate(CARD_WIDTH_HALF, CARD_HEIGHT_HALF)
|
||||
.rotate(90)
|
||||
.translate(-CARD_WIDTH_HALF, -CARD_HEIGHT_HALF));
|
||||
|
||||
setCacheMode(DeviceCoordinateCache);
|
||||
}
|
||||
|
||||
@@ -7,24 +7,42 @@ class QGraphicsScene;
|
||||
class CardZone;
|
||||
class CardInfo;
|
||||
|
||||
class AbstractCardDragItem : public QObject, public QGraphicsItem {
|
||||
class AbstractCardDragItem : public QObject, public QGraphicsItem
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QGraphicsItem)
|
||||
protected:
|
||||
AbstractCardItem *item;
|
||||
QPointF hotSpot;
|
||||
QList<AbstractCardDragItem *> childDrags;
|
||||
|
||||
public:
|
||||
enum { Type = typeCardDrag };
|
||||
int type() const { return Type; }
|
||||
enum
|
||||
{
|
||||
Type = typeCardDrag
|
||||
};
|
||||
int type() const
|
||||
{
|
||||
return Type;
|
||||
}
|
||||
AbstractCardDragItem(AbstractCardItem *_item, const QPointF &_hotSpot, AbstractCardDragItem *parentDrag = 0);
|
||||
~AbstractCardDragItem();
|
||||
QRectF boundingRect() const { return QRectF(0, 0, CARD_WIDTH, CARD_HEIGHT); }
|
||||
QRectF boundingRect() const
|
||||
{
|
||||
return QRectF(0, 0, CARD_WIDTH, CARD_HEIGHT);
|
||||
}
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
AbstractCardItem *getItem() const { return item; }
|
||||
QPointF getHotSpot() const { return hotSpot; }
|
||||
AbstractCardItem *getItem() const
|
||||
{
|
||||
return item;
|
||||
}
|
||||
QPointF getHotSpot() const
|
||||
{
|
||||
return hotSpot;
|
||||
}
|
||||
void addChildDrag(AbstractCardDragItem *child);
|
||||
virtual void updatePosition(const QPointF &cursorScenePos) = 0;
|
||||
|
||||
protected:
|
||||
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
|
||||
};
|
||||
|
||||
@@ -1,28 +1,27 @@
|
||||
#include <QPainter>
|
||||
#include <QGraphicsScene>
|
||||
#include <QCursor>
|
||||
#include <QGraphicsScene>
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
#include <QPainter>
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#ifdef _WIN32
|
||||
#include "round.h"
|
||||
#endif /* _WIN32 */
|
||||
#include "carddatabase.h"
|
||||
#include "cardinfowidget.h"
|
||||
#include "abstractcarditem.h"
|
||||
#include "carddatabase.h"
|
||||
#include "gamescene.h"
|
||||
#include "main.h"
|
||||
#include "pictureloader.h"
|
||||
#include "settingscache.h"
|
||||
#include "main.h"
|
||||
#include "gamescene.h"
|
||||
#include <QDebug>
|
||||
|
||||
AbstractCardItem::AbstractCardItem(const QString &_name, Player *_owner, int _id, QGraphicsItem *parent)
|
||||
: ArrowTarget(_owner, parent), infoWidget(0), id(_id), name(_name), tapped(false), facedown(false), tapAngle(0), isHovered(false), realZValue(0)
|
||||
: ArrowTarget(_owner, parent), id(_id), name(_name), tapped(false), facedown(false), tapAngle(0),
|
||||
bgColor(Qt::transparent), isHovered(false), realZValue(0)
|
||||
{
|
||||
setCursor(Qt::OpenHandCursor);
|
||||
setFlag(ItemIsSelectable);
|
||||
setCacheMode(DeviceCoordinateCache);
|
||||
|
||||
connect(db, SIGNAL(cardListChanged()), this, SLOT(cardInfoUpdated()));
|
||||
|
||||
connect(settingsCache, SIGNAL(displayCardNamesChanged()), this, SLOT(callUpdate()));
|
||||
cardInfoUpdated();
|
||||
}
|
||||
@@ -46,7 +45,11 @@ void AbstractCardItem::pixmapUpdated()
|
||||
void AbstractCardItem::cardInfoUpdated()
|
||||
{
|
||||
info = db->getCard(name);
|
||||
connect(info, SIGNAL(pixmapUpdated()), this, SLOT(pixmapUpdated()));
|
||||
if (info)
|
||||
connect(info.data(), SIGNAL(pixmapUpdated()), this, SLOT(pixmapUpdated()));
|
||||
|
||||
cacheBgColor();
|
||||
update();
|
||||
}
|
||||
|
||||
void AbstractCardItem::setRealZValue(qreal _zValue)
|
||||
@@ -57,18 +60,19 @@ void AbstractCardItem::setRealZValue(qreal _zValue)
|
||||
|
||||
QSizeF AbstractCardItem::getTranslatedSize(QPainter *painter) const
|
||||
{
|
||||
return QSizeF(
|
||||
painter->combinedTransform().map(QLineF(0, 0, boundingRect().width(), 0)).length(),
|
||||
painter->combinedTransform().map(QLineF(0, 0, 0, boundingRect().height())).length()
|
||||
);
|
||||
return QSizeF(painter->combinedTransform().map(QLineF(0, 0, boundingRect().width(), 0)).length(),
|
||||
painter->combinedTransform().map(QLineF(0, 0, 0, boundingRect().height())).length());
|
||||
}
|
||||
|
||||
void AbstractCardItem::transformPainter(QPainter *painter, const QSizeF &translatedSize, int angle)
|
||||
{
|
||||
const int MAX_FONT_SIZE = settingsCache->getMaxFontSize();
|
||||
const int fontSize = std::max(9, MAX_FONT_SIZE);
|
||||
|
||||
QRectF totalBoundingRect = painter->combinedTransform().mapRect(boundingRect());
|
||||
|
||||
|
||||
painter->resetTransform();
|
||||
|
||||
|
||||
QTransform pixmapTransform;
|
||||
pixmapTransform.translate(totalBoundingRect.width() / 2, totalBoundingRect.height() / 2);
|
||||
pixmapTransform.rotate(angle);
|
||||
@@ -76,11 +80,6 @@ void AbstractCardItem::transformPainter(QPainter *painter, const QSizeF &transla
|
||||
painter->setTransform(pixmapTransform);
|
||||
|
||||
QFont f;
|
||||
int fontSize = round(translatedSize.height() / 8);
|
||||
if (fontSize < 9)
|
||||
fontSize = 9;
|
||||
if (fontSize > 10)
|
||||
fontSize = 10;
|
||||
f.setPixelSize(fontSize);
|
||||
|
||||
painter->setFont(f);
|
||||
@@ -89,45 +88,33 @@ void AbstractCardItem::transformPainter(QPainter *painter, const QSizeF &transla
|
||||
void AbstractCardItem::paintPicture(QPainter *painter, const QSizeF &translatedSize, int angle)
|
||||
{
|
||||
qreal scaleFactor = translatedSize.width() / boundingRect().width();
|
||||
|
||||
CardInfo *imageSource = facedown ? db->getCard() : info;
|
||||
QPixmap translatedPixmap;
|
||||
// don't even spend time trying to load the picture if our size is too small
|
||||
if(translatedSize.width() > 10)
|
||||
PictureLoader::getPixmap(translatedPixmap, imageSource, translatedSize.toSize());
|
||||
bool paintImage = true;
|
||||
|
||||
if (facedown || name.isEmpty()) {
|
||||
// never reveal card color, always paint the card back
|
||||
PictureLoader::getCardBackPixmap(translatedPixmap, translatedSize.toSize());
|
||||
} else {
|
||||
// don't even spend time trying to load the picture if our size is too small
|
||||
if (translatedSize.width() > 10) {
|
||||
PictureLoader::getPixmap(translatedPixmap, info, translatedSize.toSize());
|
||||
if (translatedPixmap.isNull())
|
||||
paintImage = false;
|
||||
} else {
|
||||
paintImage = false;
|
||||
}
|
||||
}
|
||||
|
||||
painter->save();
|
||||
QColor bgColor = Qt::transparent;
|
||||
if (translatedPixmap.isNull()) {
|
||||
QString colorStr;
|
||||
if (!color.isEmpty())
|
||||
colorStr = color;
|
||||
else if (info->getColors().size() > 1)
|
||||
colorStr = "m";
|
||||
else if (!info->getColors().isEmpty())
|
||||
colorStr = info->getColors().first().toLower();
|
||||
|
||||
if (colorStr == "b")
|
||||
bgColor = QColor(0, 0, 0);
|
||||
else if (colorStr == "u")
|
||||
bgColor = QColor(0, 140, 180);
|
||||
else if (colorStr == "w")
|
||||
bgColor = QColor(255, 250, 140);
|
||||
else if (colorStr == "r")
|
||||
bgColor = QColor(230, 0, 0);
|
||||
else if (colorStr == "g")
|
||||
bgColor = QColor(0, 160, 0);
|
||||
else if (colorStr == "m")
|
||||
bgColor = QColor(250, 190, 30);
|
||||
else
|
||||
bgColor = QColor(230, 230, 230);
|
||||
} else {
|
||||
|
||||
if (paintImage) {
|
||||
painter->save();
|
||||
transformPainter(painter, translatedSize, angle);
|
||||
painter->drawPixmap(QPointF(1, 1), translatedPixmap);
|
||||
painter->restore();
|
||||
} else {
|
||||
painter->setBrush(bgColor);
|
||||
}
|
||||
painter->setBrush(bgColor);
|
||||
|
||||
QPen pen(Qt::black);
|
||||
pen.setJoinStyle(Qt::MiterJoin);
|
||||
@@ -139,7 +126,7 @@ void AbstractCardItem::paintPicture(QPainter *painter, const QSizeF &translatedS
|
||||
painter->drawRect(QRectF(0, 0, CARD_WIDTH - 1, CARD_HEIGHT - penWidth));
|
||||
else
|
||||
painter->drawRect(QRectF(1, 1, CARD_WIDTH - 2, CARD_HEIGHT - 1.5));
|
||||
|
||||
|
||||
if (translatedPixmap.isNull() || settingsCache->getDisplayCardNames() || facedown) {
|
||||
painter->save();
|
||||
transformPainter(painter, translatedSize, angle);
|
||||
@@ -151,10 +138,12 @@ void AbstractCardItem::paintPicture(QPainter *painter, const QSizeF &translatedS
|
||||
nameStr = "# " + QString::number(id);
|
||||
else
|
||||
nameStr = name;
|
||||
painter->drawText(QRectF(3 * scaleFactor, 3 * scaleFactor, translatedSize.width() - 6 * scaleFactor, translatedSize.height() - 6 * scaleFactor), Qt::AlignTop | Qt::AlignLeft | Qt::TextWrapAnywhere, nameStr);
|
||||
painter->drawText(QRectF(3 * scaleFactor, 3 * scaleFactor, translatedSize.width() - 6 * scaleFactor,
|
||||
translatedSize.height() - 6 * scaleFactor),
|
||||
Qt::AlignTop | Qt::AlignLeft | Qt::TextWrapAnywhere, nameStr);
|
||||
painter->restore();
|
||||
}
|
||||
|
||||
|
||||
painter->restore();
|
||||
}
|
||||
|
||||
@@ -164,7 +153,7 @@ void AbstractCardItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *
|
||||
|
||||
QSizeF translatedSize = getTranslatedSize(painter);
|
||||
paintPicture(painter, translatedSize, tapAngle);
|
||||
|
||||
|
||||
painter->save();
|
||||
painter->setRenderHint(QPainter::Antialiasing, false);
|
||||
transformPainter(painter, translatedSize, tapAngle);
|
||||
@@ -190,20 +179,20 @@ void AbstractCardItem::setName(const QString &_name)
|
||||
{
|
||||
if (name == _name)
|
||||
return;
|
||||
|
||||
|
||||
emit deleteCardInfoPopup(name);
|
||||
disconnect(info, 0, this, 0);
|
||||
if (info)
|
||||
disconnect(info.data(), nullptr, this, nullptr);
|
||||
name = _name;
|
||||
info = db->getCard(name);
|
||||
connect(info, SIGNAL(pixmapUpdated()), this, SLOT(pixmapUpdated()));
|
||||
update();
|
||||
|
||||
cardInfoUpdated();
|
||||
}
|
||||
|
||||
void AbstractCardItem::setHovered(bool _hovered)
|
||||
{
|
||||
if (isHovered == _hovered)
|
||||
return;
|
||||
|
||||
|
||||
if (_hovered)
|
||||
processHoverEvent();
|
||||
isHovered = _hovered;
|
||||
@@ -216,20 +205,59 @@ void AbstractCardItem::setHovered(bool _hovered)
|
||||
void AbstractCardItem::setColor(const QString &_color)
|
||||
{
|
||||
color = _color;
|
||||
cacheBgColor();
|
||||
update();
|
||||
}
|
||||
|
||||
void AbstractCardItem::cacheBgColor()
|
||||
{
|
||||
QChar colorChar;
|
||||
if (color.isEmpty()) {
|
||||
if (info)
|
||||
colorChar = info->getColorChar();
|
||||
} else {
|
||||
colorChar = color.at(0);
|
||||
}
|
||||
|
||||
switch (colorChar.toLower().toLatin1()) {
|
||||
case 'b':
|
||||
bgColor = QColor(0, 0, 0);
|
||||
break;
|
||||
case 'u':
|
||||
bgColor = QColor(0, 140, 180);
|
||||
break;
|
||||
case 'w':
|
||||
bgColor = QColor(255, 250, 140);
|
||||
break;
|
||||
case 'r':
|
||||
bgColor = QColor(230, 0, 0);
|
||||
break;
|
||||
case 'g':
|
||||
bgColor = QColor(0, 160, 0);
|
||||
break;
|
||||
case 'm':
|
||||
bgColor = QColor(250, 190, 30);
|
||||
break;
|
||||
default:
|
||||
bgColor = QColor(230, 230, 230);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void AbstractCardItem::setTapped(bool _tapped, bool canAnimate)
|
||||
{
|
||||
if (tapped == _tapped)
|
||||
return;
|
||||
|
||||
|
||||
tapped = _tapped;
|
||||
if (settingsCache->getTapAnimation() && canAnimate)
|
||||
static_cast<GameScene *>(scene())->registerAnimationItem(this);
|
||||
else {
|
||||
tapAngle = tapped ? 90 : 0;
|
||||
setTransform(QTransform().translate((float) CARD_WIDTH / 2, (float) CARD_HEIGHT / 2).rotate(tapAngle).translate((float) -CARD_WIDTH / 2, (float) -CARD_HEIGHT / 2));
|
||||
setTransform(QTransform()
|
||||
.translate((float)CARD_WIDTH / 2, (float)CARD_HEIGHT / 2)
|
||||
.rotate(tapAngle)
|
||||
.translate((float)-CARD_WIDTH / 2, (float)-CARD_HEIGHT / 2));
|
||||
update();
|
||||
}
|
||||
}
|
||||
@@ -243,10 +271,11 @@ void AbstractCardItem::setFaceDown(bool _facedown)
|
||||
|
||||
void AbstractCardItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if ((event->modifiers() & Qt::ControlModifier)) {
|
||||
if ((event->modifiers() & Qt::AltModifier) && event->button() == Qt::LeftButton) {
|
||||
emit cardShiftClicked(name);
|
||||
} else if ((event->modifiers() & Qt::ControlModifier)) {
|
||||
setSelected(!isSelected());
|
||||
}
|
||||
else if (!isSelected()) {
|
||||
} else if (!isSelected()) {
|
||||
scene()->clearSelection();
|
||||
setSelected(true);
|
||||
}
|
||||
@@ -261,7 +290,7 @@ void AbstractCardItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::MidButton)
|
||||
emit deleteCardInfoPopup(name);
|
||||
|
||||
|
||||
// This function ensures the parent function doesn't mess around with our selection.
|
||||
event->accept();
|
||||
}
|
||||
@@ -279,4 +308,3 @@ QVariant AbstractCardItem::itemChange(QGraphicsItem::GraphicsItemChange change,
|
||||
} else
|
||||
return QGraphicsItem::itemChange(change, value);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,69 +2,109 @@
|
||||
#define ABSTRACTCARDITEM_H
|
||||
|
||||
#include "arrowtarget.h"
|
||||
#include "carddatabase.h"
|
||||
|
||||
class CardInfo;
|
||||
class CardInfoWidget;
|
||||
class Player;
|
||||
class QTimer;
|
||||
|
||||
const int CARD_WIDTH = 72;
|
||||
const int CARD_HEIGHT = 102;
|
||||
|
||||
class AbstractCardItem : public ArrowTarget {
|
||||
class AbstractCardItem : public ArrowTarget
|
||||
{
|
||||
Q_OBJECT
|
||||
protected:
|
||||
CardInfo *info;
|
||||
CardInfoWidget *infoWidget;
|
||||
CardInfoPtr info;
|
||||
int id;
|
||||
QString name;
|
||||
bool tapped;
|
||||
bool facedown;
|
||||
int tapAngle;
|
||||
QString color;
|
||||
QColor bgColor;
|
||||
|
||||
private:
|
||||
bool isHovered;
|
||||
qreal realZValue;
|
||||
private slots:
|
||||
void pixmapUpdated();
|
||||
void cardInfoUpdated();
|
||||
void callUpdate() { update(); }
|
||||
void callUpdate()
|
||||
{
|
||||
update();
|
||||
}
|
||||
signals:
|
||||
void hovered(AbstractCardItem *card);
|
||||
void showCardInfoPopup(QPoint pos, QString cardName);
|
||||
void deleteCardInfoPopup(QString cardName);
|
||||
void updateCardMenu(AbstractCardItem *card);
|
||||
void sigPixmapUpdated();
|
||||
void cardShiftClicked(QString cardName);
|
||||
|
||||
public:
|
||||
enum { Type = typeCard };
|
||||
int type() const { return Type; }
|
||||
enum
|
||||
{
|
||||
Type = typeCard
|
||||
};
|
||||
int type() const
|
||||
{
|
||||
return Type;
|
||||
}
|
||||
AbstractCardItem(const QString &_name = QString(), Player *_owner = 0, int _id = -1, QGraphicsItem *parent = 0);
|
||||
~AbstractCardItem();
|
||||
QRectF boundingRect() const;
|
||||
QSizeF getTranslatedSize(QPainter *painter) const;
|
||||
void paintPicture(QPainter *painter, const QSizeF &translatedSize, int angle);
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
CardInfo *getInfo() const { return info; }
|
||||
int getId() const { return id; }
|
||||
void setId(int _id) { id = _id; }
|
||||
QString getName() const { return name; }
|
||||
CardInfoPtr getInfo() const
|
||||
{
|
||||
return info;
|
||||
}
|
||||
int getId() const
|
||||
{
|
||||
return id;
|
||||
}
|
||||
void setId(int _id)
|
||||
{
|
||||
id = _id;
|
||||
}
|
||||
QString getName() const
|
||||
{
|
||||
return name;
|
||||
}
|
||||
void setName(const QString &_name = QString());
|
||||
qreal getRealZValue() const { return realZValue; }
|
||||
qreal getRealZValue() const
|
||||
{
|
||||
return realZValue;
|
||||
}
|
||||
void setRealZValue(qreal _zValue);
|
||||
void setHovered(bool _hovered);
|
||||
QString getColor() const { return color; }
|
||||
QString getColor() const
|
||||
{
|
||||
return color;
|
||||
}
|
||||
void setColor(const QString &_color);
|
||||
bool getTapped() const { return tapped; }
|
||||
bool getTapped() const
|
||||
{
|
||||
return tapped;
|
||||
}
|
||||
void setTapped(bool _tapped, bool canAnimate = false);
|
||||
bool getFaceDown() const { return facedown; }
|
||||
bool getFaceDown() const
|
||||
{
|
||||
return facedown;
|
||||
}
|
||||
void setFaceDown(bool _facedown);
|
||||
void processHoverEvent();
|
||||
void deleteCardInfoPopup() { emit deleteCardInfoPopup(name); }
|
||||
void deleteCardInfoPopup()
|
||||
{
|
||||
emit deleteCardInfoPopup(name);
|
||||
}
|
||||
|
||||
protected:
|
||||
void transformPainter(QPainter *painter, const QSizeF &translatedSize, int angle);
|
||||
void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
||||
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
|
||||
QVariant itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value);
|
||||
void cacheBgColor();
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,28 +1,27 @@
|
||||
#include "abstractclient.h"
|
||||
|
||||
#include "pending_command.h"
|
||||
#include "client_metatypes.h"
|
||||
#include "featureset.h"
|
||||
#include "get_pb_extension.h"
|
||||
#include "pb/commands.pb.h"
|
||||
#include "pb/server_message.pb.h"
|
||||
#include "pb/event_add_to_list.pb.h"
|
||||
#include "pb/event_connection_closed.pb.h"
|
||||
#include "pb/event_game_joined.pb.h"
|
||||
#include "pb/event_list_rooms.pb.h"
|
||||
#include "pb/event_notify_user.pb.h"
|
||||
#include "pb/event_remove_from_list.pb.h"
|
||||
#include "pb/event_replay_added.pb.h"
|
||||
#include "pb/event_server_identification.pb.h"
|
||||
#include "pb/event_server_message.pb.h"
|
||||
#include "pb/event_server_shutdown.pb.h"
|
||||
#include "pb/event_connection_closed.pb.h"
|
||||
#include "pb/event_user_message.pb.h"
|
||||
#include "pb/event_notify_user.pb.h"
|
||||
#include "pb/event_list_rooms.pb.h"
|
||||
#include "pb/event_add_to_list.pb.h"
|
||||
#include "pb/event_remove_from_list.pb.h"
|
||||
#include "pb/event_user_joined.pb.h"
|
||||
#include "pb/event_user_left.pb.h"
|
||||
#include "pb/event_game_joined.pb.h"
|
||||
#include "pb/event_replay_added.pb.h"
|
||||
#include "get_pb_extension.h"
|
||||
#include "pb/event_user_message.pb.h"
|
||||
#include "pb/server_message.pb.h"
|
||||
#include "pending_command.h"
|
||||
#include <google/protobuf/descriptor.h>
|
||||
#include "client_metatypes.h"
|
||||
#include "featureset.h"
|
||||
|
||||
AbstractClient::AbstractClient(QObject *parent)
|
||||
: QObject(parent), nextCmdId(0), status(StatusDisconnected)
|
||||
AbstractClient::AbstractClient(QObject *parent) : QObject(parent), nextCmdId(0), status(StatusDisconnected)
|
||||
{
|
||||
qRegisterMetaType<QVariant>("QVariant");
|
||||
qRegisterMetaType<CommandContainer>("CommandContainer");
|
||||
@@ -44,13 +43,13 @@ AbstractClient::AbstractClient(QObject *parent)
|
||||
qRegisterMetaType<Event_UserMessage>("Event_UserMessage");
|
||||
qRegisterMetaType<Event_NotifyUser>("Event_NotifyUser");
|
||||
qRegisterMetaType<ServerInfo_User>("ServerInfo_User");
|
||||
qRegisterMetaType<QList<ServerInfo_User> >("QList<ServerInfo_User>");
|
||||
qRegisterMetaType<QList<ServerInfo_User>>("QList<ServerInfo_User>");
|
||||
qRegisterMetaType<Event_ReplayAdded>("Event_ReplayAdded");
|
||||
qRegisterMetaType<QList<QString> >("missingFeatures");
|
||||
qRegisterMetaType<QList<QString>>("missingFeatures");
|
||||
|
||||
FeatureSet features;
|
||||
features.initalizeFeatureList(clientFeatures);
|
||||
|
||||
|
||||
connect(this, SIGNAL(sigQueuePendingCommand(PendingCommand *)), this, SLOT(queuePendingCommand(PendingCommand *)));
|
||||
}
|
||||
|
||||
@@ -64,33 +63,60 @@ void AbstractClient::processProtocolItem(const ServerMessage &item)
|
||||
case ServerMessage::RESPONSE: {
|
||||
const Response &response = item.response();
|
||||
const int cmdId = response.cmd_id();
|
||||
|
||||
|
||||
PendingCommand *pend = pendingCommands.value(cmdId, 0);
|
||||
if (!pend)
|
||||
return;
|
||||
pendingCommands.remove(cmdId);
|
||||
|
||||
|
||||
pend->processResponse(response);
|
||||
pend->deleteLater();
|
||||
break;
|
||||
}
|
||||
case ServerMessage::SESSION_EVENT: {
|
||||
const SessionEvent &event = item.session_event();
|
||||
switch ((SessionEvent::SessionEventType) getPbExtension(event)) {
|
||||
case SessionEvent::SERVER_IDENTIFICATION: emit serverIdentificationEventReceived(event.GetExtension(Event_ServerIdentification::ext)); break;
|
||||
case SessionEvent::SERVER_MESSAGE: emit serverMessageEventReceived(event.GetExtension(Event_ServerMessage::ext)); break;
|
||||
case SessionEvent::SERVER_SHUTDOWN: emit serverShutdownEventReceived(event.GetExtension(Event_ServerShutdown::ext)); break;
|
||||
case SessionEvent::CONNECTION_CLOSED: emit connectionClosedEventReceived(event.GetExtension(Event_ConnectionClosed::ext)); break;
|
||||
case SessionEvent::USER_MESSAGE: emit userMessageEventReceived(event.GetExtension(Event_UserMessage::ext)); break;
|
||||
case SessionEvent::NOTIFY_USER: emit notifyUserEventReceived(event.GetExtension(Event_NotifyUser::ext)); break;
|
||||
case SessionEvent::LIST_ROOMS: emit listRoomsEventReceived(event.GetExtension(Event_ListRooms::ext)); break;
|
||||
case SessionEvent::ADD_TO_LIST: emit addToListEventReceived(event.GetExtension(Event_AddToList::ext)); break;
|
||||
case SessionEvent::REMOVE_FROM_LIST: emit removeFromListEventReceived(event.GetExtension(Event_RemoveFromList::ext)); break;
|
||||
case SessionEvent::USER_JOINED: emit userJoinedEventReceived(event.GetExtension(Event_UserJoined::ext)); break;
|
||||
case SessionEvent::USER_LEFT: emit userLeftEventReceived(event.GetExtension(Event_UserLeft::ext)); break;
|
||||
case SessionEvent::GAME_JOINED: emit gameJoinedEventReceived(event.GetExtension(Event_GameJoined::ext)); break;
|
||||
case SessionEvent::REPLAY_ADDED: emit replayAddedEventReceived(event.GetExtension(Event_ReplayAdded::ext)); break;
|
||||
default: break;
|
||||
switch ((SessionEvent::SessionEventType)getPbExtension(event)) {
|
||||
case SessionEvent::SERVER_IDENTIFICATION:
|
||||
emit serverIdentificationEventReceived(event.GetExtension(Event_ServerIdentification::ext));
|
||||
break;
|
||||
case SessionEvent::SERVER_MESSAGE:
|
||||
emit serverMessageEventReceived(event.GetExtension(Event_ServerMessage::ext));
|
||||
break;
|
||||
case SessionEvent::SERVER_SHUTDOWN:
|
||||
emit serverShutdownEventReceived(event.GetExtension(Event_ServerShutdown::ext));
|
||||
break;
|
||||
case SessionEvent::CONNECTION_CLOSED:
|
||||
emit connectionClosedEventReceived(event.GetExtension(Event_ConnectionClosed::ext));
|
||||
break;
|
||||
case SessionEvent::USER_MESSAGE:
|
||||
emit userMessageEventReceived(event.GetExtension(Event_UserMessage::ext));
|
||||
break;
|
||||
case SessionEvent::NOTIFY_USER:
|
||||
emit notifyUserEventReceived(event.GetExtension(Event_NotifyUser::ext));
|
||||
break;
|
||||
case SessionEvent::LIST_ROOMS:
|
||||
emit listRoomsEventReceived(event.GetExtension(Event_ListRooms::ext));
|
||||
break;
|
||||
case SessionEvent::ADD_TO_LIST:
|
||||
emit addToListEventReceived(event.GetExtension(Event_AddToList::ext));
|
||||
break;
|
||||
case SessionEvent::REMOVE_FROM_LIST:
|
||||
emit removeFromListEventReceived(event.GetExtension(Event_RemoveFromList::ext));
|
||||
break;
|
||||
case SessionEvent::USER_JOINED:
|
||||
emit userJoinedEventReceived(event.GetExtension(Event_UserJoined::ext));
|
||||
break;
|
||||
case SessionEvent::USER_LEFT:
|
||||
emit userLeftEventReceived(event.GetExtension(Event_UserLeft::ext));
|
||||
break;
|
||||
case SessionEvent::GAME_JOINED:
|
||||
emit gameJoinedEventReceived(event.GetExtension(Event_GameJoined::ext));
|
||||
break;
|
||||
case SessionEvent::REPLAY_ADDED:
|
||||
emit replayAddedEventReceived(event.GetExtension(Event_ReplayAdded::ext));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -130,9 +156,9 @@ void AbstractClient::queuePendingCommand(PendingCommand *pend)
|
||||
// This function is always called from the client thread via signal/slot.
|
||||
const int cmdId = getNewCmdId();
|
||||
pend->getCommandContainer().set_cmd_id(cmdId);
|
||||
|
||||
|
||||
pendingCommands.insert(cmdId, pend);
|
||||
|
||||
|
||||
sendCommandContainer(pend->getCommandContainer());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#ifndef ABSTRACTCLIENT_H
|
||||
#define ABSTRACTCLIENT_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QVariant>
|
||||
#include <QMutex>
|
||||
#include "pb/response.pb.h"
|
||||
#include "pb/serverinfo_user.pb.h"
|
||||
#include <QMutex>
|
||||
#include <QObject>
|
||||
#include <QVariant>
|
||||
|
||||
class PendingCommand;
|
||||
class CommandContainer;
|
||||
@@ -27,7 +27,8 @@ class Event_ServerShutdown;
|
||||
class Event_ReplayAdded;
|
||||
class FeatureSet;
|
||||
|
||||
enum ClientStatus {
|
||||
enum ClientStatus
|
||||
{
|
||||
StatusDisconnected,
|
||||
StatusDisconnecting,
|
||||
StatusConnecting,
|
||||
@@ -35,13 +36,17 @@ enum ClientStatus {
|
||||
StatusActivating,
|
||||
StatusLoggingIn,
|
||||
StatusLoggedIn,
|
||||
StatusRequestingForgotPassword,
|
||||
StatusSubmitForgotPasswordReset,
|
||||
StatusSubmitForgotPasswordChallenge,
|
||||
};
|
||||
|
||||
class AbstractClient : public QObject {
|
||||
class AbstractClient : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
signals:
|
||||
void statusChanged(ClientStatus _status);
|
||||
|
||||
|
||||
// Room events
|
||||
void roomEventReceived(const RoomEvent &event);
|
||||
// Game events
|
||||
@@ -66,8 +71,9 @@ signals:
|
||||
void registerAccepted();
|
||||
void registerAcceptedNeedsActivate();
|
||||
void activateAccepted();
|
||||
|
||||
|
||||
void sigQueuePendingCommand(PendingCommand *pend);
|
||||
|
||||
private:
|
||||
int nextCmdId;
|
||||
mutable QMutex clientMutex;
|
||||
@@ -76,23 +82,35 @@ private slots:
|
||||
void queuePendingCommand(PendingCommand *pend);
|
||||
protected slots:
|
||||
void processProtocolItem(const ServerMessage &item);
|
||||
|
||||
protected:
|
||||
QMap<int, PendingCommand *> pendingCommands;
|
||||
QString userName, password, email, country, realName, token;
|
||||
int gender;
|
||||
void setStatus(ClientStatus _status);
|
||||
int getNewCmdId() { return nextCmdId++; }
|
||||
int getNewCmdId()
|
||||
{
|
||||
return nextCmdId++;
|
||||
}
|
||||
virtual void sendCommandContainer(const CommandContainer &cont) = 0;
|
||||
|
||||
public:
|
||||
AbstractClient(QObject *parent = 0);
|
||||
~AbstractClient();
|
||||
|
||||
ClientStatus getStatus() const { QMutexLocker locker(&clientMutex); return status; }
|
||||
|
||||
ClientStatus getStatus() const
|
||||
{
|
||||
QMutexLocker locker(&clientMutex);
|
||||
return status;
|
||||
}
|
||||
void sendCommand(const CommandContainer &cont);
|
||||
void sendCommand(PendingCommand *pend);
|
||||
|
||||
const QString getUserName() {return userName;}
|
||||
|
||||
const QString getUserName()
|
||||
{
|
||||
return userName;
|
||||
}
|
||||
|
||||
static PendingCommand *prepareSessionCommand(const ::google::protobuf::Message &cmd);
|
||||
static PendingCommand *prepareRoomCommand(const ::google::protobuf::Message &cmd, int roomId);
|
||||
static PendingCommand *prepareModeratorCommand(const ::google::protobuf::Message &cmd);
|
||||
|
||||
@@ -1,22 +1,26 @@
|
||||
#include "abstractcounter.h"
|
||||
#include "player.h"
|
||||
#include "settingscache.h"
|
||||
#include <QPainter>
|
||||
#include <QMenu>
|
||||
#include <QAction>
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
#include <QGraphicsSceneHoverEvent>
|
||||
#include "pb/command_inc_counter.pb.h"
|
||||
#include "pb/command_set_counter.pb.h"
|
||||
#include "player.h"
|
||||
#include "settingscache.h"
|
||||
#include <QAction>
|
||||
#include <QGraphicsSceneHoverEvent>
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
#include <QMenu>
|
||||
#include <QPainter>
|
||||
|
||||
AbstractCounter::AbstractCounter(Player *_player, int _id, const QString &_name, bool _shownInCounterArea, int _value, QGraphicsItem *parent)
|
||||
: QGraphicsItem(parent), player(_player), id(_id), name(_name), value(_value), hovered(false), aDec(0), aInc(0), dialogSemaphore(false), deleteAfterDialog(false), shownInCounterArea(_shownInCounterArea)
|
||||
AbstractCounter::AbstractCounter(Player *_player,
|
||||
int _id,
|
||||
const QString &_name,
|
||||
bool _shownInCounterArea,
|
||||
int _value,
|
||||
bool _useNameForShortcut,
|
||||
QGraphicsItem *parent)
|
||||
: QGraphicsItem(parent), player(_player), id(_id), name(_name), value(_value),
|
||||
useNameForShortcut(_useNameForShortcut), hovered(false), aDec(0), aInc(0), dialogSemaphore(false),
|
||||
deleteAfterDialog(false), shownInCounterArea(_shownInCounterArea)
|
||||
{
|
||||
#if QT_VERSION < 0x050000
|
||||
setAcceptsHoverEvents(true);
|
||||
#else
|
||||
setAcceptHoverEvents(true);
|
||||
#endif
|
||||
|
||||
shortcutActive = false;
|
||||
|
||||
@@ -27,9 +31,9 @@ AbstractCounter::AbstractCounter(Player *_player, int _id, const QString &_name,
|
||||
menu->addAction(aSet);
|
||||
menu->addSeparator();
|
||||
for (int i = 10; i >= -10; --i)
|
||||
if (i == 0)
|
||||
if (i == 0) {
|
||||
menu->addSeparator();
|
||||
else {
|
||||
} else {
|
||||
QAction *aIncrement = new QAction(QString(i < 0 ? "%1" : "+%1").arg(i), this);
|
||||
if (i == -1)
|
||||
aDec = aIncrement;
|
||||
@@ -40,9 +44,9 @@ AbstractCounter::AbstractCounter(Player *_player, int _id, const QString &_name,
|
||||
menu->addAction(aIncrement);
|
||||
}
|
||||
} else
|
||||
menu = 0;
|
||||
|
||||
connect(&settingsCache->shortcuts(), SIGNAL(shortCutchanged()),this,SLOT(refreshShortcuts()));
|
||||
menu = nullptr;
|
||||
|
||||
connect(&settingsCache->shortcuts(), SIGNAL(shortCutchanged()), this, SLOT(refreshShortcuts()));
|
||||
refreshShortcuts();
|
||||
retranslateUi();
|
||||
}
|
||||
@@ -69,18 +73,26 @@ void AbstractCounter::retranslateUi()
|
||||
|
||||
void AbstractCounter::setShortcutsActive()
|
||||
{
|
||||
if (!player->getLocal()) {
|
||||
return;
|
||||
}
|
||||
if (name == "life") {
|
||||
shortcutActive = true;
|
||||
aSet->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aSet"));
|
||||
aDec->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aDec"));
|
||||
aInc->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aInc"));
|
||||
} else if (useNameForShortcut) {
|
||||
shortcutActive = true;
|
||||
aSet->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aSetCounter_" + name));
|
||||
aDec->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aDecCounter_" + name));
|
||||
aInc->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aIncCounter_" + name));
|
||||
}
|
||||
}
|
||||
|
||||
void AbstractCounter::setShortcutsInactive()
|
||||
{
|
||||
shortcutActive = false;
|
||||
if (name == "life") {
|
||||
if (name == "life" || useNameForShortcut) {
|
||||
aSet->setShortcut(QKeySequence());
|
||||
aDec->setShortcut(QKeySequence());
|
||||
aInc->setShortcut(QKeySequence());
|
||||
@@ -89,7 +101,7 @@ void AbstractCounter::setShortcutsInactive()
|
||||
|
||||
void AbstractCounter::refreshShortcuts()
|
||||
{
|
||||
if(shortcutActive)
|
||||
if (shortcutActive)
|
||||
setShortcutsActive();
|
||||
}
|
||||
|
||||
@@ -101,7 +113,7 @@ void AbstractCounter::setValue(int _value)
|
||||
|
||||
void AbstractCounter::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (isUnderMouse()) {
|
||||
if (isUnderMouse() && player->getLocal()) {
|
||||
if (event->button() == Qt::LeftButton) {
|
||||
Command_IncCounter cmd;
|
||||
cmd.set_counter_id(id);
|
||||
@@ -118,8 +130,8 @@ void AbstractCounter::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||
if (menu)
|
||||
menu->exec(event->screenPos());
|
||||
event->accept();
|
||||
}
|
||||
}else
|
||||
}
|
||||
} else
|
||||
event->ignore();
|
||||
}
|
||||
|
||||
@@ -148,13 +160,8 @@ void AbstractCounter::setCounter()
|
||||
{
|
||||
bool ok;
|
||||
dialogSemaphore = true;
|
||||
int newValue =
|
||||
#if QT_VERSION < 0x050000
|
||||
QInputDialog::getInteger(
|
||||
#else
|
||||
QInputDialog::getInt(
|
||||
#endif
|
||||
0, tr("Set counter"), tr("New value for counter '%1':").arg(name), value, -2000000000, 2000000000, 1, &ok);
|
||||
int newValue = QInputDialog::getInt(0, tr("Set counter"), tr("New value for counter '%1':").arg(name), value,
|
||||
-2000000000, 2000000000, 1, &ok);
|
||||
if (deleteAfterDialog) {
|
||||
deleteLater();
|
||||
return;
|
||||
@@ -162,7 +169,7 @@ void AbstractCounter::setCounter()
|
||||
dialogSemaphore = false;
|
||||
if (!ok)
|
||||
return;
|
||||
|
||||
|
||||
Command_SetCounter cmd;
|
||||
cmd.set_counter_id(id);
|
||||
cmd.set_value(newValue);
|
||||
|
||||
@@ -7,7 +7,8 @@ class Player;
|
||||
class QMenu;
|
||||
class QAction;
|
||||
|
||||
class AbstractCounter : public QObject, public QGraphicsItem {
|
||||
class AbstractCounter : public QObject, public QGraphicsItem
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QGraphicsItem)
|
||||
protected:
|
||||
@@ -15,11 +16,12 @@ protected:
|
||||
int id;
|
||||
QString name;
|
||||
int value;
|
||||
bool hovered;
|
||||
|
||||
bool useNameForShortcut, hovered;
|
||||
|
||||
void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
||||
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
|
||||
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
|
||||
|
||||
private:
|
||||
QAction *aSet, *aDec, *aInc;
|
||||
QMenu *menu;
|
||||
@@ -29,20 +31,42 @@ private slots:
|
||||
void refreshShortcuts();
|
||||
void incrementCounter();
|
||||
void setCounter();
|
||||
|
||||
public:
|
||||
AbstractCounter(Player *_player, int _id, const QString &_name, bool _shownInCounterArea, int _value, QGraphicsItem *parent = 0);
|
||||
AbstractCounter(Player *_player,
|
||||
int _id,
|
||||
const QString &_name,
|
||||
bool _shownInCounterArea,
|
||||
int _value,
|
||||
bool _useNameForShortcut = false,
|
||||
QGraphicsItem *parent = 0);
|
||||
~AbstractCounter();
|
||||
|
||||
QMenu *getMenu() const { return menu; }
|
||||
|
||||
QMenu *getMenu() const
|
||||
{
|
||||
return menu;
|
||||
}
|
||||
void retranslateUi();
|
||||
|
||||
int getId() const { return id; }
|
||||
QString getName() const { return name; }
|
||||
bool getShownInCounterArea() const { return shownInCounterArea; }
|
||||
int getValue() const { return value; }
|
||||
|
||||
int getId() const
|
||||
{
|
||||
return id;
|
||||
}
|
||||
QString getName() const
|
||||
{
|
||||
return name;
|
||||
}
|
||||
bool getShownInCounterArea() const
|
||||
{
|
||||
return shownInCounterArea;
|
||||
}
|
||||
int getValue() const
|
||||
{
|
||||
return value;
|
||||
}
|
||||
void setValue(int _value);
|
||||
void delCounter();
|
||||
|
||||
|
||||
void setShortcutsActive();
|
||||
void setShortcutsInactive();
|
||||
bool shortcutActive;
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
#include "abstractgraphicsitem.h"
|
||||
#include <QPainter>
|
||||
|
||||
void AbstractGraphicsItem::paintNumberEllipse(int number, int fontSize, const QColor &color, int position, int count, QPainter *painter)
|
||||
void AbstractGraphicsItem::paintNumberEllipse(int number,
|
||||
int fontSize,
|
||||
const QColor &color,
|
||||
int position,
|
||||
int count,
|
||||
QPainter *painter)
|
||||
{
|
||||
painter->save();
|
||||
|
||||
@@ -9,7 +14,7 @@ void AbstractGraphicsItem::paintNumberEllipse(int number, int fontSize, const QC
|
||||
QFont font("Serif");
|
||||
font.setPixelSize(fontSize);
|
||||
font.setWeight(QFont::Bold);
|
||||
|
||||
|
||||
QFontMetrics fm(font);
|
||||
double w = fm.width(numStr) * 1.3;
|
||||
double h = fm.height() * 1.3;
|
||||
@@ -18,7 +23,7 @@ void AbstractGraphicsItem::paintNumberEllipse(int number, int fontSize, const QC
|
||||
|
||||
painter->setPen(QColor(255, 255, 255, 0));
|
||||
painter->setBrush(QBrush(QColor(color)));
|
||||
|
||||
|
||||
QRectF textRect;
|
||||
if (position == -1)
|
||||
textRect = QRectF((boundingRect().width() - w) / 2.0, (boundingRect().height() - h) / 2.0, w, h);
|
||||
@@ -27,11 +32,15 @@ void AbstractGraphicsItem::paintNumberEllipse(int number, int fontSize, const QC
|
||||
qreal yOffset = 20;
|
||||
qreal spacing = 2;
|
||||
if (position < 2)
|
||||
textRect = QRectF(count == 1 ? ((boundingRect().width() - w) / 2.0) : (position % 2 == 0 ? xOffset : (boundingRect().width() - xOffset - w)), yOffset, w, h);
|
||||
textRect = QRectF(count == 1 ? ((boundingRect().width() - w) / 2.0)
|
||||
: (position % 2 == 0 ? xOffset : (boundingRect().width() - xOffset - w)),
|
||||
yOffset, w, h);
|
||||
else
|
||||
textRect = QRectF(count == 3 ? ((boundingRect().width() - w) / 2.0) : (position % 2 == 0 ? xOffset : (boundingRect().width() - xOffset - w)), yOffset + (spacing + h) * (position / 2), w, h);
|
||||
textRect = QRectF(count == 3 ? ((boundingRect().width() - w) / 2.0)
|
||||
: (position % 2 == 0 ? xOffset : (boundingRect().width() - xOffset - w)),
|
||||
yOffset + (spacing + h) * (position / 2), w, h);
|
||||
}
|
||||
|
||||
|
||||
painter->drawEllipse(textRect);
|
||||
|
||||
painter->setPen(Qt::black);
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
|
||||
#include <QGraphicsItem>
|
||||
|
||||
enum GraphicsItemType {
|
||||
enum GraphicsItemType
|
||||
{
|
||||
typeCard = QGraphicsItem::UserType + 1,
|
||||
typeCardDrag = QGraphicsItem::UserType + 2,
|
||||
typeZone = QGraphicsItem::UserType + 3,
|
||||
@@ -12,13 +13,17 @@ enum GraphicsItemType {
|
||||
typeOther = QGraphicsItem::UserType + 6
|
||||
};
|
||||
|
||||
class AbstractGraphicsItem : public QObject, public QGraphicsItem {
|
||||
class AbstractGraphicsItem : public QObject, public QGraphicsItem
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QGraphicsItem)
|
||||
protected:
|
||||
void paintNumberEllipse(int number, int radius, const QColor &color, int position, int count, QPainter *painter);
|
||||
|
||||
public:
|
||||
AbstractGraphicsItem(QGraphicsItem *parent = 0) : QObject(), QGraphicsItem(parent) { }
|
||||
AbstractGraphicsItem(QGraphicsItem *parent = 0) : QObject(), QGraphicsItem(parent)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
#include <cmath>
|
||||
|
||||
#include "arrowitem.h"
|
||||
#include "playertarget.h"
|
||||
#include "carditem.h"
|
||||
#include "carddatabase.h"
|
||||
#include "carditem.h"
|
||||
#include "cardzone.h"
|
||||
#include "player.h"
|
||||
#include "playertarget.h"
|
||||
#include "settingscache.h"
|
||||
#include <QPainter>
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
#include <QGraphicsScene>
|
||||
#include <QDebug>
|
||||
#include <QGraphicsScene>
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
#include <QPainter>
|
||||
|
||||
#include "color.h"
|
||||
#include "pb/command_attach_card.pb.h"
|
||||
@@ -19,7 +19,8 @@
|
||||
#include "pb/command_delete_arrow.pb.h"
|
||||
|
||||
ArrowItem::ArrowItem(Player *_player, int _id, ArrowTarget *_startItem, ArrowTarget *_targetItem, const QColor &_color)
|
||||
: QGraphicsItem(), player(_player), id(_id), startItem(_startItem), targetItem(_targetItem), color(_color), fullColor(true)
|
||||
: QGraphicsItem(), player(_player), id(_id), startItem(_startItem), targetItem(_targetItem), color(_color),
|
||||
fullColor(true)
|
||||
{
|
||||
qDebug() << "ArrowItem constructor: startItem=" << static_cast<QGraphicsItem *>(startItem);
|
||||
setZValue(2000000005);
|
||||
@@ -60,7 +61,8 @@ void ArrowItem::updatePath()
|
||||
if (!targetItem)
|
||||
return;
|
||||
|
||||
QPointF endPoint = targetItem->mapToScene(QPointF(targetItem->boundingRect().width() / 2, targetItem->boundingRect().height() / 2));
|
||||
QPointF endPoint = targetItem->mapToScene(
|
||||
QPointF(targetItem->boundingRect().width() / 2, targetItem->boundingRect().height() / 2));
|
||||
updatePath(endPoint);
|
||||
}
|
||||
|
||||
@@ -68,13 +70,15 @@ void ArrowItem::updatePath(const QPointF &endPoint)
|
||||
{
|
||||
const double arrowWidth = 15.0;
|
||||
const double headWidth = 40.0;
|
||||
const double headLength = headWidth / pow(2, 0.5); // aka headWidth / sqrt (2) but this produces a compile error with MSVC++
|
||||
const double headLength =
|
||||
headWidth / pow(2, 0.5); // aka headWidth / sqrt (2) but this produces a compile error with MSVC++
|
||||
const double phi = 15;
|
||||
|
||||
if (!startItem)
|
||||
return;
|
||||
|
||||
QPointF startPoint = startItem->mapToScene(QPointF(startItem->boundingRect().width() / 2, startItem->boundingRect().height() / 2));
|
||||
QPointF startPoint =
|
||||
startItem->mapToScene(QPointF(startItem->boundingRect().width() / 2, startItem->boundingRect().height() / 2));
|
||||
QLineF line(startPoint, endPoint);
|
||||
qreal lineLength = line.length();
|
||||
|
||||
@@ -92,10 +96,14 @@ void ArrowItem::updatePath(const QPointF &endPoint)
|
||||
QPointF arrowBodyEndPoint = centerLine.pointAtPercent(percentage);
|
||||
QLineF testLine(arrowBodyEndPoint, centerLine.pointAtPercent(percentage + 0.001));
|
||||
qreal alpha = testLine.angle() - 90;
|
||||
QPointF endPoint1 = arrowBodyEndPoint + arrowWidth / 2 * QPointF(cos(alpha * M_PI / 180), -sin(alpha * M_PI / 180));
|
||||
QPointF endPoint2 = arrowBodyEndPoint + arrowWidth / 2 * QPointF(-cos(alpha * M_PI / 180), sin(alpha * M_PI / 180));
|
||||
QPointF point1 = endPoint1 + (headWidth - arrowWidth) / 2 * QPointF(cos(alpha * M_PI / 180), -sin(alpha * M_PI / 180));
|
||||
QPointF point2 = endPoint2 + (headWidth - arrowWidth) / 2 * QPointF(-cos(alpha * M_PI / 180), sin(alpha * M_PI / 180));
|
||||
QPointF endPoint1 =
|
||||
arrowBodyEndPoint + arrowWidth / 2 * QPointF(cos(alpha * M_PI / 180), -sin(alpha * M_PI / 180));
|
||||
QPointF endPoint2 =
|
||||
arrowBodyEndPoint + arrowWidth / 2 * QPointF(-cos(alpha * M_PI / 180), sin(alpha * M_PI / 180));
|
||||
QPointF point1 =
|
||||
endPoint1 + (headWidth - arrowWidth) / 2 * QPointF(cos(alpha * M_PI / 180), -sin(alpha * M_PI / 180));
|
||||
QPointF point2 =
|
||||
endPoint2 + (headWidth - arrowWidth) / 2 * QPointF(-cos(alpha * M_PI / 180), sin(alpha * M_PI / 180));
|
||||
|
||||
path = QPainterPath(-arrowWidth / 2 * QPointF(cos((phi - 90) * M_PI / 180), sin((phi - 90) * M_PI / 180)));
|
||||
path.quadTo(c, endPoint1);
|
||||
@@ -130,18 +138,19 @@ void ArrowItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||
}
|
||||
|
||||
QList<QGraphicsItem *> colliding = scene()->items(event->scenePos());
|
||||
for (int i = 0; i < colliding.size(); ++i)
|
||||
for (int i = 0; i < colliding.size(); ++i) {
|
||||
if (qgraphicsitem_cast<CardItem *>(colliding[i])) {
|
||||
event->ignore();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
event->accept();
|
||||
if (event->button() == Qt::RightButton) {
|
||||
Command_DeleteArrow cmd;
|
||||
cmd.set_arrow_id(id);
|
||||
player->sendGameCommand(cmd);
|
||||
}
|
||||
event->accept();
|
||||
if (event->button() == Qt::RightButton) {
|
||||
Command_DeleteArrow cmd;
|
||||
cmd.set_arrow_id(id);
|
||||
player->sendGameCommand(cmd);
|
||||
}
|
||||
}
|
||||
|
||||
ArrowDragItem::ArrowDragItem(Player *_owner, ArrowTarget *_startItem, const QColor &_color)
|
||||
@@ -166,35 +175,39 @@ void ArrowDragItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||
QList<QGraphicsItem *> colliding = scene()->items(endPos);
|
||||
ArrowTarget *cursorItem = 0;
|
||||
qreal cursorItemZ = -1;
|
||||
for (int i = colliding.size() - 1; i >= 0; i--)
|
||||
if (qgraphicsitem_cast<PlayerTarget *>(colliding.at(i)) || qgraphicsitem_cast<CardItem *>(colliding.at(i)))
|
||||
for (int i = colliding.size() - 1; i >= 0; i--) {
|
||||
if (qgraphicsitem_cast<PlayerTarget *>(colliding.at(i)) || qgraphicsitem_cast<CardItem *>(colliding.at(i))) {
|
||||
if (colliding.at(i)->zValue() > cursorItemZ) {
|
||||
cursorItem = static_cast<ArrowTarget *>(colliding.at(i));
|
||||
cursorItemZ = cursorItem->zValue();
|
||||
}
|
||||
if ((cursorItem != targetItem) && targetItem) {
|
||||
targetItem->setBeingPointedAt(false);
|
||||
targetItem->removeArrowTo(this);
|
||||
}
|
||||
if (!cursorItem) {
|
||||
fullColor = false;
|
||||
targetItem = 0;
|
||||
updatePath(endPos);
|
||||
} else {
|
||||
if (cursorItem != targetItem) {
|
||||
fullColor = true;
|
||||
if (cursorItem != startItem) {
|
||||
cursorItem->setBeingPointedAt(true);
|
||||
cursorItem->addArrowTo(this);
|
||||
}
|
||||
targetItem = cursorItem;
|
||||
}
|
||||
updatePath();
|
||||
}
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < childArrows.size(); ++i)
|
||||
childArrows[i]->mouseMoveEvent(event);
|
||||
if ((cursorItem != targetItem) && targetItem) {
|
||||
targetItem->setBeingPointedAt(false);
|
||||
targetItem->removeArrowTo(this);
|
||||
}
|
||||
if (!cursorItem) {
|
||||
fullColor = false;
|
||||
targetItem = 0;
|
||||
updatePath(endPos);
|
||||
} else {
|
||||
if (cursorItem != targetItem) {
|
||||
fullColor = true;
|
||||
if (cursorItem != startItem) {
|
||||
cursorItem->setBeingPointedAt(true);
|
||||
cursorItem->addArrowTo(this);
|
||||
}
|
||||
targetItem = cursorItem;
|
||||
}
|
||||
updatePath();
|
||||
}
|
||||
update();
|
||||
|
||||
for (int i = 0; i < childArrows.size(); ++i) {
|
||||
childArrows[i]->mouseMoveEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
void ArrowDragItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
@@ -224,15 +237,15 @@ void ArrowDragItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
PlayerTarget *targetPlayer = qgraphicsitem_cast<PlayerTarget *>(targetItem);
|
||||
cmd.set_target_player_id(targetPlayer->getOwner()->getId());
|
||||
}
|
||||
if (startZone->getName().compare("hand") == 0) {
|
||||
if (startZone->getName().compare("hand") == 0) {
|
||||
startCard->playCard(false);
|
||||
CardInfo *ci = startCard->getInfo();
|
||||
if (((!settingsCache->getPlayToStack() && ci->getTableRow() == 3) ||
|
||||
((settingsCache->getPlayToStack() && ci->getTableRow() != 0) &&
|
||||
startCard->getZone()->getName().toStdString() != "stack")))
|
||||
CardInfoPtr ci = startCard->getInfo();
|
||||
if (ci && (((!settingsCache->getPlayToStack() && ci->getTableRow() == 3) ||
|
||||
((settingsCache->getPlayToStack() && ci->getTableRow() != 0) &&
|
||||
startCard->getZone()->getName().toStdString() != "stack"))))
|
||||
cmd.set_start_zone("stack");
|
||||
else
|
||||
cmd.set_start_zone(settingsCache->getPlayToStack() ? "stack" :"table");
|
||||
cmd.set_start_zone(settingsCache->getPlayToStack() ? "stack" : "table");
|
||||
}
|
||||
player->sendGameCommand(cmd);
|
||||
}
|
||||
@@ -257,27 +270,31 @@ void ArrowAttachItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||
QList<QGraphicsItem *> colliding = scene()->items(endPos);
|
||||
ArrowTarget *cursorItem = 0;
|
||||
qreal cursorItemZ = -1;
|
||||
for (int i = colliding.size() - 1; i >= 0; i--)
|
||||
if (qgraphicsitem_cast<CardItem *>(colliding.at(i)))
|
||||
for (int i = colliding.size() - 1; i >= 0; i--) {
|
||||
if (qgraphicsitem_cast<CardItem *>(colliding.at(i))) {
|
||||
if (colliding.at(i)->zValue() > cursorItemZ) {
|
||||
cursorItem = static_cast<ArrowTarget *>(colliding.at(i));
|
||||
cursorItemZ = cursorItem->zValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((cursorItem != targetItem) && targetItem)
|
||||
targetItem->setBeingPointedAt(false);
|
||||
if (!cursorItem) {
|
||||
fullColor = false;
|
||||
targetItem = 0;
|
||||
updatePath(endPos);
|
||||
} else {
|
||||
fullColor = true;
|
||||
if (cursorItem != startItem)
|
||||
cursorItem->setBeingPointedAt(true);
|
||||
targetItem = cursorItem;
|
||||
updatePath();
|
||||
}
|
||||
update();
|
||||
if ((cursorItem != targetItem) && targetItem) {
|
||||
targetItem->setBeingPointedAt(false);
|
||||
}
|
||||
if (!cursorItem) {
|
||||
fullColor = false;
|
||||
targetItem = 0;
|
||||
updatePath(endPos);
|
||||
} else {
|
||||
fullColor = true;
|
||||
if (cursorItem != startItem) {
|
||||
cursorItem->setBeingPointedAt(true);
|
||||
}
|
||||
targetItem = cursorItem;
|
||||
updatePath();
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
void ArrowAttachItem::mouseReleaseEvent(QGraphicsSceneMouseEvent * /*event*/)
|
||||
|
||||
@@ -9,12 +9,14 @@ class QMenu;
|
||||
class Player;
|
||||
class ArrowTarget;
|
||||
|
||||
class ArrowItem : public QObject, public QGraphicsItem {
|
||||
class ArrowItem : public QObject, public QGraphicsItem
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QGraphicsItem)
|
||||
private:
|
||||
QPainterPath path;
|
||||
QMenu *menu;
|
||||
|
||||
protected:
|
||||
Player *player;
|
||||
int id;
|
||||
@@ -22,40 +24,70 @@ protected:
|
||||
QColor color;
|
||||
bool fullColor;
|
||||
void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
||||
|
||||
public:
|
||||
ArrowItem(Player *_player, int _id, ArrowTarget *_startItem, ArrowTarget *_targetItem, const QColor &color);
|
||||
~ArrowItem();
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
QRectF boundingRect() const { return path.boundingRect(); }
|
||||
QPainterPath shape() const { return path; }
|
||||
QRectF boundingRect() const
|
||||
{
|
||||
return path.boundingRect();
|
||||
}
|
||||
QPainterPath shape() const
|
||||
{
|
||||
return path;
|
||||
}
|
||||
void updatePath();
|
||||
void updatePath(const QPointF &endPoint);
|
||||
|
||||
int getId() const { return id; }
|
||||
Player *getPlayer() const { return player; }
|
||||
void setStartItem(ArrowTarget *_item) { startItem = _item; }
|
||||
void setTargetItem(ArrowTarget *_item) { targetItem = _item; }
|
||||
ArrowTarget *getStartItem() const { return startItem; }
|
||||
ArrowTarget *getTargetItem() const { return targetItem; }
|
||||
|
||||
int getId() const
|
||||
{
|
||||
return id;
|
||||
}
|
||||
Player *getPlayer() const
|
||||
{
|
||||
return player;
|
||||
}
|
||||
void setStartItem(ArrowTarget *_item)
|
||||
{
|
||||
startItem = _item;
|
||||
}
|
||||
void setTargetItem(ArrowTarget *_item)
|
||||
{
|
||||
targetItem = _item;
|
||||
}
|
||||
ArrowTarget *getStartItem() const
|
||||
{
|
||||
return startItem;
|
||||
}
|
||||
ArrowTarget *getTargetItem() const
|
||||
{
|
||||
return targetItem;
|
||||
}
|
||||
void delArrow();
|
||||
};
|
||||
|
||||
class ArrowDragItem : public ArrowItem {
|
||||
class ArrowDragItem : public ArrowItem
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
QList<ArrowDragItem *> childArrows;
|
||||
|
||||
public:
|
||||
ArrowDragItem(Player *_owner, ArrowTarget *_startItem, const QColor &_color);
|
||||
void addChildArrow(ArrowDragItem *childArrow);
|
||||
|
||||
protected:
|
||||
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
|
||||
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
|
||||
};
|
||||
|
||||
class ArrowAttachItem : public ArrowItem {
|
||||
class ArrowAttachItem : public ArrowItem
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ArrowAttachItem(ArrowTarget *_startItem);
|
||||
|
||||
protected:
|
||||
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
|
||||
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
|
||||
|
||||
@@ -7,29 +7,56 @@
|
||||
class Player;
|
||||
class ArrowItem;
|
||||
|
||||
class ArrowTarget : public AbstractGraphicsItem {
|
||||
class ArrowTarget : public AbstractGraphicsItem
|
||||
{
|
||||
Q_OBJECT
|
||||
protected:
|
||||
Player *owner;
|
||||
|
||||
private:
|
||||
bool beingPointedAt;
|
||||
QList<ArrowItem *> arrowsFrom, arrowsTo;
|
||||
|
||||
public:
|
||||
ArrowTarget(Player *_owner, QGraphicsItem *parent = 0);
|
||||
~ArrowTarget();
|
||||
|
||||
Player *getOwner() const { return owner; }
|
||||
|
||||
|
||||
Player *getOwner() const
|
||||
{
|
||||
return owner;
|
||||
}
|
||||
|
||||
void setBeingPointedAt(bool _beingPointedAt);
|
||||
bool getBeingPointedAt() const { return beingPointedAt; }
|
||||
|
||||
const QList<ArrowItem *> &getArrowsFrom() const { return arrowsFrom; }
|
||||
void addArrowFrom(ArrowItem *arrow) { arrowsFrom.append(arrow); }
|
||||
void removeArrowFrom(ArrowItem *arrow) { arrowsFrom.removeAt(arrowsFrom.indexOf(arrow)); }
|
||||
|
||||
const QList<ArrowItem *> &getArrowsTo() const { return arrowsTo; }
|
||||
void addArrowTo(ArrowItem *arrow) { arrowsTo.append(arrow); }
|
||||
void removeArrowTo(ArrowItem *arrow) { arrowsTo.removeAt(arrowsTo.indexOf(arrow)); }
|
||||
bool getBeingPointedAt() const
|
||||
{
|
||||
return beingPointedAt;
|
||||
}
|
||||
|
||||
const QList<ArrowItem *> &getArrowsFrom() const
|
||||
{
|
||||
return arrowsFrom;
|
||||
}
|
||||
void addArrowFrom(ArrowItem *arrow)
|
||||
{
|
||||
arrowsFrom.append(arrow);
|
||||
}
|
||||
void removeArrowFrom(ArrowItem *arrow)
|
||||
{
|
||||
arrowsFrom.removeAt(arrowsFrom.indexOf(arrow));
|
||||
}
|
||||
|
||||
const QList<ArrowItem *> &getArrowsTo() const
|
||||
{
|
||||
return arrowsTo;
|
||||
}
|
||||
void addArrowTo(ArrowItem *arrow)
|
||||
{
|
||||
arrowsTo.append(arrow);
|
||||
}
|
||||
void removeArrowTo(ArrowItem *arrow)
|
||||
{
|
||||
arrowsTo.removeAt(arrowsTo.indexOf(arrow));
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,52 +1,106 @@
|
||||
#ifndef CARDDATABASE_H
|
||||
#define CARDDATABASE_H
|
||||
|
||||
#include <QHash>
|
||||
#include <QPixmap>
|
||||
#include <QMap>
|
||||
#include <QBasicMutex>
|
||||
#include <QDate>
|
||||
#include <QDataStream>
|
||||
#include <QHash>
|
||||
#include <QList>
|
||||
#include <QXmlStreamReader>
|
||||
#include <QMap>
|
||||
#include <QMetaType>
|
||||
#include <QSharedPointer>
|
||||
#include <QStringList>
|
||||
#include <QVector>
|
||||
|
||||
class CardDatabase;
|
||||
class CardInfo;
|
||||
class CardSet;
|
||||
class CardRelation;
|
||||
class ICardDatabaseParser;
|
||||
|
||||
typedef QMap<QString, QString> QStringMap;
|
||||
|
||||
// If we don't typedef this, CardInfo::CardInfo will refuse to compile on OS X < 10.9
|
||||
typedef QMap<QString, int> MuidMap;
|
||||
typedef QSharedPointer<CardInfo> CardInfoPtr;
|
||||
typedef QSharedPointer<CardSet> CardSetPtr;
|
||||
|
||||
class CardSet : public QList<CardInfo *> {
|
||||
Q_DECLARE_METATYPE(CardInfoPtr)
|
||||
|
||||
class CardSet : public QList<CardInfoPtr>
|
||||
{
|
||||
private:
|
||||
QString shortName, longName;
|
||||
unsigned int sortKey;
|
||||
QDate releaseDate;
|
||||
QString setType;
|
||||
bool enabled, isknown;
|
||||
|
||||
public:
|
||||
CardSet(const QString &_shortName = QString(), const QString &_longName = QString(), const QString &_setType = QString(), const QDate &_releaseDate = QDate());
|
||||
explicit CardSet(const QString &_shortName = QString(),
|
||||
const QString &_longName = QString(),
|
||||
const QString &_setType = QString(),
|
||||
const QDate &_releaseDate = QDate());
|
||||
static CardSetPtr newInstance(const QString &_shortName = QString(),
|
||||
const QString &_longName = QString(),
|
||||
const QString &_setType = QString(),
|
||||
const QDate &_releaseDate = QDate());
|
||||
QString getCorrectedShortName() const;
|
||||
QString getShortName() const { return shortName; }
|
||||
QString getLongName() const { return longName; }
|
||||
QString getSetType() const { return setType; }
|
||||
QDate getReleaseDate() const { return releaseDate; }
|
||||
void setLongName(QString & _longName) { longName = _longName; }
|
||||
void setSetType(QString & _setType) { setType = _setType; }
|
||||
void setReleaseDate(QDate & _releaseDate) { releaseDate = _releaseDate; }
|
||||
QString getShortName() const
|
||||
{
|
||||
return shortName;
|
||||
}
|
||||
QString getLongName() const
|
||||
{
|
||||
return longName;
|
||||
}
|
||||
QString getSetType() const
|
||||
{
|
||||
return setType;
|
||||
}
|
||||
QDate getReleaseDate() const
|
||||
{
|
||||
return releaseDate;
|
||||
}
|
||||
void setLongName(const QString &_longName)
|
||||
{
|
||||
longName = _longName;
|
||||
}
|
||||
void setSetType(const QString &_setType)
|
||||
{
|
||||
setType = _setType;
|
||||
}
|
||||
void setReleaseDate(const QDate &_releaseDate)
|
||||
{
|
||||
releaseDate = _releaseDate;
|
||||
}
|
||||
|
||||
void loadSetOptions();
|
||||
int getSortKey() const { return sortKey; }
|
||||
int getSortKey() const
|
||||
{
|
||||
return sortKey;
|
||||
}
|
||||
void setSortKey(unsigned int _sortKey);
|
||||
bool getEnabled() const { return enabled; }
|
||||
bool getEnabled() const
|
||||
{
|
||||
return enabled;
|
||||
}
|
||||
void setEnabled(bool _enabled);
|
||||
bool getIsKnown() const { return isknown; }
|
||||
bool getIsKnown() const
|
||||
{
|
||||
return isknown;
|
||||
}
|
||||
void setIsKnown(bool _isknown);
|
||||
|
||||
// Determine incomplete sets.
|
||||
bool getIsKnownIgnored() const
|
||||
{
|
||||
return longName.length() + setType.length() + releaseDate.toString().length() == 0;
|
||||
}
|
||||
};
|
||||
|
||||
class SetList : public QList<CardSet *> {
|
||||
class SetList : public QList<CardSetPtr>
|
||||
{
|
||||
private:
|
||||
class KeyCompareFunctor;
|
||||
|
||||
public:
|
||||
void sortByKey();
|
||||
void guessSortKeys();
|
||||
@@ -55,11 +109,14 @@ public:
|
||||
void markAllAsKnown();
|
||||
int getEnabledSetsNum();
|
||||
int getUnknownSetsNum();
|
||||
QStringList getUnknownSetsNames();
|
||||
};
|
||||
|
||||
class CardInfo : public QObject {
|
||||
class CardInfo : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
CardInfoPtr smartThis;
|
||||
QString name;
|
||||
|
||||
/*
|
||||
@@ -76,96 +133,253 @@ private:
|
||||
QString powtough;
|
||||
QString text;
|
||||
QStringList colors;
|
||||
|
||||
// the cards i'm related to
|
||||
QStringList relatedCards;
|
||||
QList<CardRelation *> relatedCards;
|
||||
|
||||
// the card i'm reverse-related to
|
||||
QStringList reverseRelatedCards;
|
||||
QList<CardRelation *> reverseRelatedCards;
|
||||
|
||||
// the cards thare are reverse-related to me
|
||||
QStringList reverseRelatedCardsToMe;
|
||||
QList<CardRelation *> reverseRelatedCardsToMe;
|
||||
|
||||
QString setsNames;
|
||||
|
||||
bool upsideDownArt;
|
||||
int loyalty;
|
||||
QString loyalty;
|
||||
QStringMap customPicURLs;
|
||||
MuidMap muIds;
|
||||
QStringMap collectorNumbers;
|
||||
QStringMap rarities;
|
||||
bool cipt;
|
||||
int tableRow;
|
||||
QString pixmapCacheKey;
|
||||
|
||||
void refreshCachedSetNames();
|
||||
public:
|
||||
CardInfo(const QString &_name = QString(),
|
||||
bool _isToken = false,
|
||||
const QString &_manacost = QString(),
|
||||
const QString &_cmc = QString(),
|
||||
const QString &_cardtype = QString(),
|
||||
const QString &_powtough = QString(),
|
||||
const QString &_text = QString(),
|
||||
const QStringList &_colors = QStringList(),
|
||||
const QStringList &_relatedCards = QStringList(),
|
||||
const QStringList &_reverseRelatedCards = QStringList(),
|
||||
bool _upsideDownArt = false,
|
||||
int _loyalty = 0,
|
||||
bool _cipt = false,
|
||||
int _tableRow = 0,
|
||||
const SetList &_sets = SetList(),
|
||||
const QStringMap &_customPicURLs = QStringMap(),
|
||||
MuidMap muids = MuidMap()
|
||||
);
|
||||
~CardInfo();
|
||||
inline const QString &getName() const { return name; }
|
||||
inline const QString &getSetsNames() const { return setsNames; }
|
||||
const QString &getSimpleName() const { return simpleName; }
|
||||
bool getIsToken() const { return isToken; }
|
||||
const SetList &getSets() const { return sets; }
|
||||
inline const QString &getManaCost() const { return manacost; }
|
||||
inline const QString &getCmc() const { return cmc; }
|
||||
inline const QString &getCardType() const { return cardtype; }
|
||||
inline const QString &getPowTough() const { return powtough; }
|
||||
const QString &getText() const { return text; }
|
||||
const QString &getPixmapCacheKey() const { return pixmapCacheKey; }
|
||||
const int &getLoyalty() const { return loyalty; }
|
||||
bool getCipt() const { return cipt; }
|
||||
void setManaCost(const QString &_manaCost) { manacost = _manaCost; emit cardInfoChanged(this); }
|
||||
void setCmc(const QString &_cmc) { cmc = _cmc; emit cardInfoChanged(this); }
|
||||
void setCardType(const QString &_cardType) { cardtype = _cardType; emit cardInfoChanged(this); }
|
||||
void setPowTough(const QString &_powTough) { powtough = _powTough; emit cardInfoChanged(this); }
|
||||
void setText(const QString &_text) { text = _text; emit cardInfoChanged(this); }
|
||||
void setColors(const QStringList &_colors) { colors = _colors; emit cardInfoChanged(this); }
|
||||
const QStringList &getColors() const { return colors; }
|
||||
const QStringList &getRelatedCards() const { return relatedCards; }
|
||||
const QStringList &getReverseRelatedCards() const { return reverseRelatedCards; }
|
||||
const QStringList &getReverseRelatedCards2Me() const { return reverseRelatedCardsToMe; }
|
||||
void resetReverseRelatedCards2Me() { reverseRelatedCardsToMe = QStringList(); }
|
||||
void addReverseRelatedCards2Me(QString & cardName) { reverseRelatedCardsToMe.append(cardName); }
|
||||
bool getUpsideDownArt() const { return upsideDownArt; }
|
||||
QString getCustomPicURL(const QString &set) const { return customPicURLs.value(set); }
|
||||
int getMuId(const QString &set) const { return muIds.value(set); }
|
||||
explicit CardInfo(const QString &_name = QString(),
|
||||
bool _isToken = false,
|
||||
const QString &_manacost = QString(),
|
||||
const QString &_cmc = QString(),
|
||||
const QString &_cardtype = QString(),
|
||||
const QString &_powtough = QString(),
|
||||
const QString &_text = QString(),
|
||||
const QStringList &_colors = QStringList(),
|
||||
const QList<CardRelation *> &_relatedCards = QList<CardRelation *>(),
|
||||
const QList<CardRelation *> &_reverseRelatedCards = QList<CardRelation *>(),
|
||||
bool _upsideDownArt = false,
|
||||
const QString &_loyalty = QString(),
|
||||
bool _cipt = false,
|
||||
int _tableRow = 0,
|
||||
const SetList &_sets = SetList(),
|
||||
const QStringMap &_customPicURLs = QStringMap(),
|
||||
MuidMap muids = MuidMap(),
|
||||
QStringMap _collectorNumbers = QStringMap(),
|
||||
QStringMap _rarities = QStringMap());
|
||||
~CardInfo() override;
|
||||
|
||||
static CardInfoPtr newInstance(const QString &_name = QString(),
|
||||
bool _isToken = false,
|
||||
const QString &_manacost = QString(),
|
||||
const QString &_cmc = QString(),
|
||||
const QString &_cardtype = QString(),
|
||||
const QString &_powtough = QString(),
|
||||
const QString &_text = QString(),
|
||||
const QStringList &_colors = QStringList(),
|
||||
const QList<CardRelation *> &_relatedCards = QList<CardRelation *>(),
|
||||
const QList<CardRelation *> &_reverseRelatedCards = QList<CardRelation *>(),
|
||||
bool _upsideDownArt = false,
|
||||
const QString &_loyalty = QString(),
|
||||
bool _cipt = false,
|
||||
int _tableRow = 0,
|
||||
const SetList &_sets = SetList(),
|
||||
const QStringMap &_customPicURLs = QStringMap(),
|
||||
MuidMap muids = MuidMap(),
|
||||
QStringMap _collectorNumbers = QStringMap(),
|
||||
QStringMap _rarities = QStringMap());
|
||||
|
||||
void setSmartPointer(CardInfoPtr _ptr)
|
||||
{
|
||||
smartThis = _ptr;
|
||||
}
|
||||
|
||||
inline const QString &getName() const
|
||||
{
|
||||
return name;
|
||||
}
|
||||
inline const QString &getSetsNames() const
|
||||
{
|
||||
return setsNames;
|
||||
}
|
||||
const QString &getSimpleName() const
|
||||
{
|
||||
return simpleName;
|
||||
}
|
||||
bool getIsToken() const
|
||||
{
|
||||
return isToken;
|
||||
}
|
||||
const SetList &getSets() const
|
||||
{
|
||||
return sets;
|
||||
}
|
||||
inline const QString &getManaCost() const
|
||||
{
|
||||
return manacost;
|
||||
}
|
||||
inline const QString &getCmc() const
|
||||
{
|
||||
return cmc;
|
||||
}
|
||||
inline const QString &getCardType() const
|
||||
{
|
||||
return cardtype;
|
||||
}
|
||||
inline const QString &getPowTough() const
|
||||
{
|
||||
return powtough;
|
||||
}
|
||||
const QString &getText() const
|
||||
{
|
||||
return text;
|
||||
}
|
||||
const QString &getPixmapCacheKey() const
|
||||
{
|
||||
return pixmapCacheKey;
|
||||
}
|
||||
const QString &getLoyalty() const
|
||||
{
|
||||
return loyalty;
|
||||
}
|
||||
bool getCipt() const
|
||||
{
|
||||
return cipt;
|
||||
}
|
||||
// void setManaCost(const QString &_manaCost) { manacost = _manaCost; emit cardInfoChanged(smartThis); }
|
||||
// void setCmc(const QString &_cmc) { cmc = _cmc; emit cardInfoChanged(smartThis); }
|
||||
void setCardType(const QString &_cardType)
|
||||
{
|
||||
cardtype = _cardType;
|
||||
emit cardInfoChanged(smartThis);
|
||||
}
|
||||
void setPowTough(const QString &_powTough)
|
||||
{
|
||||
powtough = _powTough;
|
||||
emit cardInfoChanged(smartThis);
|
||||
}
|
||||
void setText(const QString &_text)
|
||||
{
|
||||
text = _text;
|
||||
emit cardInfoChanged(smartThis);
|
||||
}
|
||||
void setColors(const QStringList &_colors)
|
||||
{
|
||||
colors = _colors;
|
||||
emit cardInfoChanged(smartThis);
|
||||
}
|
||||
const QChar getColorChar() const;
|
||||
const QStringList &getColors() const
|
||||
{
|
||||
return colors;
|
||||
}
|
||||
const QList<CardRelation *> &getRelatedCards() const
|
||||
{
|
||||
return relatedCards;
|
||||
}
|
||||
const QList<CardRelation *> &getReverseRelatedCards() const
|
||||
{
|
||||
return reverseRelatedCards;
|
||||
}
|
||||
const QList<CardRelation *> &getReverseRelatedCards2Me() const
|
||||
{
|
||||
return reverseRelatedCardsToMe;
|
||||
}
|
||||
void resetReverseRelatedCards2Me();
|
||||
void addReverseRelatedCards2Me(CardRelation *cardRelation)
|
||||
{
|
||||
reverseRelatedCardsToMe.append(cardRelation);
|
||||
}
|
||||
bool getUpsideDownArt() const
|
||||
{
|
||||
return upsideDownArt;
|
||||
}
|
||||
QString getCustomPicURL(const QString &set) const
|
||||
{
|
||||
return customPicURLs.value(set);
|
||||
}
|
||||
int getMuId(const QString &set) const
|
||||
{
|
||||
return muIds.value(set);
|
||||
}
|
||||
QString getCollectorNumber(const QString &set) const
|
||||
{
|
||||
return collectorNumbers.value(set);
|
||||
}
|
||||
QString getRarity(const QString &set) const
|
||||
{
|
||||
return rarities.value(set);
|
||||
}
|
||||
QStringMap getRarities() const
|
||||
{
|
||||
return rarities;
|
||||
}
|
||||
QString getMainCardType() const;
|
||||
QString getCorrectedName() const;
|
||||
int getTableRow() const { return tableRow; }
|
||||
void setTableRow(int _tableRow) { tableRow = _tableRow; }
|
||||
void setLoyalty(int _loyalty) { loyalty = _loyalty; emit cardInfoChanged(this); }
|
||||
void setCustomPicURL(const QString &_set, const QString &_customPicURL) { customPicURLs.insert(_set, _customPicURL); }
|
||||
void setMuId(const QString &_set, const int &_muId) { muIds.insert(_set, _muId); }
|
||||
void addToSet(CardSet *set);
|
||||
void emitPixmapUpdated() { emit pixmapUpdated(); }
|
||||
int getTableRow() const
|
||||
{
|
||||
return tableRow;
|
||||
}
|
||||
void setTableRow(int _tableRow)
|
||||
{
|
||||
tableRow = _tableRow;
|
||||
}
|
||||
// void setLoyalty(int _loyalty) { loyalty = _loyalty; emit cardInfoChanged(smartThis); }
|
||||
// void setCustomPicURL(const QString &_set, const QString &_customPicURL) { customPicURLs.insert(_set,
|
||||
// _customPicURL); }
|
||||
void setMuId(const QString &_set, const int &_muId)
|
||||
{
|
||||
muIds.insert(_set, _muId);
|
||||
}
|
||||
void setSetNumber(const QString &_set, const QString &_setNumber)
|
||||
{
|
||||
collectorNumbers.insert(_set, _setNumber);
|
||||
}
|
||||
void setRarity(const QString &_set, const QString &_setNumber)
|
||||
{
|
||||
rarities.insert(_set, _setNumber);
|
||||
}
|
||||
void addToSet(CardSetPtr set);
|
||||
void emitPixmapUpdated()
|
||||
{
|
||||
emit pixmapUpdated();
|
||||
}
|
||||
void refreshCachedSetNames();
|
||||
|
||||
/**
|
||||
* Simplify a name to have no punctuation and lowercase all letters, for
|
||||
* less strict name-matching.
|
||||
*/
|
||||
static QString simplifyName(const QString &name);
|
||||
|
||||
signals:
|
||||
void pixmapUpdated();
|
||||
void cardInfoChanged(CardInfo *card);
|
||||
void cardInfoChanged(CardInfoPtr card);
|
||||
};
|
||||
|
||||
enum LoadStatus { Ok, VersionTooOld, Invalid, NotLoaded, FileError, NoCards };
|
||||
enum LoadStatus
|
||||
{
|
||||
Ok,
|
||||
VersionTooOld,
|
||||
Invalid,
|
||||
NotLoaded,
|
||||
FileError,
|
||||
NoCards
|
||||
};
|
||||
|
||||
typedef QHash<QString, CardInfo *> CardNameMap;
|
||||
typedef QHash<QString, CardSet *> SetNameMap;
|
||||
typedef QHash<QString, CardInfoPtr> CardNameMap;
|
||||
typedef QHash<QString, CardSetPtr> SetNameMap;
|
||||
|
||||
class CardDatabase : public QObject {
|
||||
class CardDatabase : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
protected:
|
||||
/*
|
||||
@@ -183,62 +397,108 @@ protected:
|
||||
*/
|
||||
SetNameMap sets;
|
||||
|
||||
/*
|
||||
* A dummy card returned by getCard() ad a fallback
|
||||
*/
|
||||
CardInfo *noCard;
|
||||
|
||||
LoadStatus loadStatus;
|
||||
bool detectedFirstRun;
|
||||
|
||||
QVector<ICardDatabaseParser *> availableParsers;
|
||||
|
||||
private:
|
||||
static const int versionNeeded;
|
||||
void loadCardsFromXml(QXmlStreamReader &xml, bool tokens);
|
||||
void loadSetsFromXml(QXmlStreamReader &xml);
|
||||
|
||||
CardInfo *getCardFromMap(CardNameMap &cardMap, const QString &cardName, bool createIfNotFound);
|
||||
CardInfoPtr getCardFromMap(const CardNameMap &cardMap, const QString &cardName) const;
|
||||
void checkUnknownSets();
|
||||
public:
|
||||
static const char* TOKENS_SETNAME;
|
||||
void refreshCachedReverseRelatedCards();
|
||||
|
||||
CardDatabase(QObject *parent = 0);
|
||||
~CardDatabase();
|
||||
QBasicMutex *reloadDatabaseMutex = new QBasicMutex(), *clearDatabaseMutex = new QBasicMutex(),
|
||||
*loadFromFileMutex = new QBasicMutex(), *addCardMutex = new QBasicMutex(),
|
||||
*removeCardMutex = new QBasicMutex();
|
||||
|
||||
public:
|
||||
static const char *TOKENS_SETNAME;
|
||||
|
||||
explicit CardDatabase(QObject *parent = nullptr);
|
||||
~CardDatabase() override;
|
||||
void clear();
|
||||
void addCard(CardInfo *card);
|
||||
void removeCard(CardInfo *card);
|
||||
/*
|
||||
* Get card object by name. Ensured to return a valid CardInfo * object; check noCard
|
||||
*/
|
||||
CardInfo *getCard(const QString &cardName = QString(), bool createIfNotFound = false);
|
||||
QList <CardInfo *> getCards(const QStringList &cardNames);
|
||||
void removeCard(CardInfoPtr card);
|
||||
CardInfoPtr getCard(const QString &cardName) const;
|
||||
QList<CardInfoPtr> getCards(const QStringList &cardNames) const;
|
||||
|
||||
/*
|
||||
* Get a card by its simple name. The name will be simplified in this
|
||||
* function, so you don't need to simplify it beforehand.
|
||||
*/
|
||||
CardInfo *getCardBySimpleName(const QString &cardName = QString(), bool createIfNotFound = false);
|
||||
CardInfoPtr getCardBySimpleName(const QString &cardName) const;
|
||||
|
||||
CardSet *getSet(const QString &setName);
|
||||
QList<CardInfo *> getCardList() const { return cards.values(); }
|
||||
CardSetPtr getSet(const QString &setName);
|
||||
QList<CardInfoPtr> getCardList() const
|
||||
{
|
||||
return cards.values();
|
||||
}
|
||||
SetList getSetList() const;
|
||||
LoadStatus loadFromFile(const QString &fileName, bool tokens = false);
|
||||
bool saveToFile(const QString &fileName, bool tokens = false);
|
||||
LoadStatus loadFromFile(const QString &fileName);
|
||||
bool saveCustomTokensToFile();
|
||||
QStringList getAllColors() const;
|
||||
QStringList getAllMainCardTypes() const;
|
||||
LoadStatus getLoadStatus() const { return loadStatus; }
|
||||
bool getLoadSuccess() const { return loadStatus == Ok; }
|
||||
bool hasDetectedFirstRun();
|
||||
void refreshCachedReverseRelatedCards();
|
||||
LoadStatus getLoadStatus() const
|
||||
{
|
||||
return loadStatus;
|
||||
}
|
||||
void enableAllUnknownSets();
|
||||
void markAllSetsAsKnown();
|
||||
void notifyEnabledSetsChanged();
|
||||
|
||||
public slots:
|
||||
LoadStatus loadCardDatabase();
|
||||
LoadStatus loadTokenDatabase();
|
||||
void loadCustomCardDatabases(const QString &path);
|
||||
void emitCardListChanged();
|
||||
LoadStatus loadCardDatabases();
|
||||
void addCard(CardInfoPtr card);
|
||||
void addSet(CardSetPtr set);
|
||||
private slots:
|
||||
LoadStatus loadCardDatabase(const QString &path, bool tokens = false);
|
||||
LoadStatus loadCardDatabase(const QString &path);
|
||||
signals:
|
||||
void cardListChanged();
|
||||
void cardAdded(CardInfo *card);
|
||||
void cardRemoved(CardInfo *card);
|
||||
void cardDatabaseLoadingFailed();
|
||||
void cardDatabaseNewSetsFound(int numUnknownSets, QStringList unknownSetsNames);
|
||||
void cardDatabaseAllNewSetsEnabled();
|
||||
void cardDatabaseEnabledSetsChanged();
|
||||
void cardAdded(CardInfoPtr card);
|
||||
void cardRemoved(CardInfoPtr card);
|
||||
};
|
||||
|
||||
#endif
|
||||
class CardRelation : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
QString name;
|
||||
bool doesAttach;
|
||||
bool isCreateAllExclusion;
|
||||
bool isVariableCount;
|
||||
int defaultCount;
|
||||
|
||||
public:
|
||||
explicit CardRelation(const QString &_name = QString(),
|
||||
bool _doesAttach = false,
|
||||
bool _isCreateAllExclusion = false,
|
||||
bool _isVariableCount = false,
|
||||
int _defaultCount = 1);
|
||||
|
||||
inline const QString &getName() const
|
||||
{
|
||||
return name;
|
||||
}
|
||||
bool getDoesAttach() const
|
||||
{
|
||||
return doesAttach;
|
||||
}
|
||||
bool getCanCreateAnother() const
|
||||
{
|
||||
return !doesAttach;
|
||||
}
|
||||
bool getIsCreateAllExclusion() const
|
||||
{
|
||||
return isCreateAllExclusion;
|
||||
}
|
||||
bool getIsVariable() const
|
||||
{
|
||||
return isVariableCount;
|
||||
}
|
||||
int getDefaultCount() const
|
||||
{
|
||||
return defaultCount;
|
||||
}
|
||||
};
|
||||
#endif
|
||||
@@ -1,49 +1,55 @@
|
||||
#include "carddatabasemodel.h"
|
||||
#include "filtertree.h"
|
||||
|
||||
#define CARDDBMODEL_COLUMNS 5
|
||||
#define CARDDBMODEL_COLUMNS 6
|
||||
|
||||
CardDatabaseModel::CardDatabaseModel(CardDatabase *_db, QObject *parent)
|
||||
: QAbstractListModel(parent), db(_db)
|
||||
CardDatabaseModel::CardDatabaseModel(CardDatabase *_db, bool _showOnlyCardsFromEnabledSets, QObject *parent)
|
||||
: QAbstractListModel(parent), db(_db), showOnlyCardsFromEnabledSets(_showOnlyCardsFromEnabledSets)
|
||||
{
|
||||
connect(db, SIGNAL(cardListChanged()), this, SLOT(updateCardList()));
|
||||
connect(db, SIGNAL(cardAdded(CardInfo *)), this, SLOT(cardAdded(CardInfo *)));
|
||||
connect(db, SIGNAL(cardRemoved(CardInfo *)), this, SLOT(cardRemoved(CardInfo *)));
|
||||
updateCardList();
|
||||
connect(db, SIGNAL(cardAdded(CardInfoPtr)), this, SLOT(cardAdded(CardInfoPtr)));
|
||||
connect(db, SIGNAL(cardRemoved(CardInfoPtr)), this, SLOT(cardRemoved(CardInfoPtr)));
|
||||
connect(db, SIGNAL(cardDatabaseEnabledSetsChanged()), this, SLOT(cardDatabaseEnabledSetsChanged()));
|
||||
|
||||
cardDatabaseEnabledSetsChanged();
|
||||
}
|
||||
|
||||
CardDatabaseModel::~CardDatabaseModel()
|
||||
{
|
||||
}
|
||||
|
||||
int CardDatabaseModel::rowCount(const QModelIndex &/*parent*/) const
|
||||
int CardDatabaseModel::rowCount(const QModelIndex & /*parent*/) const
|
||||
{
|
||||
return cardList.size();
|
||||
}
|
||||
|
||||
int CardDatabaseModel::columnCount(const QModelIndex &/*parent*/) const
|
||||
int CardDatabaseModel::columnCount(const QModelIndex & /*parent*/) const
|
||||
{
|
||||
return CARDDBMODEL_COLUMNS;
|
||||
}
|
||||
|
||||
QVariant CardDatabaseModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (!index.isValid() ||
|
||||
index.row() >= cardList.size() ||
|
||||
index.column() >= CARDDBMODEL_COLUMNS ||
|
||||
if (!index.isValid() || index.row() >= cardList.size() || index.column() >= CARDDBMODEL_COLUMNS ||
|
||||
(role != Qt::DisplayRole && role != SortRole))
|
||||
return QVariant();
|
||||
|
||||
CardInfo *card = cardList.at(index.row());
|
||||
switch (index.column()){
|
||||
case NameColumn: return card->getName();
|
||||
case SetListColumn: return card->getSetsNames();
|
||||
case ManaCostColumn: return role == SortRole ?
|
||||
QString("%1%2").arg(card->getCmc(), 4, QChar('0')).arg(card->getManaCost()) :
|
||||
card->getManaCost();
|
||||
case CardTypeColumn: return card->getCardType();
|
||||
case PTColumn: return card->getPowTough();
|
||||
default: return QVariant();
|
||||
CardInfoPtr card = cardList.at(index.row());
|
||||
switch (index.column()) {
|
||||
case NameColumn:
|
||||
return card->getName();
|
||||
case SetListColumn:
|
||||
return card->getSetsNames();
|
||||
case ManaCostColumn:
|
||||
return role == SortRole ? QString("%1%2").arg(card->getCmc(), 4, QChar('0')).arg(card->getManaCost())
|
||||
: card->getManaCost();
|
||||
case CardTypeColumn:
|
||||
return card->getCardType();
|
||||
case PTColumn:
|
||||
return card->getPowTough();
|
||||
case ColorColumn:
|
||||
return card->getColors().join("");
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,96 +60,105 @@ QVariant CardDatabaseModel::headerData(int section, Qt::Orientation orientation,
|
||||
if (orientation != Qt::Horizontal)
|
||||
return QVariant();
|
||||
switch (section) {
|
||||
case NameColumn: return QString(tr("Name"));
|
||||
case SetListColumn: return QString(tr("Sets"));
|
||||
case ManaCostColumn: return QString(tr("Mana cost"));
|
||||
case CardTypeColumn: return QString(tr("Card type"));
|
||||
case PTColumn: return QString(tr("P/T"));
|
||||
default: return QVariant();
|
||||
case NameColumn:
|
||||
return QString(tr("Name"));
|
||||
case SetListColumn:
|
||||
return QString(tr("Sets"));
|
||||
case ManaCostColumn:
|
||||
return QString(tr("Mana cost"));
|
||||
case CardTypeColumn:
|
||||
return QString(tr("Card type"));
|
||||
case PTColumn:
|
||||
return QString(tr("P/T"));
|
||||
case ColorColumn:
|
||||
return QString(tr("Color(s)"));
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
}
|
||||
|
||||
void CardDatabaseModel::updateCardList()
|
||||
{
|
||||
beginResetModel();
|
||||
|
||||
for (int i = 0; i < cardList.size(); ++i)
|
||||
disconnect(cardList[i], 0, this, 0);
|
||||
|
||||
cardList.clear();
|
||||
|
||||
foreach(CardInfo * card, db->getCardList())
|
||||
{
|
||||
bool hasSet = false;
|
||||
foreach(CardSet * set, card->getSets())
|
||||
{
|
||||
if(set->getEnabled())
|
||||
{
|
||||
hasSet = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(hasSet)
|
||||
{
|
||||
cardList.append(card);
|
||||
connect(card, SIGNAL(cardInfoChanged(CardInfo *)), this, SLOT(cardInfoChanged(CardInfo *)));
|
||||
}
|
||||
}
|
||||
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
void CardDatabaseModel::cardInfoChanged(CardInfo *card)
|
||||
void CardDatabaseModel::cardInfoChanged(CardInfoPtr card)
|
||||
{
|
||||
const int row = cardList.indexOf(card);
|
||||
if (row == -1)
|
||||
return;
|
||||
|
||||
|
||||
emit dataChanged(index(row, 0), index(row, CARDDBMODEL_COLUMNS - 1));
|
||||
}
|
||||
|
||||
void CardDatabaseModel::cardAdded(CardInfo *card)
|
||||
bool CardDatabaseModel::checkCardHasAtLeastOneEnabledSet(CardInfoPtr card)
|
||||
{
|
||||
beginInsertRows(QModelIndex(), cardList.size(), cardList.size());
|
||||
cardList.append(card);
|
||||
connect(card, SIGNAL(cardInfoChanged(CardInfo *)), this, SLOT(cardInfoChanged(CardInfo *)));
|
||||
endInsertRows();
|
||||
if (!showOnlyCardsFromEnabledSets)
|
||||
return true;
|
||||
|
||||
for (CardSetPtr set : card->getSets()) {
|
||||
if (set->getEnabled())
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CardDatabaseModel::cardRemoved(CardInfo *card)
|
||||
void CardDatabaseModel::cardDatabaseEnabledSetsChanged()
|
||||
{
|
||||
// remove all the cards no more present in at least one enabled set
|
||||
foreach (CardInfoPtr card, cardList) {
|
||||
if (!checkCardHasAtLeastOneEnabledSet(card))
|
||||
cardRemoved(card);
|
||||
}
|
||||
|
||||
// re-check all the card currently not shown, maybe their part of a newly-enabled set
|
||||
foreach (CardInfoPtr card, db->getCardList()) {
|
||||
if (!cardList.contains(card))
|
||||
cardAdded(card);
|
||||
}
|
||||
}
|
||||
|
||||
void CardDatabaseModel::cardAdded(CardInfoPtr card)
|
||||
{
|
||||
if (checkCardHasAtLeastOneEnabledSet(card)) {
|
||||
// add the card if it's present in at least one enabled set
|
||||
beginInsertRows(QModelIndex(), cardList.size(), cardList.size());
|
||||
cardList.append(card);
|
||||
connect(card.data(), SIGNAL(cardInfoChanged(CardInfoPtr)), this, SLOT(cardInfoChanged(CardInfoPtr)));
|
||||
endInsertRows();
|
||||
}
|
||||
}
|
||||
|
||||
void CardDatabaseModel::cardRemoved(CardInfoPtr card)
|
||||
{
|
||||
const int row = cardList.indexOf(card);
|
||||
if (row == -1)
|
||||
if (row == -1) {
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
beginRemoveRows(QModelIndex(), row, row);
|
||||
disconnect(card.data(), nullptr, this, nullptr);
|
||||
card.clear();
|
||||
cardList.removeAt(row);
|
||||
endRemoveRows();
|
||||
}
|
||||
|
||||
CardDatabaseDisplayModel::CardDatabaseDisplayModel(QObject *parent)
|
||||
: QSortFilterProxyModel(parent),
|
||||
isToken(ShowAll)
|
||||
CardDatabaseDisplayModel::CardDatabaseDisplayModel(QObject *parent) : QSortFilterProxyModel(parent), isToken(ShowAll)
|
||||
{
|
||||
filterTree = NULL;
|
||||
filterTree = nullptr;
|
||||
setFilterCaseSensitivity(Qt::CaseInsensitive);
|
||||
setSortCaseSensitivity(Qt::CaseInsensitive);
|
||||
|
||||
loadedRowCount = 0;
|
||||
}
|
||||
|
||||
bool CardDatabaseDisplayModel::canFetchMore(const QModelIndex & index) const
|
||||
bool CardDatabaseDisplayModel::canFetchMore(const QModelIndex &index) const
|
||||
{
|
||||
return loadedRowCount < sourceModel()->rowCount(index);
|
||||
}
|
||||
|
||||
void CardDatabaseDisplayModel::fetchMore(const QModelIndex & index)
|
||||
void CardDatabaseDisplayModel::fetchMore(const QModelIndex &index)
|
||||
{
|
||||
int remainder = sourceModel()->rowCount(index) - loadedRowCount;
|
||||
int itemsToFetch = qMin(100, remainder);
|
||||
|
||||
beginInsertRows(QModelIndex(), loadedRowCount, loadedRowCount+itemsToFetch-1);
|
||||
beginInsertRows(QModelIndex(), loadedRowCount, loadedRowCount + itemsToFetch - 1);
|
||||
|
||||
loadedRowCount += itemsToFetch;
|
||||
endInsertRows();
|
||||
@@ -154,13 +169,13 @@ int CardDatabaseDisplayModel::rowCount(const QModelIndex &parent) const
|
||||
return qMin(QSortFilterProxyModel::rowCount(parent), loadedRowCount);
|
||||
}
|
||||
|
||||
bool CardDatabaseDisplayModel::lessThan(const QModelIndex &left, const QModelIndex &right) const {
|
||||
bool CardDatabaseDisplayModel::lessThan(const QModelIndex &left, const QModelIndex &right) const
|
||||
{
|
||||
|
||||
QString leftString = sourceModel()->data(left, CardDatabaseModel::SortRole).toString();
|
||||
QString rightString = sourceModel()->data(right, CardDatabaseModel::SortRole).toString();
|
||||
|
||||
if (!cardName.isEmpty() && left.column() == CardDatabaseModel::NameColumn)
|
||||
{
|
||||
if (!cardName.isEmpty() && left.column() == CardDatabaseModel::NameColumn) {
|
||||
bool isLeftType = leftString.startsWith(cardName, Qt::CaseInsensitive);
|
||||
bool isRightType = rightString.startsWith(cardName, Qt::CaseInsensitive);
|
||||
|
||||
@@ -172,24 +187,112 @@ bool CardDatabaseDisplayModel::lessThan(const QModelIndex &left, const QModelInd
|
||||
// same checks for the right string
|
||||
if (isRightType && (!isLeftType || rightString.size() == cardName.size()))
|
||||
return false;
|
||||
} else if (right.column() == CardDatabaseModel::PTColumn && left.column() == CardDatabaseModel::PTColumn) {
|
||||
QStringList leftList = leftString.split("/");
|
||||
QStringList rightList = rightString.split("/");
|
||||
|
||||
if (leftList.size() == 2 && rightList.size() == 2) {
|
||||
|
||||
// cool, have both P/T in list now
|
||||
int lessThanNum = lessThanNumerically(leftList.at(0), rightList.at(0));
|
||||
if (lessThanNum != 0) {
|
||||
return lessThanNum < 0;
|
||||
} else {
|
||||
// power equal, check toughness
|
||||
return lessThanNumerically(leftList.at(1), rightList.at(1)) < 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return QString::localeAwareCompare(leftString, rightString) < 0;
|
||||
}
|
||||
|
||||
int CardDatabaseDisplayModel::lessThanNumerically(const QString &left, const QString &right)
|
||||
{
|
||||
if (left == right) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool okLeft, okRight;
|
||||
float leftNum = left.toFloat(&okLeft);
|
||||
float rightNum = right.toFloat(&okRight);
|
||||
|
||||
if (okLeft && okRight) {
|
||||
if (leftNum < rightNum) {
|
||||
return -1;
|
||||
} else if (leftNum > rightNum) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
// try and parsing again, for weird ones like "1+*"
|
||||
QString leftAfterNum = "";
|
||||
QString rightAfterNum = "";
|
||||
if (!okLeft) {
|
||||
int leftNumIndex = 0;
|
||||
for (; leftNumIndex < left.length(); leftNumIndex++) {
|
||||
if (!left.at(leftNumIndex).isDigit()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (leftNumIndex != 0) {
|
||||
leftNum = left.left(leftNumIndex).toFloat(&okLeft);
|
||||
leftAfterNum = left.right(leftNumIndex);
|
||||
}
|
||||
}
|
||||
if (!okRight) {
|
||||
int rightNumIndex = 0;
|
||||
for (; rightNumIndex < right.length(); rightNumIndex++) {
|
||||
if (!right.at(rightNumIndex).isDigit()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (rightNumIndex != 0) {
|
||||
rightNum = right.left(rightNumIndex).toFloat(&okRight);
|
||||
rightAfterNum = right.right(rightNumIndex);
|
||||
}
|
||||
}
|
||||
if (okLeft && okRight) {
|
||||
|
||||
if (leftNum != rightNum) {
|
||||
// both parsed as numbers, but different number
|
||||
if (leftNum < rightNum) {
|
||||
return -1;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
// both parsed, same number, but at least one has something else
|
||||
// so compare the part after the number - prefer nothing
|
||||
return QString::localeAwareCompare(leftAfterNum, rightAfterNum);
|
||||
}
|
||||
} else if (okLeft) {
|
||||
return -1;
|
||||
} else if (okRight) {
|
||||
return 1;
|
||||
}
|
||||
// couldn't parse it, just return String comparison
|
||||
return QString::localeAwareCompare(left, right);
|
||||
}
|
||||
bool CardDatabaseDisplayModel::filterAcceptsRow(int sourceRow, const QModelIndex & /*sourceParent*/) const
|
||||
{
|
||||
CardInfo const *info = static_cast<CardDatabaseModel *>(sourceModel())->getCard(sourceRow);
|
||||
|
||||
CardInfoPtr info = static_cast<CardDatabaseModel *>(sourceModel())->getCard(sourceRow);
|
||||
|
||||
if (((isToken == ShowTrue) && !info->getIsToken()) || ((isToken == ShowFalse) && info->getIsToken()))
|
||||
return false;
|
||||
|
||||
return rowMatchesCardName(info);
|
||||
}
|
||||
|
||||
bool CardDatabaseDisplayModel::rowMatchesCardName(CardInfoPtr info) const
|
||||
{
|
||||
if (!cardName.isEmpty() && !info->getName().contains(cardName, Qt::CaseInsensitive))
|
||||
return false;
|
||||
|
||||
if (!cardNameSet.isEmpty() && !cardNameSet.contains(info->getName()))
|
||||
return false;
|
||||
|
||||
if (filterTree != NULL)
|
||||
if (filterTree != nullptr)
|
||||
return filterTree->acceptsCard(info);
|
||||
|
||||
return true;
|
||||
@@ -201,15 +304,15 @@ void CardDatabaseDisplayModel::clearFilterAll()
|
||||
cardText.clear();
|
||||
cardTypes.clear();
|
||||
cardColors.clear();
|
||||
if (filterTree != NULL)
|
||||
if (filterTree != nullptr)
|
||||
filterTree->clear();
|
||||
invalidateFilter();
|
||||
}
|
||||
|
||||
void CardDatabaseDisplayModel::setFilterTree(FilterTree *filterTree)
|
||||
{
|
||||
if (this->filterTree != NULL)
|
||||
disconnect(this->filterTree, 0, this, 0);
|
||||
if (this->filterTree != nullptr)
|
||||
disconnect(this->filterTree, nullptr, this, nullptr);
|
||||
|
||||
this->filterTree = filterTree;
|
||||
connect(this->filterTree, SIGNAL(changed()), this, SLOT(filterTreeChanged()));
|
||||
@@ -220,3 +323,19 @@ void CardDatabaseDisplayModel::filterTreeChanged()
|
||||
{
|
||||
invalidate();
|
||||
}
|
||||
|
||||
TokenDisplayModel::TokenDisplayModel(QObject *parent) : CardDatabaseDisplayModel(parent)
|
||||
{
|
||||
}
|
||||
|
||||
bool TokenDisplayModel::filterAcceptsRow(int sourceRow, const QModelIndex & /*sourceParent*/) const
|
||||
{
|
||||
CardInfoPtr info = static_cast<CardDatabaseModel *>(sourceModel())->getCard(sourceRow);
|
||||
return info->getIsToken() && rowMatchesCardName(info);
|
||||
}
|
||||
|
||||
int TokenDisplayModel::rowCount(const QModelIndex &parent) const
|
||||
{
|
||||
// always load all tokens at start
|
||||
return QSortFilterProxyModel::rowCount(parent);
|
||||
}
|
||||
|
||||
@@ -1,41 +1,70 @@
|
||||
#ifndef CARDDATABASEMODEL_H
|
||||
#define CARDDATABASEMODEL_H
|
||||
|
||||
#include "carddatabase.h"
|
||||
#include <QAbstractListModel>
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QList>
|
||||
#include <QSet>
|
||||
#include "carddatabase.h"
|
||||
#include <QSortFilterProxyModel>
|
||||
|
||||
class FilterTree;
|
||||
|
||||
class CardDatabaseModel : public QAbstractListModel {
|
||||
class CardDatabaseModel : public QAbstractListModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum Columns { NameColumn, SetListColumn, ManaCostColumn, CardTypeColumn, PTColumn, CMCColumn };
|
||||
enum Role { SortRole=Qt::UserRole };
|
||||
CardDatabaseModel(CardDatabase *_db, QObject *parent = 0);
|
||||
enum Columns
|
||||
{
|
||||
NameColumn,
|
||||
SetListColumn,
|
||||
ManaCostColumn,
|
||||
PTColumn,
|
||||
CardTypeColumn,
|
||||
ColorColumn
|
||||
};
|
||||
enum Role
|
||||
{
|
||||
SortRole = Qt::UserRole
|
||||
};
|
||||
CardDatabaseModel(CardDatabase *_db, bool _showOnlyCardsFromEnabledSets, QObject *parent = 0);
|
||||
~CardDatabaseModel();
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
QVariant data(const QModelIndex &index, int role) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
CardDatabase *getDatabase() const { return db; }
|
||||
CardInfo *getCard(int index) const { return cardList[index]; }
|
||||
CardDatabase *getDatabase() const
|
||||
{
|
||||
return db;
|
||||
}
|
||||
CardInfoPtr getCard(int index) const
|
||||
{
|
||||
return cardList[index];
|
||||
}
|
||||
|
||||
private:
|
||||
QList<CardInfo *> cardList;
|
||||
QList<CardInfoPtr> cardList;
|
||||
CardDatabase *db;
|
||||
bool showOnlyCardsFromEnabledSets;
|
||||
|
||||
inline bool checkCardHasAtLeastOneEnabledSet(CardInfoPtr card);
|
||||
private slots:
|
||||
void updateCardList();
|
||||
void cardAdded(CardInfo *card);
|
||||
void cardRemoved(CardInfo *card);
|
||||
void cardInfoChanged(CardInfo *card);
|
||||
void cardAdded(CardInfoPtr card);
|
||||
void cardRemoved(CardInfoPtr card);
|
||||
void cardInfoChanged(CardInfoPtr card);
|
||||
void cardDatabaseEnabledSetsChanged();
|
||||
};
|
||||
|
||||
class CardDatabaseDisplayModel : public QSortFilterProxyModel {
|
||||
class CardDatabaseDisplayModel : public QSortFilterProxyModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum FilterBool { ShowTrue, ShowFalse, ShowAll };
|
||||
enum FilterBool
|
||||
{
|
||||
ShowTrue,
|
||||
ShowFalse,
|
||||
ShowAll
|
||||
};
|
||||
|
||||
private:
|
||||
FilterBool isToken;
|
||||
QString cardNameBeginning, cardName, cardText;
|
||||
@@ -43,27 +72,72 @@ private:
|
||||
QSet<QString> cardNameSet, cardTypes, cardColors;
|
||||
FilterTree *filterTree;
|
||||
int loadedRowCount;
|
||||
|
||||
public:
|
||||
CardDatabaseDisplayModel(QObject *parent = 0);
|
||||
void setFilterTree(FilterTree *filterTree);
|
||||
void setIsToken(FilterBool _isToken) { isToken = _isToken; invalidate(); }
|
||||
void setCardNameBeginning(const QString &_beginning) { cardNameBeginning = _beginning; invalidate(); }
|
||||
void setCardName(const QString &_cardName) { cardName = _cardName; invalidate(); }
|
||||
void setCardNameSet(const QSet<QString> &_cardNameSet) { cardNameSet = _cardNameSet; invalidate(); }
|
||||
void setSearchTerm(const QString &_searchTerm) { searchTerm = _searchTerm; }
|
||||
void setCardText(const QString &_cardText) { cardText = _cardText; invalidate(); }
|
||||
void setCardTypes(const QSet<QString> &_cardTypes) { cardTypes = _cardTypes; invalidate(); }
|
||||
void setCardColors(const QSet<QString> &_cardColors) { cardColors = _cardColors; invalidate(); }
|
||||
void setIsToken(FilterBool _isToken)
|
||||
{
|
||||
isToken = _isToken;
|
||||
invalidate();
|
||||
}
|
||||
void setCardNameBeginning(const QString &_beginning)
|
||||
{
|
||||
cardNameBeginning = _beginning;
|
||||
invalidate();
|
||||
}
|
||||
void setCardName(const QString &_cardName)
|
||||
{
|
||||
cardName = _cardName;
|
||||
invalidate();
|
||||
}
|
||||
void setCardNameSet(const QSet<QString> &_cardNameSet)
|
||||
{
|
||||
cardNameSet = _cardNameSet;
|
||||
invalidate();
|
||||
}
|
||||
void setSearchTerm(const QString &_searchTerm)
|
||||
{
|
||||
searchTerm = _searchTerm;
|
||||
}
|
||||
void setCardText(const QString &_cardText)
|
||||
{
|
||||
cardText = _cardText;
|
||||
invalidate();
|
||||
}
|
||||
void setCardTypes(const QSet<QString> &_cardTypes)
|
||||
{
|
||||
cardTypes = _cardTypes;
|
||||
invalidate();
|
||||
}
|
||||
void setCardColors(const QSet<QString> &_cardColors)
|
||||
{
|
||||
cardColors = _cardColors;
|
||||
invalidate();
|
||||
}
|
||||
void clearFilterAll();
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
|
||||
protected:
|
||||
bool lessThan(const QModelIndex &left, const QModelIndex &right) const;
|
||||
static int lessThanNumerically(const QString &left, const QString &right);
|
||||
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
|
||||
|
||||
bool rowMatchesCardName(CardInfoPtr info) const;
|
||||
bool canFetchMore(const QModelIndex &parent) const;
|
||||
void fetchMore(const QModelIndex &parent);
|
||||
private slots:
|
||||
void filterTreeChanged();
|
||||
};
|
||||
|
||||
class TokenDisplayModel : public CardDatabaseDisplayModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
TokenDisplayModel(QObject *parent = 0);
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
|
||||
protected:
|
||||
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
24
cockatrice/src/carddbparser/carddatabaseparser.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef CARDDATABASE_PARSER_H
|
||||
#define CARDDATABASE_PARSER_H
|
||||
|
||||
#include <QIODevice>
|
||||
#include <QString>
|
||||
|
||||
#include "../carddatabase.h"
|
||||
|
||||
class ICardDatabaseParser : public QObject
|
||||
{
|
||||
public:
|
||||
virtual ~ICardDatabaseParser()
|
||||
{
|
||||
}
|
||||
virtual bool getCanParseFile(const QString &name, QIODevice &device) = 0;
|
||||
virtual void parseFile(QIODevice &device) = 0;
|
||||
virtual bool saveToFile(SetNameMap sets, CardNameMap cards, const QString &fileName) = 0;
|
||||
signals:
|
||||
virtual void addCard(CardInfoPtr card) = 0;
|
||||
};
|
||||
|
||||
Q_DECLARE_INTERFACE(ICardDatabaseParser, "ICardDatabaseParser")
|
||||
|
||||
#endif
|
||||
396
cockatrice/src/carddbparser/cockatricexml3.cpp
Normal file
@@ -0,0 +1,396 @@
|
||||
#include "cockatricexml3.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QFile>
|
||||
#include <QXmlStreamReader>
|
||||
|
||||
#define COCKATRICE_XML3_TAGNAME "cockatrice_carddatabase"
|
||||
#define COCKATRICE_XML3_TAGVER 3
|
||||
|
||||
bool CockatriceXml3Parser::getCanParseFile(const QString &fileName, QIODevice &device)
|
||||
{
|
||||
qDebug() << "[CockatriceXml3Parser] Trying to parse: " << fileName;
|
||||
|
||||
if (!fileName.endsWith(".xml", Qt::CaseInsensitive)) {
|
||||
qDebug() << "[CockatriceXml3Parser] Parsing failed: wrong extension";
|
||||
return false;
|
||||
}
|
||||
|
||||
QXmlStreamReader xml(&device);
|
||||
while (!xml.atEnd()) {
|
||||
if (xml.readNext() == QXmlStreamReader::StartElement) {
|
||||
if (xml.name() == COCKATRICE_XML3_TAGNAME) {
|
||||
int version = xml.attributes().value("version").toString().toInt();
|
||||
if (version == COCKATRICE_XML3_TAGVER) {
|
||||
return true;
|
||||
} else {
|
||||
qDebug() << "[CockatriceXml3Parser] Parsing failed: wrong version" << version;
|
||||
return false;
|
||||
}
|
||||
|
||||
} else {
|
||||
qDebug() << "[CockatriceXml3Parser] Parsing failed: wrong element tag" << xml.name();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CockatriceXml3Parser::parseFile(QIODevice &device)
|
||||
{
|
||||
QXmlStreamReader xml(&device);
|
||||
while (!xml.atEnd()) {
|
||||
if (xml.readNext() == QXmlStreamReader::StartElement) {
|
||||
while (!xml.atEnd()) {
|
||||
if (xml.readNext() == QXmlStreamReader::EndElement) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (xml.name() == "sets") {
|
||||
loadSetsFromXml(xml);
|
||||
} else if (xml.name() == "cards") {
|
||||
loadCardsFromXml(xml);
|
||||
} else if (xml.name() != "") {
|
||||
qDebug() << "[CockatriceXml3Parser] Unknown item" << xml.name() << ", trying to continue anyway";
|
||||
xml.skipCurrentElement();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CardSetPtr CockatriceXml3Parser::internalAddSet(const QString &setName,
|
||||
const QString &longName,
|
||||
const QString &setType,
|
||||
const QDate &releaseDate)
|
||||
{
|
||||
if (sets.contains(setName)) {
|
||||
return sets.value(setName);
|
||||
}
|
||||
|
||||
CardSetPtr newSet = CardSet::newInstance(setName);
|
||||
newSet->setLongName(longName);
|
||||
newSet->setSetType(setType);
|
||||
newSet->setReleaseDate(releaseDate);
|
||||
|
||||
sets.insert(setName, newSet);
|
||||
emit addSet(newSet);
|
||||
return newSet;
|
||||
}
|
||||
|
||||
void CockatriceXml3Parser::loadSetsFromXml(QXmlStreamReader &xml)
|
||||
{
|
||||
while (!xml.atEnd()) {
|
||||
if (xml.readNext() == QXmlStreamReader::EndElement) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (xml.name() == "set") {
|
||||
QString shortName, longName, setType;
|
||||
QDate releaseDate;
|
||||
while (!xml.atEnd()) {
|
||||
if (xml.readNext() == QXmlStreamReader::EndElement) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (xml.name() == "name") {
|
||||
shortName = xml.readElementText();
|
||||
} else if (xml.name() == "longname") {
|
||||
longName = xml.readElementText();
|
||||
} else if (xml.name() == "settype") {
|
||||
setType = xml.readElementText();
|
||||
} else if (xml.name() == "releasedate") {
|
||||
releaseDate = QDate::fromString(xml.readElementText(), Qt::ISODate);
|
||||
} else if (xml.name() != "") {
|
||||
qDebug() << "[CockatriceXml3Parser] Unknown set property" << xml.name()
|
||||
<< ", trying to continue anyway";
|
||||
xml.skipCurrentElement();
|
||||
}
|
||||
}
|
||||
|
||||
internalAddSet(shortName, longName, setType, releaseDate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CockatriceXml3Parser::loadCardsFromXml(QXmlStreamReader &xml)
|
||||
{
|
||||
while (!xml.atEnd()) {
|
||||
if (xml.readNext() == QXmlStreamReader::EndElement) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (xml.name() == "card") {
|
||||
QString name, manacost, cmc, type, pt, text, loyalty;
|
||||
QStringList colors;
|
||||
QList<CardRelation *> relatedCards, reverseRelatedCards;
|
||||
QStringMap customPicURLs;
|
||||
MuidMap muids;
|
||||
QStringMap collectorNumbers, rarities;
|
||||
SetList sets;
|
||||
int tableRow = 0;
|
||||
bool cipt = false;
|
||||
bool isToken = false;
|
||||
bool upsideDown = false;
|
||||
while (!xml.atEnd()) {
|
||||
if (xml.readNext() == QXmlStreamReader::EndElement) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (xml.name() == "name") {
|
||||
name = xml.readElementText();
|
||||
} else if (xml.name() == "manacost") {
|
||||
manacost = xml.readElementText();
|
||||
} else if (xml.name() == "cmc") {
|
||||
cmc = xml.readElementText();
|
||||
} else if (xml.name() == "type") {
|
||||
type = xml.readElementText();
|
||||
} else if (xml.name() == "pt") {
|
||||
pt = xml.readElementText();
|
||||
} else if (xml.name() == "text") {
|
||||
text = xml.readElementText();
|
||||
} else if (xml.name() == "set") {
|
||||
QXmlStreamAttributes attrs = xml.attributes();
|
||||
QString setName = xml.readElementText();
|
||||
sets.append(internalAddSet(setName));
|
||||
if (attrs.hasAttribute("muId")) {
|
||||
muids[setName] = attrs.value("muId").toString().toInt();
|
||||
}
|
||||
|
||||
if (attrs.hasAttribute("picURL")) {
|
||||
customPicURLs[setName] = attrs.value("picURL").toString();
|
||||
}
|
||||
|
||||
if (attrs.hasAttribute("num")) {
|
||||
collectorNumbers[setName] = attrs.value("num").toString();
|
||||
}
|
||||
|
||||
if (attrs.hasAttribute("rarity")) {
|
||||
rarities[setName] = attrs.value("rarity").toString();
|
||||
}
|
||||
} else if (xml.name() == "color") {
|
||||
colors << xml.readElementText();
|
||||
} else if (xml.name() == "related" || xml.name() == "reverse-related") {
|
||||
bool attach = false;
|
||||
bool exclude = false;
|
||||
bool variable = false;
|
||||
int count = 1;
|
||||
QXmlStreamAttributes attrs = xml.attributes();
|
||||
QString cardName = xml.readElementText();
|
||||
if (attrs.hasAttribute("count")) {
|
||||
if (attrs.value("count").toString().indexOf("x=") == 0) {
|
||||
variable = true;
|
||||
count = attrs.value("count").toString().remove(0, 2).toInt();
|
||||
} else if (attrs.value("count").toString().indexOf("x") == 0) {
|
||||
variable = true;
|
||||
} else {
|
||||
count = attrs.value("count").toString().toInt();
|
||||
}
|
||||
|
||||
if (count < 1) {
|
||||
count = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (attrs.hasAttribute("attach")) {
|
||||
attach = true;
|
||||
}
|
||||
|
||||
if (attrs.hasAttribute("exclude")) {
|
||||
exclude = true;
|
||||
}
|
||||
|
||||
auto *relation = new CardRelation(cardName, attach, exclude, variable, count);
|
||||
if (xml.name() == "reverse-related") {
|
||||
reverseRelatedCards << relation;
|
||||
} else {
|
||||
relatedCards << relation;
|
||||
}
|
||||
} else if (xml.name() == "tablerow") {
|
||||
tableRow = xml.readElementText().toInt();
|
||||
} else if (xml.name() == "cipt") {
|
||||
cipt = (xml.readElementText() == "1");
|
||||
} else if (xml.name() == "upsidedown") {
|
||||
upsideDown = (xml.readElementText() == "1");
|
||||
} else if (xml.name() == "loyalty") {
|
||||
loyalty = xml.readElementText();
|
||||
} else if (xml.name() == "token") {
|
||||
isToken = static_cast<bool>(xml.readElementText().toInt());
|
||||
} else if (xml.name() != "") {
|
||||
qDebug() << "[CockatriceXml3Parser] Unknown card property" << xml.name()
|
||||
<< ", trying to continue anyway";
|
||||
xml.skipCurrentElement();
|
||||
}
|
||||
}
|
||||
|
||||
CardInfoPtr newCard = CardInfo::newInstance(
|
||||
name, isToken, manacost, cmc, type, pt, text, colors, relatedCards, reverseRelatedCards, upsideDown,
|
||||
loyalty, cipt, tableRow, sets, customPicURLs, muids, collectorNumbers, rarities);
|
||||
emit addCard(newCard);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static QXmlStreamWriter &operator<<(QXmlStreamWriter &xml, const CardSetPtr &set)
|
||||
{
|
||||
if (set.isNull()) {
|
||||
qDebug() << "&operator<< set is nullptr";
|
||||
return xml;
|
||||
}
|
||||
|
||||
xml.writeStartElement("set");
|
||||
xml.writeTextElement("name", set->getShortName());
|
||||
xml.writeTextElement("longname", set->getLongName());
|
||||
xml.writeTextElement("settype", set->getSetType());
|
||||
xml.writeTextElement("releasedate", set->getReleaseDate().toString(Qt::ISODate));
|
||||
xml.writeEndElement();
|
||||
|
||||
return xml;
|
||||
}
|
||||
|
||||
static QXmlStreamWriter &operator<<(QXmlStreamWriter &xml, const CardInfoPtr &info)
|
||||
{
|
||||
if (info.isNull()) {
|
||||
qDebug() << "operator<< info is nullptr";
|
||||
return xml;
|
||||
}
|
||||
|
||||
xml.writeStartElement("card");
|
||||
xml.writeTextElement("name", info->getName());
|
||||
|
||||
const SetList &sets = info->getSets();
|
||||
QString tmpString;
|
||||
QString tmpSet;
|
||||
for (int i = 0; i < sets.size(); i++) {
|
||||
xml.writeStartElement("set");
|
||||
|
||||
tmpSet = sets[i]->getShortName();
|
||||
xml.writeAttribute("rarity", info->getRarity(tmpSet));
|
||||
xml.writeAttribute("muId", QString::number(info->getMuId(tmpSet)));
|
||||
|
||||
tmpString = info->getCollectorNumber(tmpSet);
|
||||
if (!tmpString.isEmpty()) {
|
||||
xml.writeAttribute("num", info->getCollectorNumber(tmpSet));
|
||||
}
|
||||
|
||||
tmpString = info->getCustomPicURL(tmpSet);
|
||||
if (!tmpString.isEmpty()) {
|
||||
xml.writeAttribute("picURL", tmpString);
|
||||
}
|
||||
|
||||
xml.writeCharacters(tmpSet);
|
||||
xml.writeEndElement();
|
||||
}
|
||||
const QStringList &colors = info->getColors();
|
||||
for (int i = 0; i < colors.size(); i++) {
|
||||
xml.writeTextElement("color", colors[i]);
|
||||
}
|
||||
|
||||
const QList<CardRelation *> related = info->getRelatedCards();
|
||||
for (auto i : related) {
|
||||
xml.writeStartElement("related");
|
||||
if (i->getDoesAttach()) {
|
||||
xml.writeAttribute("attach", "attach");
|
||||
}
|
||||
if (i->getIsCreateAllExclusion()) {
|
||||
xml.writeAttribute("exclude", "exclude");
|
||||
}
|
||||
|
||||
if (i->getIsVariable()) {
|
||||
if (1 == i->getDefaultCount()) {
|
||||
xml.writeAttribute("count", "x");
|
||||
} else {
|
||||
xml.writeAttribute("count", "x=" + QString::number(i->getDefaultCount()));
|
||||
}
|
||||
} else if (1 != i->getDefaultCount()) {
|
||||
xml.writeAttribute("count", QString::number(i->getDefaultCount()));
|
||||
}
|
||||
xml.writeCharacters(i->getName());
|
||||
xml.writeEndElement();
|
||||
}
|
||||
const QList<CardRelation *> reverseRelated = info->getReverseRelatedCards();
|
||||
for (auto i : reverseRelated) {
|
||||
xml.writeStartElement("reverse-related");
|
||||
if (i->getDoesAttach()) {
|
||||
xml.writeAttribute("attach", "attach");
|
||||
}
|
||||
|
||||
if (i->getIsCreateAllExclusion()) {
|
||||
xml.writeAttribute("exclude", "exclude");
|
||||
}
|
||||
|
||||
if (i->getIsVariable()) {
|
||||
if (1 == i->getDefaultCount()) {
|
||||
xml.writeAttribute("count", "x");
|
||||
} else {
|
||||
xml.writeAttribute("count", "x=" + QString::number(i->getDefaultCount()));
|
||||
}
|
||||
} else if (1 != i->getDefaultCount()) {
|
||||
xml.writeAttribute("count", QString::number(i->getDefaultCount()));
|
||||
}
|
||||
xml.writeCharacters(i->getName());
|
||||
xml.writeEndElement();
|
||||
}
|
||||
xml.writeTextElement("manacost", info->getManaCost());
|
||||
xml.writeTextElement("cmc", info->getCmc());
|
||||
xml.writeTextElement("type", info->getCardType());
|
||||
if (!info->getPowTough().isEmpty()) {
|
||||
xml.writeTextElement("pt", info->getPowTough());
|
||||
}
|
||||
xml.writeTextElement("tablerow", QString::number(info->getTableRow()));
|
||||
xml.writeTextElement("text", info->getText());
|
||||
if (info->getMainCardType() == "Planeswalker") {
|
||||
xml.writeTextElement("loyalty", info->getLoyalty());
|
||||
}
|
||||
if (info->getCipt()) {
|
||||
xml.writeTextElement("cipt", "1");
|
||||
}
|
||||
if (info->getIsToken()) {
|
||||
xml.writeTextElement("token", "1");
|
||||
}
|
||||
if (info->getUpsideDownArt()) {
|
||||
xml.writeTextElement("upsidedown", "1");
|
||||
}
|
||||
|
||||
xml.writeEndElement(); // card
|
||||
|
||||
return xml;
|
||||
}
|
||||
|
||||
bool CockatriceXml3Parser::saveToFile(SetNameMap sets, CardNameMap cards, const QString &fileName)
|
||||
{
|
||||
QFile file(fileName);
|
||||
if (!file.open(QIODevice::WriteOnly)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
QXmlStreamWriter xml(&file);
|
||||
|
||||
xml.setAutoFormatting(true);
|
||||
xml.writeStartDocument();
|
||||
xml.writeStartElement(COCKATRICE_XML3_TAGNAME);
|
||||
xml.writeAttribute("version", QString::number(COCKATRICE_XML3_TAGVER));
|
||||
|
||||
if (sets.count() > 0) {
|
||||
xml.writeStartElement("sets");
|
||||
for (CardSetPtr set : sets) {
|
||||
xml << set;
|
||||
}
|
||||
xml.writeEndElement();
|
||||
}
|
||||
|
||||
if (cards.count() > 0) {
|
||||
xml.writeStartElement("cards");
|
||||
for (CardInfoPtr card : cards) {
|
||||
xml << card;
|
||||
}
|
||||
xml.writeEndElement();
|
||||
}
|
||||
|
||||
xml.writeEndElement(); // cockatrice_carddatabase
|
||||
xml.writeEndDocument();
|
||||
|
||||
return true;
|
||||
}
|
||||
36
cockatrice/src/carddbparser/cockatricexml3.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#ifndef COCKATRICE_XML3_H
|
||||
#define COCKATRICE_XML3_H
|
||||
|
||||
#include <QXmlStreamReader>
|
||||
|
||||
#include "carddatabaseparser.h"
|
||||
|
||||
class CockatriceXml3Parser : public ICardDatabaseParser
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(ICardDatabaseParser)
|
||||
public:
|
||||
CockatriceXml3Parser() = default;
|
||||
~CockatriceXml3Parser() = default;
|
||||
bool getCanParseFile(const QString &name, QIODevice &device);
|
||||
void parseFile(QIODevice &device);
|
||||
bool saveToFile(SetNameMap sets, CardNameMap cards, const QString &fileName);
|
||||
|
||||
private:
|
||||
/*
|
||||
* A cached list of the available sets, needed to cross-reference sets from cards.
|
||||
*/
|
||||
SetNameMap sets;
|
||||
|
||||
CardSetPtr internalAddSet(const QString &setName,
|
||||
const QString &longName = "",
|
||||
const QString &setType = "",
|
||||
const QDate &releaseDate = QDate());
|
||||
void loadCardsFromXml(QXmlStreamReader &xml);
|
||||
void loadSetsFromXml(QXmlStreamReader &xml);
|
||||
signals:
|
||||
void addCard(CardInfoPtr card);
|
||||
void addSet(CardSetPtr set);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,14 +1,18 @@
|
||||
#include "carddragitem.h"
|
||||
#include "carditem.h"
|
||||
#include "cardzone.h"
|
||||
#include "gamescene.h"
|
||||
#include "tablezone.h"
|
||||
#include "zoneviewzone.h"
|
||||
#include "gamescene.h"
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
#include <QCursor>
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
#include <QPainter>
|
||||
|
||||
CardDragItem::CardDragItem(CardItem *_item, int _id, const QPointF &_hotSpot, bool _faceDown, AbstractCardDragItem *parentDrag)
|
||||
CardDragItem::CardDragItem(CardItem *_item,
|
||||
int _id,
|
||||
const QPointF &_hotSpot,
|
||||
bool _faceDown,
|
||||
AbstractCardDragItem *parentDrag)
|
||||
: AbstractCardDragItem(_item, _hotSpot, parentDrag), id(_id), faceDown(_faceDown), occupied(false), currentZone(0)
|
||||
{
|
||||
}
|
||||
@@ -16,14 +20,16 @@ CardDragItem::CardDragItem(CardItem *_item, int _id, const QPointF &_hotSpot, bo
|
||||
void CardDragItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||
{
|
||||
AbstractCardDragItem::paint(painter, option, widget);
|
||||
|
||||
|
||||
if (occupied)
|
||||
painter->fillRect(boundingRect(), QColor(200, 0, 0, 100));
|
||||
}
|
||||
|
||||
void CardDragItem::updatePosition(const QPointF &cursorScenePos)
|
||||
{
|
||||
QList<QGraphicsItem *> colliding = scene()->items(cursorScenePos, Qt::IntersectsItemBoundingRect, Qt::DescendingOrder, static_cast<GameScene *>(scene())->getViewTransform());
|
||||
QList<QGraphicsItem *> colliding =
|
||||
scene()->items(cursorScenePos, Qt::IntersectsItemBoundingRect, Qt::DescendingOrder,
|
||||
static_cast<GameScene *>(scene())->getViewTransform());
|
||||
|
||||
CardZone *cardZone = 0;
|
||||
ZoneViewZone *zoneViewZone = 0;
|
||||
@@ -42,18 +48,18 @@ void CardDragItem::updatePosition(const QPointF &cursorScenePos)
|
||||
if (!cursorZone)
|
||||
return;
|
||||
currentZone = cursorZone;
|
||||
|
||||
|
||||
QPointF zonePos = currentZone->scenePos();
|
||||
QPointF cursorPosInZone = cursorScenePos - zonePos;
|
||||
QPointF cardTopLeft = cursorPosInZone - hotSpot;
|
||||
QPointF closestGridPoint = cursorZone->closestGridPoint(cardTopLeft);
|
||||
QPointF newPos = zonePos + closestGridPoint;
|
||||
|
||||
|
||||
if (newPos != pos()) {
|
||||
for (int i = 0; i < childDrags.size(); i++)
|
||||
childDrags[i]->setPos(newPos + childDrags[i]->getHotSpot());
|
||||
setPos(newPos);
|
||||
|
||||
|
||||
bool newOccupied = false;
|
||||
TableZone *table = qobject_cast<TableZone *>(cursorZone);
|
||||
if (table)
|
||||
@@ -85,7 +91,7 @@ void CardDragItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
if(currentZone)
|
||||
if (currentZone)
|
||||
currentZone->handleDropEvent(dragItemList, startZone, (sp - currentZone->scenePos()).toPoint());
|
||||
|
||||
event->accept();
|
||||
|
||||
@@ -5,19 +5,32 @@
|
||||
|
||||
class CardItem;
|
||||
|
||||
class CardDragItem : public AbstractCardDragItem {
|
||||
class CardDragItem : public AbstractCardDragItem
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
int id;
|
||||
bool faceDown;
|
||||
bool occupied;
|
||||
CardZone *currentZone;
|
||||
|
||||
public:
|
||||
CardDragItem(CardItem *_item, int _id, const QPointF &_hotSpot, bool _faceDown, AbstractCardDragItem *parentDrag = 0);
|
||||
int getId() const { return id; }
|
||||
bool getFaceDown() const { return faceDown; }
|
||||
CardDragItem(CardItem *_item,
|
||||
int _id,
|
||||
const QPointF &_hotSpot,
|
||||
bool _faceDown,
|
||||
AbstractCardDragItem *parentDrag = 0);
|
||||
int getId() const
|
||||
{
|
||||
return id;
|
||||
}
|
||||
bool getFaceDown() const
|
||||
{
|
||||
return faceDown;
|
||||
}
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
void updatePosition(const QPointF &cursorScenePos);
|
||||
|
||||
protected:
|
||||
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
|
||||
};
|
||||
|
||||
@@ -4,13 +4,13 @@ const char *CardFilter::typeName(Type t)
|
||||
{
|
||||
switch (t) {
|
||||
case TypeAnd:
|
||||
return "and";
|
||||
return "AND";
|
||||
case TypeOr:
|
||||
return "or";
|
||||
return "OR";
|
||||
case TypeAndNot:
|
||||
return "and not";
|
||||
return "AND NOT";
|
||||
case TypeOrNot:
|
||||
return "or not";
|
||||
return "OR NOT";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
@@ -20,19 +20,27 @@ const char *CardFilter::attrName(Attr a)
|
||||
{
|
||||
switch (a) {
|
||||
case AttrName:
|
||||
return "name";
|
||||
return "Name";
|
||||
case AttrType:
|
||||
return "type";
|
||||
return "Type";
|
||||
case AttrColor:
|
||||
return "color";
|
||||
return "Color";
|
||||
case AttrText:
|
||||
return "text";
|
||||
return "Text";
|
||||
case AttrSet:
|
||||
return "set";
|
||||
return "Set";
|
||||
case AttrManaCost:
|
||||
return "mana cost";
|
||||
return "Mana Cost";
|
||||
case AttrCmc:
|
||||
return "cmc";
|
||||
return "CMC";
|
||||
case AttrRarity:
|
||||
return "Rarity";
|
||||
case AttrPow:
|
||||
return "Power";
|
||||
case AttrTough:
|
||||
return "Toughness";
|
||||
case AttrLoyalty:
|
||||
return "Loyalty";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
|
||||
#include <QString>
|
||||
|
||||
class CardFilter {
|
||||
class CardFilter
|
||||
{
|
||||
public:
|
||||
enum Type {
|
||||
enum Type
|
||||
{
|
||||
TypeAnd = 0,
|
||||
TypeOr,
|
||||
TypeAndNot,
|
||||
@@ -15,14 +17,19 @@ public:
|
||||
|
||||
/* if you add an atribute here you also need to
|
||||
* add its string representation in attrName */
|
||||
enum Attr {
|
||||
AttrName = 0,
|
||||
AttrType,
|
||||
enum Attr
|
||||
{
|
||||
AttrCmc = 0,
|
||||
AttrColor,
|
||||
AttrText,
|
||||
AttrSet,
|
||||
AttrLoyalty,
|
||||
AttrManaCost,
|
||||
AttrCmc,
|
||||
AttrName,
|
||||
AttrPow,
|
||||
AttrRarity,
|
||||
AttrSet,
|
||||
AttrText,
|
||||
AttrTough,
|
||||
AttrType,
|
||||
AttrEnd
|
||||
};
|
||||
|
||||
@@ -32,11 +39,20 @@ private:
|
||||
enum Attr a;
|
||||
|
||||
public:
|
||||
CardFilter(QString term, Type type, Attr attr) : trm(term), t(type), a(attr) {};
|
||||
CardFilter(QString term, Type type, Attr attr) : trm(term), t(type), a(attr){};
|
||||
|
||||
Type type() const { return t; }
|
||||
const QString &term() const { return trm; }
|
||||
Attr attr() const { return a; }
|
||||
Type type() const
|
||||
{
|
||||
return t;
|
||||
}
|
||||
const QString &term() const
|
||||
{
|
||||
return trm;
|
||||
}
|
||||
Attr attr() const
|
||||
{
|
||||
return a;
|
||||
}
|
||||
|
||||
static const char *typeName(Type t);
|
||||
static const char *attrName(Attr a);
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
#include "cardframe.h"
|
||||
|
||||
#include "carditem.h"
|
||||
#include "carddatabase.h"
|
||||
#include "main.h"
|
||||
#include "cardinfopicture.h"
|
||||
#include "cardinfotext.h"
|
||||
#include "carditem.h"
|
||||
#include "main.h"
|
||||
#include "settingscache.h"
|
||||
|
||||
#include <QSplitter>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
CardFrame::CardFrame(const QString &cardName, QWidget *parent)
|
||||
: QTabWidget(parent), info(0), cardTextOnly(false)
|
||||
CardFrame::CardFrame(const QString &cardName, QWidget *parent) : QTabWidget(parent), info(nullptr), cardTextOnly(false)
|
||||
{
|
||||
setContentsMargins(3, 3, 3, 3);
|
||||
pic = new CardInfoPicture();
|
||||
@@ -69,11 +67,10 @@ void CardFrame::retranslateUi()
|
||||
|
||||
void CardFrame::setViewMode(int mode)
|
||||
{
|
||||
if(currentIndex() != mode)
|
||||
if (currentIndex() != mode)
|
||||
setCurrentIndex(mode);
|
||||
|
||||
switch(mode)
|
||||
{
|
||||
switch (mode) {
|
||||
case ImageOnlyView:
|
||||
case TextOnlyView:
|
||||
tab1Layout->addWidget(pic);
|
||||
@@ -83,32 +80,42 @@ void CardFrame::setViewMode(int mode)
|
||||
splitter->addWidget(pic);
|
||||
splitter->addWidget(text);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
settingsCache->setCardInfoViewMode(mode);
|
||||
}
|
||||
|
||||
void CardFrame::setCard(CardInfo *card)
|
||||
void CardFrame::setCard(CardInfoPtr card)
|
||||
{
|
||||
if (info)
|
||||
disconnect(info, 0, this, 0);
|
||||
if (info) {
|
||||
disconnect(info.data(), nullptr, this, nullptr);
|
||||
}
|
||||
|
||||
info = card;
|
||||
connect(info, SIGNAL(destroyed()), this, SLOT(clear()));
|
||||
|
||||
if (info) {
|
||||
connect(info.data(), SIGNAL(destroyed()), this, SLOT(clear()));
|
||||
}
|
||||
|
||||
text->setCard(info);
|
||||
pic->setCard(info);
|
||||
}
|
||||
|
||||
void CardFrame::setCard(const QString &cardName)
|
||||
{
|
||||
setCard(db->getCard(cardName));
|
||||
setCard(db->getCardBySimpleName(cardName));
|
||||
}
|
||||
|
||||
void CardFrame::setCard(AbstractCardItem *card)
|
||||
{
|
||||
setCard(card->getInfo());
|
||||
if (card) {
|
||||
setCard(card->getInfo());
|
||||
}
|
||||
}
|
||||
|
||||
void CardFrame::clear()
|
||||
{
|
||||
setCard(db->getCard());
|
||||
setCard((CardInfoPtr) nullptr);
|
||||
}
|
||||
|
||||
@@ -3,32 +3,38 @@
|
||||
|
||||
#include <QTabWidget>
|
||||
|
||||
#include "carddatabase.h"
|
||||
|
||||
class AbstractCardItem;
|
||||
class CardInfo;
|
||||
class CardInfoPicture;
|
||||
class CardInfoText;
|
||||
class QVBoxLayout;
|
||||
class QSplitter;
|
||||
|
||||
class CardFrame : public QTabWidget {
|
||||
class CardFrame : public QTabWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
CardInfo *info;
|
||||
CardInfoPtr info;
|
||||
CardInfoPicture *pic;
|
||||
CardInfoText *text;
|
||||
bool cardTextOnly;
|
||||
QWidget *tab1, *tab2, *tab3;
|
||||
QVBoxLayout *tab1Layout, *tab2Layout, *tab3Layout;
|
||||
QSplitter *splitter;
|
||||
public:
|
||||
enum ViewMode { ImageOnlyView, TextOnlyView, ImageAndTextView };
|
||||
|
||||
CardFrame(const QString &cardName = QString(),
|
||||
QWidget *parent = 0);
|
||||
public:
|
||||
enum ViewMode
|
||||
{
|
||||
ImageOnlyView,
|
||||
TextOnlyView,
|
||||
ImageAndTextView
|
||||
};
|
||||
explicit CardFrame(const QString &cardName = QString(), QWidget *parent = nullptr);
|
||||
void retranslateUi();
|
||||
|
||||
public slots:
|
||||
void setCard(CardInfo *card);
|
||||
void setCard(CardInfoPtr card);
|
||||
void setCard(const QString &cardName);
|
||||
void setCard(AbstractCardItem *card);
|
||||
void clear();
|
||||
|
||||
@@ -1,28 +1,29 @@
|
||||
#include "cardinfopicture.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QPainter>
|
||||
#include <QStyle>
|
||||
#include <QWidget>
|
||||
|
||||
#include "carditem.h"
|
||||
#include "carddatabase.h"
|
||||
#include "pictureloader.h"
|
||||
#include "main.h"
|
||||
#include "pictureloader.h"
|
||||
|
||||
CardInfoPicture::CardInfoPicture(QWidget *parent)
|
||||
: QWidget(parent),
|
||||
info(0),
|
||||
pixmapDirty(true)
|
||||
CardInfoPicture::CardInfoPicture(QWidget *parent) : QWidget(parent), info(nullptr), pixmapDirty(true)
|
||||
{
|
||||
setMinimumHeight(100);
|
||||
}
|
||||
|
||||
void CardInfoPicture::setCard(CardInfo *card)
|
||||
void CardInfoPicture::setCard(CardInfoPtr card)
|
||||
{
|
||||
if (info)
|
||||
disconnect(info, 0, this, 0);
|
||||
if (info) {
|
||||
disconnect(info.data(), nullptr, this, nullptr);
|
||||
}
|
||||
|
||||
info = card;
|
||||
connect(info, SIGNAL(pixmapUpdated()), this, SLOT(updatePixmap()));
|
||||
|
||||
if (info) {
|
||||
connect(info.data(), SIGNAL(pixmapUpdated()), this, SLOT(updatePixmap()));
|
||||
}
|
||||
|
||||
updatePixmap();
|
||||
}
|
||||
@@ -40,14 +41,10 @@ void CardInfoPicture::updatePixmap()
|
||||
|
||||
void CardInfoPicture::loadPixmap()
|
||||
{
|
||||
if(info)
|
||||
if (info)
|
||||
PictureLoader::getPixmap(resizedPixmap, info, size());
|
||||
else
|
||||
resizedPixmap = QPixmap();
|
||||
|
||||
|
||||
if (resizedPixmap.isNull())
|
||||
PictureLoader::getPixmap(resizedPixmap, db->getCard(), size());
|
||||
PictureLoader::getCardBackPixmap(resizedPixmap, size());
|
||||
}
|
||||
|
||||
void CardInfoPicture::paintEvent(QPaintEvent *)
|
||||
@@ -55,7 +52,7 @@ void CardInfoPicture::paintEvent(QPaintEvent *)
|
||||
if (width() == 0 || height() == 0)
|
||||
return;
|
||||
|
||||
if(pixmapDirty)
|
||||
if (pixmapDirty)
|
||||
loadPixmap();
|
||||
|
||||
QPainter painter(this);
|
||||
|
||||