diff --git a/source/core/assets/images/ui/Icon_Cursor_04b.png b/source/core/assets/images/ui/Icon_Cursor_04b.png new file mode 100644 index 000000000..4b92b5e21 Binary files /dev/null and b/source/core/assets/images/ui/Icon_Cursor_04b.png differ diff --git a/source/core/assets/images/ui/buttons/dot_gothic_16.fnt b/source/core/assets/images/ui/buttons/dot_gothic_16.fnt new file mode 100644 index 000000000..2a4a8219a --- /dev/null +++ b/source/core/assets/images/ui/buttons/dot_gothic_16.fnt @@ -0,0 +1,199 @@ +info face="dot_gothic_16" size=12 bold=0 italic=0 charset="" unicode=1 stretchH=100 smooth=1 aa=2 padding=1,1,1,1 spacing=0,0 +common lineHeight=24 base=18 scaleW=505 scaleH=107 pages=1 packed=0 alphaChnl=0 redChnl=0 greenChnl=0 blueChnl=0 +page id=0 file="dot_gothic_16.png" +chars count=194 +char id=0 x=2 y=2 width=17 height=21 xoffset=-2 yoffset=1 xadvance=19 page=0 chnl=0 +char id=32 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=-1 xadvance=9 page=0 chnl=0 +char id=33 x=495 y=46 width=6 height=17 xoffset=0 yoffset=3 xadvance=11 page=0 chnl=0 +char id=34 x=415 y=84 width=8 height=8 xoffset=-1 yoffset=2 xadvance=11 page=0 chnl=0 +char id=35 x=365 y=46 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=36 x=112 y=2 width=12 height=20 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=37 x=406 y=46 width=13 height=17 xoffset=-3 yoffset=3 xadvance=12 page=0 chnl=0 +char id=38 x=336 y=46 width=13 height=17 xoffset=-3 yoffset=3 xadvance=12 page=0 chnl=0 +char id=39 x=397 y=84 width=6 height=8 xoffset=0 yoffset=2 xadvance=11 page=0 chnl=0 +char id=40 x=51 y=2 width=8 height=20 xoffset=0 yoffset=1 xadvance=11 page=0 chnl=0 +char id=41 x=61 y=2 width=8 height=20 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=42 x=283 y=84 width=12 height=11 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=43 x=179 y=84 width=12 height=13 xoffset=-3 yoffset=7 xadvance=11 page=0 chnl=0 +char id=44 x=388 y=84 width=7 height=9 xoffset=-3 yoffset=12 xadvance=11 page=0 chnl=0 +char id=45 x=452 y=84 width=10 height=7 xoffset=-2 yoffset=10 xadvance=11 page=0 chnl=0 +char id=46 x=464 y=84 width=7 height=7 xoffset=-2 yoffset=12 xadvance=11 page=0 chnl=0 +char id=47 x=454 y=2 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=48 x=157 y=65 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=49 x=444 y=46 width=8 height=17 xoffset=-1 yoffset=3 xadvance=11 page=0 chnl=0 +char id=50 x=454 y=46 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=51 x=0 y=65 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=52 x=14 y=65 width=13 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=53 x=29 y=65 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=54 x=43 y=65 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=55 x=57 y=65 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=56 x=114 y=65 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=57 x=143 y=65 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=58 x=72 y=84 width=7 height=13 xoffset=0 yoffset=7 xadvance=11 page=0 chnl=0 +char id=59 x=313 y=65 width=7 height=14 xoffset=-1 yoffset=7 xadvance=11 page=0 chnl=0 +char id=60 x=138 y=84 width=11 height=13 xoffset=-2 yoffset=7 xadvance=11 page=0 chnl=0 +char id=61 x=297 y=84 width=10 height=10 xoffset=-2 yoffset=9 xadvance=11 page=0 chnl=0 +char id=62 x=81 y=84 width=12 height=13 xoffset=-3 yoffset=7 xadvance=11 page=0 chnl=0 +char id=63 x=171 y=65 width=13 height=17 xoffset=-3 yoffset=3 xadvance=12 page=0 chnl=0 +char id=64 x=480 y=46 width=13 height=17 xoffset=-3 yoffset=3 xadvance=12 page=0 chnl=0 +char id=65 x=336 y=25 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=66 x=350 y=25 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=67 x=364 y=25 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=68 x=406 y=25 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=69 x=420 y=25 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=70 x=434 y=25 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=71 x=476 y=25 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=72 x=490 y=25 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=73 x=14 y=46 width=6 height=17 xoffset=0 yoffset=3 xadvance=11 page=0 chnl=0 +char id=74 x=22 y=46 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=75 x=36 y=46 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=76 x=64 y=46 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=77 x=78 y=46 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=78 x=92 y=46 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=79 x=145 y=46 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=80 x=159 y=46 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=81 x=270 y=25 width=12 height=18 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=82 x=230 y=46 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=83 x=252 y=46 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=84 x=186 y=65 width=12 height=16 xoffset=-3 yoffset=4 xadvance=11 page=0 chnl=0 +char id=85 x=266 y=46 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=86 x=294 y=46 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=87 x=308 y=46 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=88 x=322 y=46 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=89 x=351 y=46 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=90 x=379 y=46 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=91 x=71 y=2 width=8 height=20 xoffset=0 yoffset=1 xadvance=11 page=0 chnl=0 +char id=92 x=468 y=46 width=10 height=17 xoffset=-2 yoffset=3 xadvance=11 page=0 chnl=0 +char id=93 x=81 y=2 width=8 height=20 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=94 x=236 y=84 width=11 height=11 xoffset=-3 yoffset=2 xadvance=11 page=0 chnl=0 +char id=95 x=473 y=84 width=12 height=7 xoffset=-2 yoffset=16 xadvance=13 page=0 chnl=0 +char id=96 x=378 y=84 width=8 height=9 xoffset=-2 yoffset=2 xadvance=11 page=0 chnl=0 +char id=97 x=207 y=84 width=12 height=13 xoffset=-3 yoffset=7 xadvance=11 page=0 chnl=0 +char id=98 x=200 y=65 width=12 height=16 xoffset=-3 yoffset=4 xadvance=11 page=0 chnl=0 +char id=99 x=193 y=84 width=12 height=13 xoffset=-3 yoffset=7 xadvance=11 page=0 chnl=0 +char id=100 x=214 y=65 width=12 height=16 xoffset=-3 yoffset=4 xadvance=11 page=0 chnl=0 +char id=101 x=165 y=84 width=12 height=13 xoffset=-3 yoffset=7 xadvance=11 page=0 chnl=0 +char id=102 x=393 y=46 width=11 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=103 x=299 y=65 width=12 height=14 xoffset=-3 yoffset=7 xadvance=11 page=0 chnl=0 +char id=104 x=228 y=65 width=12 height=16 xoffset=-3 yoffset=4 xadvance=11 page=0 chnl=0 +char id=105 x=242 y=65 width=6 height=16 xoffset=0 yoffset=4 xadvance=11 page=0 chnl=0 +char id=106 x=421 y=46 width=7 height=17 xoffset=-1 yoffset=4 xadvance=10 page=0 chnl=0 +char id=107 x=250 y=65 width=12 height=16 xoffset=-3 yoffset=4 xadvance=11 page=0 chnl=0 +char id=108 x=264 y=65 width=6 height=16 xoffset=0 yoffset=4 xadvance=11 page=0 chnl=0 +char id=109 x=58 y=84 width=12 height=13 xoffset=-3 yoffset=7 xadvance=11 page=0 chnl=0 +char id=110 x=44 y=84 width=12 height=13 xoffset=-3 yoffset=7 xadvance=11 page=0 chnl=0 +char id=111 x=30 y=84 width=12 height=13 xoffset=-3 yoffset=7 xadvance=11 page=0 chnl=0 +char id=112 x=322 y=65 width=12 height=14 xoffset=-3 yoffset=7 xadvance=11 page=0 chnl=0 +char id=113 x=336 y=65 width=12 height=14 xoffset=-3 yoffset=7 xadvance=11 page=0 chnl=0 +char id=114 x=493 y=65 width=10 height=13 xoffset=-2 yoffset=7 xadvance=11 page=0 chnl=0 +char id=115 x=479 y=65 width=12 height=13 xoffset=-3 yoffset=7 xadvance=11 page=0 chnl=0 +char id=116 x=272 y=65 width=11 height=16 xoffset=-3 yoffset=4 xadvance=11 page=0 chnl=0 +char id=117 x=450 y=65 width=12 height=13 xoffset=-3 yoffset=7 xadvance=11 page=0 chnl=0 +char id=118 x=436 y=65 width=12 height=13 xoffset=-3 yoffset=7 xadvance=11 page=0 chnl=0 +char id=119 x=422 y=65 width=12 height=13 xoffset=-3 yoffset=7 xadvance=11 page=0 chnl=0 +char id=120 x=408 y=65 width=12 height=13 xoffset=-3 yoffset=7 xadvance=11 page=0 chnl=0 +char id=121 x=350 y=65 width=12 height=14 xoffset=-3 yoffset=7 xadvance=11 page=0 chnl=0 +char id=122 x=379 y=65 width=12 height=13 xoffset=-3 yoffset=7 xadvance=11 page=0 chnl=0 +char id=123 x=91 y=2 width=9 height=20 xoffset=-1 yoffset=1 xadvance=11 page=0 chnl=0 +char id=124 x=313 y=25 width=6 height=18 xoffset=0 yoffset=3 xadvance=11 page=0 chnl=0 +char id=125 x=102 y=2 width=8 height=20 xoffset=-2 yoffset=1 xadvance=11 page=0 chnl=0 +char id=126 x=425 y=84 width=11 height=7 xoffset=-3 yoffset=10 xadvance=11 page=0 chnl=0 +char id=160 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=18 xadvance=11 page=0 chnl=0 +char id=161 x=244 y=46 width=6 height=17 xoffset=0 yoffset=4 xadvance=11 page=0 chnl=0 +char id=162 x=285 y=65 width=12 height=16 xoffset=-3 yoffset=4 xadvance=11 page=0 chnl=0 +char id=163 x=71 y=65 width=13 height=17 xoffset=-3 yoffset=3 xadvance=12 page=0 chnl=0 +char id=164 x=221 y=84 width=13 height=12 xoffset=-3 yoffset=8 xadvance=12 page=0 chnl=0 +char id=165 x=216 y=46 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=166 x=498 y=2 width=6 height=18 xoffset=0 yoffset=3 xadvance=11 page=0 chnl=0 +char id=167 x=140 y=2 width=13 height=20 xoffset=-3 yoffset=1 xadvance=12 page=0 chnl=0 +char id=168 x=12 y=99 width=11 height=7 xoffset=-2 yoffset=2 xadvance=11 page=0 chnl=0 +char id=169 x=364 y=65 width=13 height=13 xoffset=-3 yoffset=7 xadvance=12 page=0 chnl=0 +char id=170 x=309 y=84 width=9 height=10 xoffset=-2 yoffset=3 xadvance=10 page=0 chnl=0 +char id=171 x=393 y=65 width=13 height=13 xoffset=-3 yoffset=7 xadvance=12 page=0 chnl=0 +char id=172 x=330 y=84 width=12 height=10 xoffset=-3 yoffset=9 xadvance=11 page=0 chnl=0 +char id=173 x=438 y=84 width=12 height=7 xoffset=-2 yoffset=10 xadvance=13 page=0 chnl=0 +char id=174 x=95 y=84 width=13 height=13 xoffset=-3 yoffset=7 xadvance=12 page=0 chnl=0 +char id=175 x=0 y=99 width=10 height=7 xoffset=-2 yoffset=3 xadvance=11 page=0 chnl=0 +char id=176 x=355 y=84 width=10 height=10 xoffset=-2 yoffset=3 xadvance=11 page=0 chnl=0 +char id=177 x=110 y=84 width=12 height=13 xoffset=-3 yoffset=7 xadvance=11 page=0 chnl=0 +char id=178 x=249 y=84 width=10 height=11 xoffset=-2 yoffset=3 xadvance=11 page=0 chnl=0 +char id=179 x=261 y=84 width=10 height=11 xoffset=-2 yoffset=3 xadvance=11 page=0 chnl=0 +char id=180 x=405 y=84 width=8 height=8 xoffset=-1 yoffset=3 xadvance=11 page=0 chnl=0 +char id=181 x=173 y=46 width=13 height=17 xoffset=-3 yoffset=6 xadvance=12 page=0 chnl=0 +char id=182 x=321 y=25 width=13 height=18 xoffset=-3 yoffset=3 xadvance=12 page=0 chnl=0 +char id=183 x=487 y=84 width=7 height=7 xoffset=0 yoffset=9 xadvance=11 page=0 chnl=0 +char id=184 x=320 y=84 width=8 height=10 xoffset=-1 yoffset=13 xadvance=11 page=0 chnl=0 +char id=185 x=273 y=84 width=8 height=11 xoffset=-1 yoffset=3 xadvance=11 page=0 chnl=0 +char id=186 x=344 y=84 width=9 height=10 xoffset=-2 yoffset=3 xadvance=11 page=0 chnl=0 +char id=187 x=0 y=84 width=13 height=13 xoffset=-3 yoffset=7 xadvance=12 page=0 chnl=0 +char id=188 x=483 y=2 width=13 height=19 xoffset=-3 yoffset=2 xadvance=12 page=0 chnl=0 +char id=189 x=468 y=2 width=13 height=19 xoffset=-3 yoffset=2 xadvance=12 page=0 chnl=0 +char id=190 x=298 y=25 width=13 height=18 xoffset=-3 yoffset=3 xadvance=12 page=0 chnl=0 +char id=191 x=86 y=65 width=11 height=17 xoffset=-3 yoffset=4 xadvance=11 page=0 chnl=0 +char id=192 x=425 y=2 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=193 x=411 y=2 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=194 x=397 y=2 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=195 x=383 y=2 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=196 x=369 y=2 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=197 x=355 y=2 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=198 x=99 y=65 width=13 height=17 xoffset=-3 yoffset=3 xadvance=12 page=0 chnl=0 +char id=199 x=284 y=25 width=12 height=18 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=200 x=312 y=2 width=13 height=19 xoffset=-3 yoffset=1 xadvance=12 page=0 chnl=0 +char id=201 x=297 y=2 width=13 height=19 xoffset=-3 yoffset=1 xadvance=12 page=0 chnl=0 +char id=202 x=282 y=2 width=13 height=19 xoffset=-3 yoffset=1 xadvance=12 page=0 chnl=0 +char id=203 x=267 y=2 width=13 height=19 xoffset=-3 yoffset=1 xadvance=12 page=0 chnl=0 +char id=204 x=257 y=2 width=8 height=19 xoffset=-1 yoffset=1 xadvance=11 page=0 chnl=0 +char id=205 x=247 y=2 width=8 height=19 xoffset=-1 yoffset=1 xadvance=11 page=0 chnl=0 +char id=206 x=235 y=2 width=10 height=19 xoffset=-2 yoffset=1 xadvance=11 page=0 chnl=0 +char id=207 x=225 y=2 width=8 height=19 xoffset=-1 yoffset=1 xadvance=11 page=0 chnl=0 +char id=208 x=128 y=65 width=13 height=17 xoffset=-3 yoffset=3 xadvance=12 page=0 chnl=0 +char id=209 x=197 y=2 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=210 x=183 y=2 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=211 x=169 y=2 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=212 x=256 y=25 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=213 x=14 y=25 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=214 x=0 y=25 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=215 x=15 y=84 width=13 height=13 xoffset=-3 yoffset=7 xadvance=12 page=0 chnl=0 +char id=216 x=439 y=2 width=13 height=19 xoffset=-3 yoffset=2 xadvance=12 page=0 chnl=0 +char id=217 x=341 y=2 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=218 x=327 y=2 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=219 x=211 y=2 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=220 x=155 y=2 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=221 x=242 y=25 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=222 x=378 y=25 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=223 x=392 y=25 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=224 x=228 y=25 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=225 x=214 y=25 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=226 x=200 y=25 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=227 x=448 y=25 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=228 x=462 y=25 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=229 x=186 y=25 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=230 x=464 y=65 width=13 height=13 xoffset=-3 yoffset=7 xadvance=12 page=0 chnl=0 +char id=231 x=0 y=46 width=12 height=17 xoffset=-3 yoffset=4 xadvance=11 page=0 chnl=0 +char id=232 x=172 y=25 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=233 x=158 y=25 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=234 x=144 y=25 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=235 x=50 y=46 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=236 x=134 y=25 width=8 height=19 xoffset=-1 yoffset=1 xadvance=11 page=0 chnl=0 +char id=237 x=124 y=25 width=8 height=19 xoffset=-1 yoffset=1 xadvance=11 page=0 chnl=0 +char id=238 x=112 y=25 width=10 height=19 xoffset=-2 yoffset=1 xadvance=11 page=0 chnl=0 +char id=239 x=106 y=46 width=8 height=17 xoffset=-1 yoffset=3 xadvance=11 page=0 chnl=0 +char id=240 x=116 y=46 width=13 height=17 xoffset=-3 yoffset=3 xadvance=12 page=0 chnl=0 +char id=241 x=131 y=46 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=242 x=98 y=25 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=243 x=84 y=25 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=244 x=70 y=25 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=245 x=188 y=46 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=246 x=202 y=46 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=247 x=124 y=84 width=12 height=13 xoffset=-2 yoffset=7 xadvance=13 page=0 chnl=0 +char id=248 x=151 y=84 width=12 height=13 xoffset=-3 yoffset=7 xadvance=11 page=0 chnl=0 +char id=249 x=56 y=25 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=250 x=42 y=25 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=251 x=28 y=25 width=12 height=19 xoffset=-3 yoffset=1 xadvance=11 page=0 chnl=0 +char id=252 x=280 y=46 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=253 x=36 y=2 width=13 height=21 xoffset=-3 yoffset=2 xadvance=12 page=0 chnl=0 +char id=254 x=126 y=2 width=12 height=20 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +char id=255 x=21 y=2 width=13 height=21 xoffset=-3 yoffset=2 xadvance=12 page=0 chnl=0 +char id=8226 x=367 y=84 width=9 height=9 xoffset=-2 yoffset=8 xadvance=10 page=0 chnl=0 +char id=8364 x=430 y=46 width=12 height=17 xoffset=-3 yoffset=3 xadvance=11 page=0 chnl=0 +kernings count=0 diff --git a/source/core/assets/images/ui/buttons/dot_gothic_16.png b/source/core/assets/images/ui/buttons/dot_gothic_16.png new file mode 100644 index 000000000..be50e99e0 Binary files /dev/null and b/source/core/assets/images/ui/buttons/dot_gothic_16.png differ diff --git a/source/core/assets/images/ui/buttons/dot_gothic_32.fnt b/source/core/assets/images/ui/buttons/dot_gothic_32.fnt new file mode 100644 index 000000000..038a344ce --- /dev/null +++ b/source/core/assets/images/ui/buttons/dot_gothic_32.fnt @@ -0,0 +1,199 @@ +info face="dot_gothic_32" size=12 bold=0 italic=0 charset="" unicode=1 stretchH=100 smooth=1 aa=2 padding=1,1,1,1 spacing=0,0 +common lineHeight=46 base=37 scaleW=505 scaleH=240 pages=1 packed=0 alphaChnl=0 redChnl=0 greenChnl=0 blueChnl=0 +page id=0 file="dot_gothic_32.png" +chars count=194 +char id=0 x=2 y=2 width=28 height=37 xoffset=1 yoffset=6 xadvance=34 page=0 chnl=0 +char id=32 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=-1 xadvance=16 page=0 chnl=0 +char id=33 x=380 y=141 width=7 height=30 xoffset=4 yoffset=10 xadvance=18 page=0 chnl=0 +char id=34 x=22 y=227 width=11 height=12 xoffset=2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=35 x=18 y=141 width=18 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=36 x=157 y=2 width=19 height=34 xoffset=-2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=37 x=64 y=141 width=20 height=30 xoffset=-2 yoffset=10 xadvance=20 page=0 chnl=0 +char id=38 x=480 y=109 width=20 height=30 xoffset=-2 yoffset=10 xadvance=20 page=0 chnl=0 +char id=39 x=0 y=227 width=7 height=12 xoffset=4 yoffset=8 xadvance=18 page=0 chnl=0 +char id=40 x=54 y=2 width=11 height=34 xoffset=5 yoffset=8 xadvance=18 page=0 chnl=0 +char id=41 x=67 y=2 width=11 height=34 xoffset=-1 yoffset=8 xadvance=18 page=0 chnl=0 +char id=42 x=336 y=203 width=19 height=17 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=43 x=85 y=203 width=19 height=22 xoffset=-2 yoffset=18 xadvance=18 page=0 chnl=0 +char id=44 x=495 y=203 width=9 height=12 xoffset=-1 yoffset=30 xadvance=18 page=0 chnl=0 +char id=45 x=149 y=227 width=16 height=7 xoffset=-1 yoffset=25 xadvance=18 page=0 chnl=0 +char id=46 x=77 y=227 width=8 height=8 xoffset=-1 yoffset=30 xadvance=18 page=0 chnl=0 +char id=47 x=119 y=75 width=19 height=31 xoffset=-2 yoffset=9 xadvance=18 page=0 chnl=0 +char id=48 x=359 y=141 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=49 x=51 y=141 width=11 height=30 xoffset=2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=50 x=86 y=141 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=51 x=129 y=141 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=52 x=150 y=141 width=20 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=53 x=232 y=141 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=54 x=253 y=141 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=55 x=274 y=141 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=56 x=295 y=141 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=57 x=316 y=141 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=58 x=257 y=203 width=8 height=20 xoffset=3 yoffset=18 xadvance=18 page=0 chnl=0 +char id=59 x=140 y=173 width=9 height=24 xoffset=3 yoffset=18 xadvance=18 page=0 chnl=0 +char id=60 x=463 y=173 width=19 height=22 xoffset=-2 yoffset=18 xadvance=18 page=0 chnl=0 +char id=61 x=424 y=203 width=16 height=14 xoffset=-1 yoffset=22 xadvance=18 page=0 chnl=0 +char id=62 x=235 y=173 width=19 height=22 xoffset=-2 yoffset=18 xadvance=18 page=0 chnl=0 +char id=63 x=389 y=141 width=20 height=30 xoffset=-2 yoffset=10 xadvance=20 page=0 chnl=0 +char id=64 x=189 y=141 width=20 height=30 xoffset=-2 yoffset=10 xadvance=20 page=0 chnl=0 +char id=65 x=161 y=75 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=66 x=204 y=75 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=67 x=225 y=75 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=68 x=246 y=75 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=69 x=288 y=75 width=18 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=70 x=308 y=75 width=18 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=71 x=328 y=75 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=72 x=391 y=75 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=73 x=412 y=75 width=7 height=30 xoffset=4 yoffset=10 xadvance=18 page=0 chnl=0 +char id=74 x=421 y=75 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=75 x=442 y=75 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=76 x=463 y=75 width=18 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=77 x=483 y=75 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=78 x=21 y=109 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=79 x=42 y=109 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=80 x=63 y=109 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=81 x=222 y=2 width=19 height=32 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=82 x=163 y=109 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=83 x=184 y=109 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=84 x=462 y=141 width=19 height=28 xoffset=-2 yoffset=12 xadvance=18 page=0 chnl=0 +char id=85 x=247 y=109 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=86 x=268 y=109 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=87 x=289 y=109 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=88 x=310 y=109 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=89 x=439 y=109 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=90 x=460 y=109 width=18 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=91 x=80 y=2 width=11 height=34 xoffset=5 yoffset=8 xadvance=18 page=0 chnl=0 +char id=92 x=172 y=141 width=15 height=30 xoffset=0 yoffset=10 xadvance=18 page=0 chnl=0 +char id=93 x=93 y=2 width=11 height=34 xoffset=-1 yoffset=8 xadvance=18 page=0 chnl=0 +char id=94 x=357 y=203 width=17 height=16 xoffset=-1 yoffset=10 xadvance=18 page=0 chnl=0 +char id=95 x=105 y=227 width=20 height=7 xoffset=-2 yoffset=36 xadvance=20 page=0 chnl=0 +char id=96 x=9 y=227 width=11 height=12 xoffset=1 yoffset=8 xadvance=18 page=0 chnl=0 +char id=97 x=128 y=203 width=19 height=22 xoffset=-2 yoffset=18 xadvance=18 page=0 chnl=0 +char id=98 x=483 y=141 width=19 height=28 xoffset=-2 yoffset=12 xadvance=18 page=0 chnl=0 +char id=99 x=171 y=203 width=19 height=22 xoffset=-2 yoffset=18 xadvance=18 page=0 chnl=0 +char id=100 x=0 y=173 width=19 height=28 xoffset=-2 yoffset=12 xadvance=18 page=0 chnl=0 +char id=101 x=192 y=203 width=19 height=22 xoffset=-2 yoffset=18 xadvance=18 page=0 chnl=0 +char id=102 x=0 y=141 width=16 height=30 xoffset=-1 yoffset=10 xadvance=18 page=0 chnl=0 +char id=103 x=151 y=173 width=19 height=24 xoffset=-2 yoffset=18 xadvance=18 page=0 chnl=0 +char id=104 x=21 y=173 width=19 height=28 xoffset=-2 yoffset=12 xadvance=18 page=0 chnl=0 +char id=105 x=42 y=173 width=7 height=28 xoffset=4 yoffset=12 xadvance=18 page=0 chnl=0 +char id=106 x=38 y=141 width=11 height=30 xoffset=2 yoffset=12 xadvance=18 page=0 chnl=0 +char id=107 x=51 y=173 width=19 height=28 xoffset=-2 yoffset=12 xadvance=18 page=0 chnl=0 +char id=108 x=72 y=173 width=7 height=28 xoffset=4 yoffset=12 xadvance=18 page=0 chnl=0 +char id=109 x=21 y=203 width=19 height=22 xoffset=-2 yoffset=18 xadvance=18 page=0 chnl=0 +char id=110 x=0 y=203 width=19 height=22 xoffset=-2 yoffset=18 xadvance=18 page=0 chnl=0 +char id=111 x=484 y=173 width=19 height=22 xoffset=-2 yoffset=18 xadvance=18 page=0 chnl=0 +char id=112 x=172 y=173 width=19 height=24 xoffset=-2 yoffset=18 xadvance=18 page=0 chnl=0 +char id=113 x=193 y=173 width=19 height=24 xoffset=-2 yoffset=18 xadvance=18 page=0 chnl=0 +char id=114 x=426 y=173 width=14 height=22 xoffset=0 yoffset=18 xadvance=18 page=0 chnl=0 +char id=115 x=405 y=173 width=19 height=22 xoffset=-2 yoffset=18 xadvance=18 page=0 chnl=0 +char id=116 x=81 y=173 width=16 height=28 xoffset=-1 yoffset=12 xadvance=18 page=0 chnl=0 +char id=117 x=362 y=173 width=19 height=22 xoffset=-2 yoffset=18 xadvance=18 page=0 chnl=0 +char id=118 x=341 y=173 width=19 height=22 xoffset=-2 yoffset=18 xadvance=18 page=0 chnl=0 +char id=119 x=320 y=173 width=19 height=22 xoffset=-2 yoffset=18 xadvance=18 page=0 chnl=0 +char id=120 x=299 y=173 width=19 height=22 xoffset=-2 yoffset=18 xadvance=18 page=0 chnl=0 +char id=121 x=214 y=173 width=19 height=24 xoffset=-2 yoffset=18 xadvance=18 page=0 chnl=0 +char id=122 x=256 y=173 width=19 height=22 xoffset=-2 yoffset=18 xadvance=18 page=0 chnl=0 +char id=123 x=106 y=2 width=12 height=34 xoffset=3 yoffset=8 xadvance=18 page=0 chnl=0 +char id=124 x=42 y=41 width=7 height=32 xoffset=4 yoffset=10 xadvance=18 page=0 chnl=0 +char id=125 x=120 y=2 width=13 height=34 xoffset=-1 yoffset=8 xadvance=18 page=0 chnl=0 +char id=126 x=48 y=227 width=17 height=9 xoffset=-1 yoffset=23 xadvance=18 page=0 chnl=0 +char id=160 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=37 xadvance=18 page=0 chnl=0 +char id=161 x=432 y=141 width=7 height=28 xoffset=4 yoffset=14 xadvance=18 page=0 chnl=0 +char id=162 x=411 y=141 width=19 height=28 xoffset=-2 yoffset=12 xadvance=18 page=0 chnl=0 +char id=163 x=182 y=75 width=20 height=30 xoffset=-2 yoffset=10 xadvance=20 page=0 chnl=0 +char id=164 x=235 y=203 width=20 height=20 xoffset=-2 yoffset=20 xadvance=20 page=0 chnl=0 +char id=165 x=211 y=141 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=166 x=493 y=41 width=7 height=32 xoffset=4 yoffset=9 xadvance=18 page=0 chnl=0 +char id=167 x=178 y=2 width=20 height=34 xoffset=-2 yoffset=8 xadvance=20 page=0 chnl=0 +char id=168 x=87 y=227 width=16 height=8 xoffset=-1 yoffset=10 xadvance=18 page=0 chnl=0 +char id=169 x=267 y=203 width=20 height=20 xoffset=-2 yoffset=18 xadvance=20 page=0 chnl=0 +char id=170 x=391 y=203 width=15 height=15 xoffset=0 yoffset=10 xadvance=18 page=0 chnl=0 +char id=171 x=383 y=173 width=20 height=22 xoffset=-2 yoffset=18 xadvance=20 page=0 chnl=0 +char id=172 x=474 y=203 width=19 height=13 xoffset=-2 yoffset=23 xadvance=18 page=0 chnl=0 +char id=173 x=127 y=227 width=20 height=7 xoffset=-2 yoffset=25 xadvance=20 page=0 chnl=0 +char id=174 x=213 y=203 width=20 height=20 xoffset=-2 yoffset=18 xadvance=20 page=0 chnl=0 +char id=175 x=167 y=227 width=16 height=7 xoffset=-1 yoffset=11 xadvance=18 page=0 chnl=0 +char id=176 x=457 y=203 width=15 height=14 xoffset=0 yoffset=10 xadvance=18 page=0 chnl=0 +char id=177 x=442 y=173 width=19 height=22 xoffset=-2 yoffset=18 xadvance=18 page=0 chnl=0 +char id=178 x=289 y=203 width=15 height=18 xoffset=0 yoffset=10 xadvance=18 page=0 chnl=0 +char id=179 x=306 y=203 width=15 height=18 xoffset=0 yoffset=10 xadvance=18 page=0 chnl=0 +char id=180 x=35 y=227 width=11 height=11 xoffset=2 yoffset=9 xadvance=18 page=0 chnl=0 +char id=181 x=118 y=173 width=20 height=26 xoffset=-2 yoffset=17 xadvance=20 page=0 chnl=0 +char id=182 x=320 y=41 width=19 height=32 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=183 x=67 y=227 width=8 height=8 xoffset=3 yoffset=24 xadvance=18 page=0 chnl=0 +char id=184 x=442 y=203 width=13 height=14 xoffset=1 yoffset=29 xadvance=18 page=0 chnl=0 +char id=185 x=323 y=203 width=11 height=18 xoffset=2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=186 x=376 y=203 width=13 height=15 xoffset=1 yoffset=10 xadvance=18 page=0 chnl=0 +char id=187 x=106 y=203 width=20 height=22 xoffset=-2 yoffset=18 xadvance=20 page=0 chnl=0 +char id=188 x=331 y=109 width=20 height=30 xoffset=-2 yoffset=10 xadvance=20 page=0 chnl=0 +char id=189 x=395 y=109 width=20 height=30 xoffset=-2 yoffset=10 xadvance=20 page=0 chnl=0 +char id=190 x=417 y=109 width=20 height=30 xoffset=-2 yoffset=10 xadvance=20 page=0 chnl=0 +char id=191 x=99 y=173 width=17 height=28 xoffset=-1 yoffset=14 xadvance=18 page=0 chnl=0 +char id=192 x=114 y=41 width=19 height=32 xoffset=-2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=193 x=93 y=41 width=19 height=32 xoffset=-2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=194 x=72 y=41 width=19 height=32 xoffset=-2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=195 x=51 y=41 width=19 height=32 xoffset=-2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=196 x=98 y=75 width=19 height=31 xoffset=-2 yoffset=9 xadvance=18 page=0 chnl=0 +char id=197 x=21 y=41 width=19 height=32 xoffset=-2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=198 x=337 y=141 width=20 height=30 xoffset=-2 yoffset=10 xadvance=20 page=0 chnl=0 +char id=199 x=478 y=2 width=19 height=32 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=200 x=456 y=2 width=20 height=32 xoffset=-2 yoffset=8 xadvance=20 page=0 chnl=0 +char id=201 x=434 y=2 width=20 height=32 xoffset=-2 yoffset=8 xadvance=20 page=0 chnl=0 +char id=202 x=412 y=2 width=20 height=32 xoffset=-2 yoffset=8 xadvance=20 page=0 chnl=0 +char id=203 x=76 y=75 width=20 height=31 xoffset=-2 yoffset=9 xadvance=20 page=0 chnl=0 +char id=204 x=378 y=2 width=11 height=32 xoffset=2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=205 x=365 y=2 width=11 height=32 xoffset=2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=206 x=348 y=2 width=15 height=32 xoffset=0 yoffset=8 xadvance=18 page=0 chnl=0 +char id=207 x=42 y=75 width=11 height=31 xoffset=2 yoffset=9 xadvance=18 page=0 chnl=0 +char id=208 x=141 y=109 width=20 height=30 xoffset=-2 yoffset=10 xadvance=20 page=0 chnl=0 +char id=209 x=285 y=2 width=19 height=32 xoffset=-2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=210 x=264 y=2 width=19 height=32 xoffset=-2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=211 x=243 y=2 width=19 height=32 xoffset=-2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=212 x=135 y=41 width=19 height=32 xoffset=-2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=213 x=21 y=75 width=19 height=32 xoffset=-2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=214 x=140 y=75 width=19 height=31 xoffset=-2 yoffset=9 xadvance=18 page=0 chnl=0 +char id=215 x=149 y=203 width=20 height=22 xoffset=-2 yoffset=18 xadvance=20 page=0 chnl=0 +char id=216 x=135 y=2 width=20 height=34 xoffset=-2 yoffset=8 xadvance=20 page=0 chnl=0 +char id=217 x=0 y=41 width=19 height=32 xoffset=-2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=218 x=391 y=2 width=19 height=32 xoffset=-2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=219 x=327 y=2 width=19 height=32 xoffset=-2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=220 x=55 y=75 width=19 height=31 xoffset=-2 yoffset=9 xadvance=18 page=0 chnl=0 +char id=221 x=306 y=2 width=19 height=32 xoffset=-2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=222 x=374 y=109 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=223 x=267 y=75 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=224 x=0 y=75 width=19 height=32 xoffset=-2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=225 x=472 y=41 width=19 height=32 xoffset=-2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=226 x=451 y=41 width=19 height=32 xoffset=-2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=227 x=349 y=75 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=228 x=370 y=75 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=229 x=430 y=41 width=19 height=32 xoffset=-2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=230 x=277 y=173 width=20 height=22 xoffset=-2 yoffset=18 xadvance=20 page=0 chnl=0 +char id=231 x=441 y=141 width=19 height=28 xoffset=-2 yoffset=14 xadvance=18 page=0 chnl=0 +char id=232 x=409 y=41 width=19 height=32 xoffset=-2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=233 x=388 y=41 width=19 height=32 xoffset=-2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=234 x=367 y=41 width=19 height=32 xoffset=-2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=235 x=0 y=109 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=236 x=354 y=41 width=11 height=32 xoffset=2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=237 x=341 y=41 width=11 height=32 xoffset=2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=238 x=303 y=41 width=15 height=32 xoffset=0 yoffset=8 xadvance=18 page=0 chnl=0 +char id=239 x=84 y=109 width=11 height=30 xoffset=2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=240 x=97 y=109 width=21 height=30 xoffset=-2 yoffset=10 xadvance=20 page=0 chnl=0 +char id=241 x=120 y=109 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=242 x=282 y=41 width=19 height=32 xoffset=-2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=243 x=261 y=41 width=19 height=32 xoffset=-2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=244 x=240 y=41 width=19 height=32 xoffset=-2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=245 x=205 y=109 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=246 x=226 y=109 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=247 x=42 y=203 width=20 height=22 xoffset=-2 yoffset=18 xadvance=20 page=0 chnl=0 +char id=248 x=64 y=203 width=19 height=22 xoffset=-2 yoffset=18 xadvance=18 page=0 chnl=0 +char id=249 x=219 y=41 width=19 height=32 xoffset=-2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=250 x=198 y=41 width=19 height=32 xoffset=-2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=251 x=177 y=41 width=19 height=32 xoffset=-2 yoffset=8 xadvance=18 page=0 chnl=0 +char id=252 x=353 y=109 width=19 height=30 xoffset=-2 yoffset=10 xadvance=18 page=0 chnl=0 +char id=253 x=32 y=2 width=20 height=36 xoffset=-2 yoffset=7 xadvance=20 page=0 chnl=0 +char id=254 x=156 y=41 width=19 height=32 xoffset=-2 yoffset=11 xadvance=18 page=0 chnl=0 +char id=255 x=200 y=2 width=20 height=33 xoffset=-2 yoffset=10 xadvance=20 page=0 chnl=0 +char id=8226 x=408 y=203 width=14 height=14 xoffset=0 yoffset=20 xadvance=18 page=0 chnl=0 +char id=8364 x=107 y=141 width=20 height=30 xoffset=-3 yoffset=10 xadvance=18 page=0 chnl=0 +kernings count=0 diff --git a/source/core/assets/images/ui/buttons/dot_gothic_32.png b/source/core/assets/images/ui/buttons/dot_gothic_32.png new file mode 100644 index 000000000..fb9b126d2 Binary files /dev/null and b/source/core/assets/images/ui/buttons/dot_gothic_32.png differ diff --git a/source/core/assets/images/ui/buttons/glass.atlas b/source/core/assets/images/ui/buttons/glass.atlas new file mode 100644 index 000000000..2983f15a7 --- /dev/null +++ b/source/core/assets/images/ui/buttons/glass.atlas @@ -0,0 +1,566 @@ + +glass.png +size: 1024, 1024 +format: RGBA8888 +filter: Linear, Linear +repeat: none +dot_gothic_16 + rotate: false + xy: 1, 893 + size: 505, 107 + orig: 505, 107 + offset: 0, 0 + index: -1 +dot_gothic_32 + rotate: false + xy: 1, 651 + size: 505, 240 + orig: 505, 240 + offset: 0, 0 + index: -1 +UI_Glass_Arrow_Large_01a + rotate: false + xy: 165, 583 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Arrow_Medium_01a + rotate: false + xy: 263, 617 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Arrow_Small_01a + rotate: false + xy: 704, 900 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Banner_01a + rotate: false + xy: 508, 968 + size: 96, 32 + orig: 96, 32 + offset: 0, 0 + index: -1 +UI_Glass_Banner_01b + rotate: false + xy: 770, 934 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Textfield_01a + rotate: false + xy: 770, 934 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Large_Lock_01a1 + rotate: false + xy: 1, 617 + size: 96, 32 + orig: 96, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Large_Release_01a3 + rotate: false + xy: 1, 617 + size: 96, 32 + orig: 96, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Large_Lock_01a2 + rotate: false + xy: 508, 934 + size: 96, 32 + orig: 96, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Large_Release_01a2 + rotate: false + xy: 508, 934 + size: 96, 32 + orig: 96, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Large_Lock_01a3 + rotate: false + xy: 606, 968 + size: 96, 32 + orig: 96, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Large_Release_01a1 + rotate: false + xy: 606, 968 + size: 96, 32 + orig: 96, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Large_Lock_01a4 + rotate: false + xy: 1, 583 + size: 96, 32 + orig: 96, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Large_Press_01a1 + rotate: false + xy: 99, 617 + size: 96, 32 + orig: 96, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Large_Press_01a2 + rotate: false + xy: 508, 900 + size: 96, 32 + orig: 96, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Large_Press_01a3 + rotate: false + xy: 606, 934 + size: 96, 32 + orig: 96, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Large_Press_01a4 + rotate: false + xy: 704, 968 + size: 96, 32 + orig: 96, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Large_Release_01a4 + rotate: false + xy: 704, 968 + size: 96, 32 + orig: 96, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Medium_Lock_01a1 + rotate: false + xy: 99, 583 + size: 64, 32 + orig: 64, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Medium_Release_01a3 + rotate: false + xy: 99, 583 + size: 64, 32 + orig: 64, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Medium_Lock_01a2 + rotate: false + xy: 197, 617 + size: 64, 32 + orig: 64, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Medium_Release_01a2 + rotate: false + xy: 197, 617 + size: 64, 32 + orig: 64, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Medium_Lock_01a3 + rotate: false + xy: 704, 934 + size: 64, 32 + orig: 64, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Medium_Release_01a1 + rotate: false + xy: 704, 934 + size: 64, 32 + orig: 64, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Medium_Lock_01a4 + rotate: false + xy: 802, 968 + size: 64, 32 + orig: 64, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Medium_Press_01a1 + rotate: false + xy: 1, 515 + size: 64, 32 + orig: 64, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Medium_Press_01a2 + rotate: false + xy: 508, 768 + size: 64, 32 + orig: 64, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Medium_Press_01a3 + rotate: false + xy: 606, 802 + size: 64, 32 + orig: 64, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Medium_Press_01a4 + rotate: false + xy: 99, 549 + size: 64, 32 + orig: 64, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Medium_Release_01a4 + rotate: false + xy: 99, 549 + size: 64, 32 + orig: 64, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Small_Lock_01a1 _1 + rotate: false + xy: 868, 968 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Small_Release_01a3 + rotate: false + xy: 868, 968 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Small_Lock_01a2_2 + rotate: false + xy: 1, 481 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Small_Release_01a2 + rotate: false + xy: 1, 481 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Small_Lock_01a3_3 + rotate: false + xy: 67, 515 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Small_Release_01a1 + rotate: false + xy: 67, 515 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Small_Lock_01a4_4 + rotate: false + xy: 508, 734 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Small_Press_01a1_ + rotate: false + xy: 574, 768 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Small_Press_01a2 + rotate: false + xy: 165, 549 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Small_Press_01a3 + rotate: false + xy: 199, 583 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Small_Press_01a4 + rotate: false + xy: 297, 617 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Button_Small_Release_01a4 + rotate: false + xy: 297, 617 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Checkmark_Large_01a + rotate: false + xy: 704, 866 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Checkmark_Medium_01a + rotate: false + xy: 738, 900 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Checkmark_Small_01a + rotate: false + xy: 804, 934 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Cross_Large_01a + rotate: false + xy: 902, 968 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Cross_Medium_01a + rotate: false + xy: 1, 447 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Cross_Small_01a + rotate: false + xy: 35, 481 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Dropdown_01a + rotate: false + xy: 101, 515 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Dropdown_Handle_01a + rotate: false + xy: 508, 700 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Fillbar_01a + rotate: false + xy: 542, 734 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Fillbar_Filler_01a + rotate: false + xy: 608, 768 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Frame_Horizontal_01a + rotate: false + xy: 1, 549 + size: 96, 32 + orig: 96, 32 + offset: 0, 0 + index: -1 +UI_Glass_Frame_Inward_01a + rotate: false + xy: 508, 802 + size: 96, 96 + orig: 96, 96 + offset: 0, 0 + index: -1 +UI_Glass_Frame_Lite_01a + rotate: false + xy: 199, 549 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Frame_Standard_01a + rotate: false + xy: 606, 836 + size: 96, 96 + orig: 96, 96 + offset: 0, 0 + index: -1 +UI_Glass_Frame_Vertical_01a + rotate: false + xy: 1, 349 + size: 32, 96 + orig: 32, 96 + offset: 0, 0 + index: -1 +UI_Glass_Minus_Large_01a + rotate: false + xy: 233, 583 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Minus_Medium_01a + rotate: false + xy: 331, 617 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Minus_Small_01a + rotate: false + xy: 738, 866 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Plus_Large_01a + rotate: false + xy: 772, 900 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Plus_Medium_01a + rotate: false + xy: 838, 934 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Plus_Small_01a + rotate: false + xy: 936, 968 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Scrollbar_01a + rotate: false + xy: 35, 447 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Scrollbar_Handle_01a + rotate: false + xy: 69, 481 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Select_01a1 + rotate: false + xy: 135, 515 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Select_01a2 + rotate: false + xy: 508, 666 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Select_01a4 + rotate: false + xy: 508, 666 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Select_01a3 + rotate: false + xy: 542, 700 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Slider_01a + rotate: false + xy: 576, 734 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Slider_Filler_01a + rotate: false + xy: 1, 315 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Slider_Handle_01a + rotate: false + xy: 233, 549 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Slot_Available_01a + rotate: false + xy: 267, 583 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Slot_Selected_01a + rotate: false + xy: 365, 617 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Slot_Unavailable_01a + rotate: false + xy: 772, 866 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Toggle_Bar_01a + rotate: false + xy: 806, 900 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Toggle_Cover_01a + rotate: false + xy: 872, 934 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +UI_Glass_Toggle_Handle_01a + rotate: false + xy: 970, 968 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 diff --git a/source/core/assets/images/ui/buttons/glass.json b/source/core/assets/images/ui/buttons/glass.json new file mode 100644 index 000000000..f76bad834 --- /dev/null +++ b/source/core/assets/images/ui/buttons/glass.json @@ -0,0 +1,198 @@ +{ +com.badlogic.gdx.graphics.g2d.BitmapFont: { + font_small: { + file: dot_gothic_16.fnt + scaledSize: -1 + markupEnabled: false + flip: false + } + title: { + file: dot_gothic_32.fnt + scaledSize: -1 + markupEnabled: false + flip: false + } +} +com.badlogic.gdx.graphics.Color: { + Black: { + r: 0 + g: 0 + b: 0 + a: 1 + } + Blue: { + r: 0.2901961 + g: 0.34509805 + b: 1 + a: 1 + } + Grey: { + r: 0.73333335 + g: 0.73333335 + b: 0.73333335 + a: 1 + } + White: { + r: 1 + g: 1 + b: 1 + a: 1 + } +} +com.badlogic.gdx.scenes.scene2d.ui.Button$ButtonStyle: { + default: { + up: UI_Glass_Button_Large_Press_01a4 + down: UI_Glass_Button_Large_Press_01a1 + over: UI_Glass_Button_Medium_Lock_01a1 + focused: UI_Glass_Button_Large_Release_01a2 + disabled: UI_Glass_Banner_01a + checked: UI_Glass_Button_Large_Release_01a1 + checkedOver: UI_Glass_Button_Large_Release_01a2 + checkedDown: UI_Glass_Button_Large_Release_01a3 + checkedFocused: UI_Glass_Button_Large_Release_01a4 + pressedOffsetY: -2 + unpressedOffsetY: 1 + } +} +com.badlogic.gdx.scenes.scene2d.ui.CheckBox$CheckBoxStyle: { + default: { + parent: default + checkboxOn: UI_Glass_Slot_Available_01a + checkboxOff: UI_Glass_Slot_Available_01a + checkboxOnOver: UI_Glass_Slot_Selected_01a + checkboxOver: UI_Glass_Slot_Unavailable_01a + checkboxOnDisabled: UI_Glass_Slot_Unavailable_01a + font: font_small + } +} +com.badlogic.gdx.scenes.scene2d.ui.ImageButton$ImageButtonStyle: { + default: { + parent: default + pressedOffsetY: -1 + } +} +com.badlogic.gdx.scenes.scene2d.ui.ImageTextButton$ImageTextButtonStyle: { + default: { + parent: default + font: font_small + fontColor: White + downFontColor: Blue + overFontColor: White + focusedFontColor: White + disabledFontColor: Grey + up: UI_Glass_Button_Large_Press_01a4 + down: UI_Glass_Button_Large_Press_01a1 + over: UI_Glass_Button_Large_Press_01a3 + focused: UI_Glass_Button_Large_Press_01a2 + disabled: UI_Glass_Banner_01a + checked: UI_Glass_Button_Large_Press_01a2 + checkedOver: UI_Glass_Button_Large_Press_01a3 + checkedDown: UI_Glass_Button_Large_Press_01a1 + checkedFocused: UI_Glass_Button_Large_Press_01a2 + pressedOffsetY: -2 + } +} +com.badlogic.gdx.scenes.scene2d.ui.Label$LabelStyle: { + default: { + font: title + fontColor: White + } + title: { + parent: default + font: title + fontColor: White + } +} +com.badlogic.gdx.scenes.scene2d.ui.List$ListStyle: { + default: { + font: font_small + fontColorSelected: White + fontColorUnselected: Grey + selection: UI_Glass_Banner_01a + down: UI_Glass_Button_Large_Lock_01a3 + over: UI_Glass_Button_Large_Lock_01a2 + background: UI_Glass_Frame_Standard_01a + } +} +com.badlogic.gdx.scenes.scene2d.ui.ProgressBar$ProgressBarStyle: { + default-horizontal: { + background: UI_Glass_Fillbar_01a + disabledBackground: UI_Glass_Fillbar_01a + knob: UI_Glass_Scrollbar_Handle_01a + disabledKnob: UI_Glass_Slider_Handle_01a + } +} +com.badlogic.gdx.scenes.scene2d.ui.ScrollPane$ScrollPaneStyle: { + default: { + background: UI_Glass_Frame_Standard_01a + corner: UI_Glass_Scrollbar_01a + hScroll: UI_Glass_Banner_01a + hScrollKnob: UI_Glass_Scrollbar_Handle_01a + vScroll: UI_Glass_Frame_Vertical_01a + vScrollKnob: UI_Glass_Scrollbar_Handle_01a + } +} +com.badlogic.gdx.scenes.scene2d.ui.SelectBox$SelectBoxStyle: { + default: { + font: font_small + fontColor: Grey + overFontColor: White + disabledFontColor: Grey + background: UI_Glass_Button_Large_Press_01a4 + scrollStyle: default + listStyle: default + backgroundOver: UI_Glass_Button_Large_Lock_01a2 + backgroundOpen: UI_Glass_Button_Large_Lock_01a4 + backgroundDisabled: UI_Glass_Banner_01a + } +} +com.badlogic.gdx.scenes.scene2d.ui.Slider$SliderStyle: { + default-horizontal: { + parent: default-horizontal + } +} +com.badlogic.gdx.scenes.scene2d.ui.TextButton$TextButtonStyle: { + default: { + parent: default + font: font_small + fontColor: Grey + downFontColor: White + overFontColor: White + focusedFontColor: White + disabledFontColor: Grey + checkedFontColor: White + checkedDownFontColor: White + checkedOverFontColor: White + checkedFocusedFontColor: White + up: UI_Glass_Button_Large_Press_01a4 + down: UI_Glass_Button_Large_Press_01a1 + over: UI_Glass_Button_Large_Press_01a3 + focused: UI_Glass_Button_Large_Press_01a3 + disabled: UI_Glass_Banner_01a + checked: UI_Glass_Button_Large_Press_01a1 + checkedOver: UI_Glass_Button_Large_Press_01a3 + checkedDown: UI_Glass_Button_Large_Press_01a1 + checkedFocused: UI_Glass_Button_Large_Press_01a3 + pressedOffsetY: -2 + } +} +com.badlogic.gdx.scenes.scene2d.ui.TextField$TextFieldStyle: { + default: { + font: font_small + fontColor: White + } +} +com.badlogic.gdx.scenes.scene2d.ui.TextTooltip$TextTooltipStyle: { + default: { + label: default + } +} +com.badlogic.gdx.scenes.scene2d.ui.Window$WindowStyle: { + default: { + background: UI_Glass_Frame_Standard_01a + titleFont: font_small + titleFontColor: White + stageBackground: UI_Glass_Frame_Standard_01a + } +} +} \ No newline at end of file diff --git a/source/core/assets/images/ui/buttons/glass.png b/source/core/assets/images/ui/buttons/glass.png new file mode 100644 index 000000000..6841f8827 Binary files /dev/null and b/source/core/assets/images/ui/buttons/glass.png differ diff --git a/source/core/assets/sounds/Impact4.ogg b/source/core/assets/sounds/Impact4.ogg deleted file mode 100644 index e725c2e15..000000000 Binary files a/source/core/assets/sounds/Impact4.ogg and /dev/null differ diff --git a/source/core/assets/sounds/background/desert/Elements.ogg b/source/core/assets/sounds/background/desert/Elements.ogg new file mode 100644 index 000000000..2bb14479e Binary files /dev/null and b/source/core/assets/sounds/background/desert/Elements.ogg differ diff --git a/source/core/assets/sounds/background/desert/Rocks1.ogg b/source/core/assets/sounds/background/desert/Rocks1.ogg new file mode 100644 index 000000000..04512861f Binary files /dev/null and b/source/core/assets/sounds/background/desert/Rocks1.ogg differ diff --git a/source/core/assets/sounds/background/desert/Rocks2.ogg b/source/core/assets/sounds/background/desert/Rocks2.ogg new file mode 100644 index 000000000..f2d392521 Binary files /dev/null and b/source/core/assets/sounds/background/desert/Rocks2.ogg differ diff --git a/source/core/assets/sounds/background/desert/desert_bgm.ogg b/source/core/assets/sounds/background/desert/desert_bgm.ogg new file mode 100644 index 000000000..4c29274d1 Binary files /dev/null and b/source/core/assets/sounds/background/desert/desert_bgm.ogg differ diff --git a/source/core/assets/sounds/background/ice/Sequences1.ogg b/source/core/assets/sounds/background/ice/Sequences1.ogg new file mode 100644 index 000000000..9bb8e83e3 Binary files /dev/null and b/source/core/assets/sounds/background/ice/Sequences1.ogg differ diff --git a/source/core/assets/sounds/background/ice/Sequences2.ogg b/source/core/assets/sounds/background/ice/Sequences2.ogg new file mode 100644 index 000000000..204c47c32 Binary files /dev/null and b/source/core/assets/sounds/background/ice/Sequences2.ogg differ diff --git a/source/core/assets/sounds/background/ice/Sequences3.ogg b/source/core/assets/sounds/background/ice/Sequences3.ogg new file mode 100644 index 000000000..74b8a189f Binary files /dev/null and b/source/core/assets/sounds/background/ice/Sequences3.ogg differ diff --git a/source/core/assets/sounds/background/ice/ice_bgm.ogg b/source/core/assets/sounds/background/ice/ice_bgm.ogg new file mode 100644 index 000000000..2c269ff59 Binary files /dev/null and b/source/core/assets/sounds/background/ice/ice_bgm.ogg differ diff --git a/source/core/assets/sounds/background/lava/Burst.ogg b/source/core/assets/sounds/background/lava/Burst.ogg new file mode 100644 index 000000000..a0e388f18 Binary files /dev/null and b/source/core/assets/sounds/background/lava/Burst.ogg differ diff --git a/source/core/assets/sounds/background/lava/Glitch_ripples.ogg b/source/core/assets/sounds/background/lava/Glitch_ripples.ogg new file mode 100644 index 000000000..4b99478f0 Binary files /dev/null and b/source/core/assets/sounds/background/lava/Glitch_ripples.ogg differ diff --git a/source/core/assets/sounds/background/lava/Sizzling.ogg b/source/core/assets/sounds/background/lava/Sizzling.ogg new file mode 100644 index 000000000..963131fcc Binary files /dev/null and b/source/core/assets/sounds/background/lava/Sizzling.ogg differ diff --git a/source/core/assets/sounds/background/lava/Swoosh.ogg b/source/core/assets/sounds/background/lava/Swoosh.ogg new file mode 100644 index 000000000..155fe7dcf Binary files /dev/null and b/source/core/assets/sounds/background/lava/Swoosh.ogg differ diff --git a/source/core/assets/sounds/background/lava/lava_bgm.ogg b/source/core/assets/sounds/background/lava/lava_bgm.ogg new file mode 100644 index 000000000..ed08ee521 Binary files /dev/null and b/source/core/assets/sounds/background/lava/lava_bgm.ogg differ diff --git a/source/core/assets/sounds/background/loss/Gate Lockdown.wav b/source/core/assets/sounds/background/loss/Gate Lockdown.wav new file mode 100644 index 000000000..76883c124 Binary files /dev/null and b/source/core/assets/sounds/background/loss/Gate Lockdown.wav differ diff --git a/source/core/assets/sounds/background/loss/Mars Horizon.wav b/source/core/assets/sounds/background/loss/Mars Horizon.wav new file mode 100644 index 000000000..dca1f3649 Binary files /dev/null and b/source/core/assets/sounds/background/loss/Mars Horizon.wav differ diff --git a/source/core/assets/sounds/background/loss/RisingScreams.ogg b/source/core/assets/sounds/background/loss/RisingScreams.ogg new file mode 100644 index 000000000..96b115168 Binary files /dev/null and b/source/core/assets/sounds/background/loss/RisingScreams.ogg differ diff --git a/source/core/assets/sounds/background/pre_game/Sci-Fi7Loop.ogg b/source/core/assets/sounds/background/pre_game/Sci-Fi7Loop.ogg new file mode 100644 index 000000000..6a2b2a358 Binary files /dev/null and b/source/core/assets/sounds/background/pre_game/Sci-Fi7Loop.ogg differ diff --git a/source/core/assets/sounds/background/pre_game/Sci-Fi8Loop_story.ogg b/source/core/assets/sounds/background/pre_game/Sci-Fi8Loop_story.ogg new file mode 100644 index 000000000..c0cce2c97 Binary files /dev/null and b/source/core/assets/sounds/background/pre_game/Sci-Fi8Loop_story.ogg differ diff --git a/source/core/assets/sounds/background/title_screen/Sci-Fi4Loop.ogg b/source/core/assets/sounds/background/title_screen/Sci-Fi4Loop.ogg new file mode 100644 index 000000000..e9c00489a Binary files /dev/null and b/source/core/assets/sounds/background/title_screen/Sci-Fi4Loop.ogg differ diff --git a/source/core/assets/sounds/background/title_screen/Sci-Fi5Loop.ogg b/source/core/assets/sounds/background/title_screen/Sci-Fi5Loop.ogg new file mode 100644 index 000000000..84bec154c Binary files /dev/null and b/source/core/assets/sounds/background/title_screen/Sci-Fi5Loop.ogg differ diff --git a/source/core/assets/sounds/background/title_screen/Sci-Fi6Loop.ogg b/source/core/assets/sounds/background/title_screen/Sci-Fi6Loop.ogg new file mode 100644 index 000000000..93d900878 Binary files /dev/null and b/source/core/assets/sounds/background/title_screen/Sci-Fi6Loop.ogg differ diff --git a/source/core/assets/sounds/background/title_screen/ScifiAmbient.ogg b/source/core/assets/sounds/background/title_screen/ScifiAmbient.ogg new file mode 100644 index 000000000..0c5599987 Binary files /dev/null and b/source/core/assets/sounds/background/title_screen/ScifiAmbient.ogg differ diff --git a/source/core/assets/sounds/economy/buildSound.ogg b/source/core/assets/sounds/economy/buildSound.ogg new file mode 100644 index 000000000..6f04b9128 Binary files /dev/null and b/source/core/assets/sounds/economy/buildSound.ogg differ diff --git a/source/core/assets/sounds/mobs/boss_announce/Boss_entrance.ogg b/source/core/assets/sounds/mobs/boss_announce/Boss_entrance.ogg new file mode 100644 index 000000000..ebb89a306 Binary files /dev/null and b/source/core/assets/sounds/mobs/boss_announce/Boss_entrance.ogg differ diff --git a/source/core/assets/sounds/ui/Click/NA_SFUI_Vol1_Click_01.ogg b/source/core/assets/sounds/ui/Click/NA_SFUI_Vol1_Click_01.ogg new file mode 100644 index 000000000..c7fcef173 Binary files /dev/null and b/source/core/assets/sounds/ui/Click/NA_SFUI_Vol1_Click_01.ogg differ diff --git a/source/core/assets/sounds/ui/Hover/NA_SFUI_Vol1_hover_01.ogg b/source/core/assets/sounds/ui/Hover/NA_SFUI_Vol1_hover_01.ogg new file mode 100644 index 000000000..eda16cd7d Binary files /dev/null and b/source/core/assets/sounds/ui/Hover/NA_SFUI_Vol1_hover_01.ogg differ diff --git a/source/core/assets/sounds/ui/Open_Close/NA_SFUI_Vol1_Close_01.ogg b/source/core/assets/sounds/ui/Open_Close/NA_SFUI_Vol1_Close_01.ogg new file mode 100644 index 000000000..4ba36cf7b Binary files /dev/null and b/source/core/assets/sounds/ui/Open_Close/NA_SFUI_Vol1_Close_01.ogg differ diff --git a/source/core/assets/sounds/ui/Open_Close/NA_SFUI_Vol1_Open_01.ogg b/source/core/assets/sounds/ui/Open_Close/NA_SFUI_Vol1_Open_01.ogg new file mode 100644 index 000000000..e945666e9 Binary files /dev/null and b/source/core/assets/sounds/ui/Open_Close/NA_SFUI_Vol1_Open_01.ogg differ diff --git a/source/core/assets/sounds/ui/Switch/NA_SFUI_Vol1_switch_01.ogg b/source/core/assets/sounds/ui/Switch/NA_SFUI_Vol1_switch_01.ogg new file mode 100644 index 000000000..3dd56c1bb Binary files /dev/null and b/source/core/assets/sounds/ui/Switch/NA_SFUI_Vol1_switch_01.ogg differ diff --git a/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java b/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java index 6d12bf198..cc626a02e 100644 --- a/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java +++ b/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java @@ -1,5 +1,12 @@ package com.csse3200.game.areas; +import com.badlogic.gdx.math.GridPoint2; +import com.badlogic.gdx.math.Vector2; +import com.csse3200.game.areas.terrain.TerrainFactory; +import com.csse3200.game.areas.terrain.TerrainFactory.TerrainType; +import com.csse3200.game.entities.Entity; +import com.csse3200.game.entities.factories.*; +import com.csse3200.game.physics.PhysicsLayer; import com.badlogic.gdx.audio.Music; import com.badlogic.gdx.math.GridPoint2; import com.badlogic.gdx.math.Vector2; @@ -11,6 +18,10 @@ import com.csse3200.game.components.ProjectileEffects; import com.csse3200.game.entities.Entity; import com.csse3200.game.entities.factories.*; + +import com.csse3200.game.physics.PhysicsLayer; +import com.csse3200.game.screens.AssetLoader; + import com.csse3200.game.utils.math.RandomUtils; import com.csse3200.game.services.ResourceService; import com.csse3200.game.services.ServiceLocator; @@ -20,6 +31,11 @@ import java.security.SecureRandom; import java.util.Random; import java.util.Timer; + +import static com.csse3200.game.entities.factories.NPCFactory.createGhost; +import static com.csse3200.game.screens.AssetLoader.loadAllAssets; +import java.util.ArrayList; + import java.util.TimerTask; /** Forest area for the demo game with trees, a player, and some enemies. */ @@ -39,8 +55,6 @@ public class ForestGameArea extends GameArea { private int wave = 0; private Timer waveTimer; - private Timer bossSpawnTimer; - private int bossSpawnInterval = 10000; // 1 minute in milliseconds private static final int NUM_WEAPON_TOWERS = 3; private static final GridPoint2 PLAYER_SPAWN = new GridPoint2(2, 4); // Temporary spawn point for testing @@ -64,6 +78,7 @@ public class ForestGameArea extends GameArea { "images/ghost_1.png", "images/terrain 2 normal.png", "images/terrain 2 hex.png", + "images/terrain_use.png", "images/hex_grass_2.png", "images/hex_grass_3.png", "images/iso_grass_1.png", @@ -124,10 +139,8 @@ public class ForestGameArea extends GameArea { "images/GrassTile/grass_tile_5.png", "images/GrassTile/grass_tile_6.png", "images/GrassTile/grass_tile_7.png", - "images/highlight_tile.png", "images/mobboss/iceBaby.png", "images/bombship/bombship.png" - }; private static final String[] forestTextureAtlases = { "images/economy/econ-tower.atlas", @@ -217,10 +230,8 @@ public class ForestGameArea extends GameArea { "sounds/mobBoss/patrickHit.mp3" }; private static final String backgroundMusic = "sounds/background/Sci-Fi1.ogg"; - private static final String[] forestMusic = {backgroundMusic}; - -// private final TerrainFactory terrainFactory; + private static final String[] forestMusic = {backgroundMusic}; private Entity player; private Entity waves; @@ -293,19 +304,18 @@ private void stopWaveTimer() { // } // } - /** * Create the game area, including terrain, static entities (trees), dynamic entities (player) */ @Override public void create() { // Load game assets + + loadAllAssets(); loadAssets(); - logger.info("Lol"); + logger.info("selected towers in main game are " + ServiceLocator.getTowerTypes()); displayUI(); - logger.info("Lol"); spawnTerrain(); - logger.info("Lol"); // Set up infrastructure for end game tracking // player = spawnPlayer(); @@ -314,15 +324,16 @@ public void create() { spawnEntity(waves); waves.getEvents().addListener("spawnWave", this::spawnMob); - playMusic(); spawnScrap(); + spawnGapScanners(); + // spawnTNTTower(); // spawnWeaponTower(); // spawnGapScanners(); // spawnDroidTower(); - spawnFireWorksTower(); - spawnPierceTower(); - spawnRicochetTower(); +// spawnFireWorksTower(); // Commented these out until they are needed for Demonstration +// spawnPierceTower(); +// spawnRicochetTower(); // spawnBombship(); } @@ -347,7 +358,7 @@ private void spawnTerrain() { // Left spawnEntityAt( ObstacleFactory.createWall(WALL_WIDTH, worldBounds.y), - new GridPoint2(0, 2), + new GridPoint2(0, 0), false, false); // Right @@ -358,28 +369,15 @@ private void spawnTerrain() { false); // Top spawnEntityAt( - ObstacleFactory.createWall(worldBounds.x, WALL_WIDTH * 7), + ObstacleFactory.createWall(worldBounds.x, WALL_WIDTH * 0), new GridPoint2(0, tileBounds.y), false, false); // Bottom - spawnEntityAt( - ObstacleFactory.createWall(worldBounds.x, WALL_WIDTH ), - new GridPoint2(0, 2), - false, - false); - } + Entity wall = ObstacleFactory.createWall(worldBounds.x, WALL_WIDTH * 0); + wall.setPosition(0,-0.1f); + ServiceLocator.getEntityService().register(wall); - - private void spawnBuilding2() { - GridPoint2 minPos = new GridPoint2(0, 0); - GridPoint2 maxPos = terrain.getMapBounds(0).sub(2, 2); - - for (int i = 0; i < NUM_BUILDINGS; i++) { - GridPoint2 randomPos = RandomUtils.random(minPos, maxPos); - Entity building2 = ObstacleFactory.createBuilding2(); - spawnEntityAt(building2, randomPos, true, false); - } } private Entity spawnPlayer() { @@ -395,6 +393,26 @@ private Entity spawnPlayer(GridPoint2 position) { return newPlayer; } + // commented 383 - 386 out as there was a missing arg? +// private void spawnDemonBoss() { +// Entity demon = MobBossFactory.createDemonBoss(); +// spawnEntityAt(demon, new GridPoint2(19, 5), true, false); +// } + + private void spawnPatrick() { + Entity patrick = MobBossFactory.createPatrickBoss(3000); + spawnEntityAt(patrick, new GridPoint2(18, 5), true, false); + } + + private void spawnPatrickDeath() { + Entity patrickDeath = MobBossFactory.patrickDead(); + spawnEntityAt(patrickDeath, new GridPoint2(18, 5), true, false); + } + // commented 398 - 401 out as there was a missing arg? +// private void spawnIceBaby() { +// Entity iceBaby = MobBossFactory.createIceBoss(); +// spawnEntityAt(iceBaby, new GridPoint2(19, 5), true, false); +// } // private void spawnDemonBoss() { // Entity demon = MobBossFactory.createDemonBoss(); @@ -702,19 +720,6 @@ public void spawnMob(String entity, GridPoint2 randomPos, int health) { // } // } - -// private Entity spawnGhostKing() { -// GridPoint2 minPos = new GridPoint2(0, 0); -// GridPoint2 maxPos = terrain.getMapBounds(0).sub(0, 0); -// GridPoint2 randomPos -// = RandomUtils.random(minPos, maxPos); -// // = new GridPoint2(26, 26); -// Entity ghostKing = NPCFactory.createGhostKing(player); -// spawnEntityAt(ghostKing, randomPos, true, true); -// return ghostKing; -// -// } - /** * Creates multiple projectiles that travel simultaneous. They all have same * the starting point but different destinations. @@ -800,7 +805,6 @@ private void spawnSplitFireWorksFireBall(Vector2 position, short targetLayer, in spawnEntity(projectile); } - private void spawnWeaponTower() { GridPoint2 minPos = new GridPoint2(0, 0); GridPoint2 maxPos = terrain.getMapBounds(0).sub(5, 1); @@ -818,7 +822,7 @@ private void spawnWeaponTower() { } // * TEMPORARY FOR TESTING - private void spawnFireTowerTowerAt(int x, int y) { + private void spawnFireTowerAt(int x, int y) { GridPoint2 pos = new GridPoint2(x, y); Entity fireTower = TowerFactory.createFireTower(); @@ -894,7 +898,6 @@ private void spawnDroidTower() { } } - private void playMusic() { Music music = ServiceLocator.getResourceService().getAsset(backgroundMusic, Music.class); music.setLooping(true); @@ -928,7 +931,6 @@ private void unloadAssets() { @Override public void dispose() { super.dispose(); - ServiceLocator.getResourceService().getAsset(backgroundMusic, Music.class).stop(); this.unloadAssets(); stopWaveTimer(); } @@ -973,4 +975,4 @@ private void spawnGapScanners() { } -} \ No newline at end of file +} diff --git a/source/core/src/main/com/csse3200/game/areas/terrain/TerrainFactory.java b/source/core/src/main/com/csse3200/game/areas/terrain/TerrainFactory.java index dfbd4f782..f38977a92 100644 --- a/source/core/src/main/com/csse3200/game/areas/terrain/TerrainFactory.java +++ b/source/core/src/main/com/csse3200/game/areas/terrain/TerrainFactory.java @@ -50,6 +50,8 @@ public TerrainFactory(CameraComponent cameraComponent, TerrainComponent.TerrainO */ public TerrainComponent createTerrain(TerrainType terrainType) { ResourceService resourceService = ServiceLocator.getResourceService(); + resourceService.loadTextures(new String[]{"images/terrain_use.png"}); + resourceService.loadAll(); switch (terrainType) { case ALL_DEMO: TextureRegion orthogonal = diff --git a/source/core/src/main/com/csse3200/game/components/gamearea/CurrencyDisplay.java b/source/core/src/main/com/csse3200/game/components/gamearea/CurrencyDisplay.java index 5f3a12996..a887ed896 100644 --- a/source/core/src/main/com/csse3200/game/components/gamearea/CurrencyDisplay.java +++ b/source/core/src/main/com/csse3200/game/components/gamearea/CurrencyDisplay.java @@ -107,11 +107,16 @@ public void updateCrystalsStats() { * @param offset value to offset the height of the label by */ public void currencyPopUp(float x , float y, int amount, int offset) { - // play sound and set the volume - long soundId = clickSound.play(); - clickSound.setVolume(soundId, 0.4f); + Label label; + if (amount > 0) { + // play sound and set the volume + long soundId = clickSound.play(); + clickSound.setVolume(soundId, 0.4f); + label = new Label(String.format("+%d", amount), skin); + } else { + label = new Label(String.format("%d", amount), skin); + } - Label label = new Label(String.format("+%d", amount), skin); // remove label after it fades out label.addAction(new SequenceAction(Actions.fadeOut(1.5f), Actions.removeActor())); diff --git a/source/core/src/main/com/csse3200/game/components/gamearea/GameAreaDisplay.java b/source/core/src/main/com/csse3200/game/components/gamearea/GameAreaDisplay.java index 47096ea75..f59c23748 100644 --- a/source/core/src/main/com/csse3200/game/components/gamearea/GameAreaDisplay.java +++ b/source/core/src/main/com/csse3200/game/components/gamearea/GameAreaDisplay.java @@ -72,190 +72,187 @@ public void create() { Image[] towers2 = new Image[2]; // Create an array for two towers Image[] towers3 = new Image[3]; // Create an array for two towers - - for (int i = 0; i < 2; i++) { - // Use "building1" for the first tower and "building2" for the second tower - skin.add("default", new Label.LabelStyle(new BitmapFont(), Color.WHITE)); - skin.add("building1", new Texture("images/towers/wall_tower.png")); - // Load textures for building1 and building2 - towers1[i] = new Image(skin, "building1"); - towers1[i].setBounds(Gdx.graphics.getWidth() * 40f / 100f, Gdx.graphics.getHeight() * 80f / 100f, 100, 100); - // stage.addActor(towers1[i]); - - final int towerIndex1 = i; // Capture the index in a final variable for the listener - towerPositions1[towerIndex1] = new Vector2(towers1[towerIndex1].getX(), towers1[towerIndex1].getY()); - - towers1[i].addListener(new InputListener() { - private float startX, startY; - - public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) { - startX = towers1[towerIndex1].getX(); - startY = towers1[towerIndex1].getY(); - Gdx.app.log("GameAreaDisplay", "Touch Down on Tower " + towerIndex1); - towerDetailsDialog1.setVisible(true); - towerDetailsDialog1.show(stage); - - return true; // Return true to indicate that the event was handled - } - - public void touchDragged(InputEvent event, float x, float y, int pointer) { - float deltaX = towers1[towerIndex1].getX() - startX; - float deltaY = towers1[towerIndex1].getY() - startY; - - // Calculate the distance moved - float distanceMoved = (float) Math.sqrt(deltaX * deltaX + deltaY * deltaY); - - // Check if the tower has been moved for a significant distance - if (!towerMoved1[towerIndex1] && distanceMoved >= 100f) { - // Decrement the number of towers and set the flag for this tower - numTowers1--; - towerMoved1[towerIndex1] = true; // Set the flag to indicate tower movement - } - - // Implement dragging logic here - towers1[towerIndex1].moveBy(x - towers1[towerIndex1].getWidth() / 2, - y - towers1[towerIndex1].getHeight() / 2); - - towerPositions1[towerIndex1] = new Vector2(towers1[towerIndex1].getX(), towers1[towerIndex1].getY()); - towerDetailsDialog1.setPosition( - towerPositions1[towerIndex1].x + towers1[towerIndex1].getWidth(), - towerPositions1[towerIndex1].y); - - } - - public void touchUp(InputEvent event, float x, float y, int pointer, int button) { - towerDetailsDialog1.hide(); - } - }); - } - for (int i = 0; i < 2; i++) { - // Use "building1" for the first tower and "building2" for the second tower - skin.add("default", new Label.LabelStyle(new BitmapFont(), Color.WHITE)); - skin.add("building2", new Texture("images/towers/wall_tower.png")); - towers2[i] = new Image(skin, "building2"); - towers2[i].setBounds(Gdx.graphics.getWidth() * 50f / 100f, Gdx.graphics.getHeight() * 80f / 100f, 100, 100); - stage.addActor(towers2[i]); - - final int towerIndex2 = i; // Capture the index in a final variable for the listener - towerPositions2[towerIndex2] = new Vector2(towers2[towerIndex2].getX(), towers2[towerIndex2].getY()); - - towers2[i].addListener(new InputListener() { - private float startX, startY; - - public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) { - startX = towers2[towerIndex2].getX(); - startY = towers2[towerIndex2].getY(); - Gdx.app.log("GameAreaDisplay", "Touch Down on Tower " + towerIndex2); - towerDetailsDialog2.setVisible(true); - towerDetailsDialog2.show(stage); - return true; // Return true to indicate that the event was handled - } - - public void touchDragged(InputEvent event, float x, float y, int pointer) { - float deltaX = towers2[towerIndex2].getX() - startX; - float deltaY = towers2[towerIndex2].getY() - startY; - - // Calculate the distance moved - float distanceMoved = (float) Math.sqrt(deltaX * deltaX + deltaY * deltaY); - - // Check if the tower has been moved for a significant distance - if (!towerMoved2[towerIndex2] && distanceMoved >= 100f) { - // Decrement the number of towers and set the flag for this tower - numTowers2--; - numTowersLabel2.setText("TowersA: " + numTowers2); - towerMoved2[towerIndex2] = true; // Set the flag to indicate tower movement - } - - // Implement dragging logic here - towers2[towerIndex2].moveBy(x - towers2[towerIndex2].getWidth() / 2, - y - towers2[towerIndex2].getHeight() / 2); - - towerPositions2[towerIndex2] = new Vector2(towers2[towerIndex2].getX(), towers2[towerIndex2].getY()); - towerDetailsDialog2.setPosition( - towerPositions2[towerIndex2].x + towers2[towerIndex2].getWidth(), - towerPositions2[towerIndex2].y - ); - } - - public void touchUp(InputEvent event, float x, float y, int pointer, int button) { - towerDetailsDialog2.hide(); - } - }); - } - - for (int i = 0; i < 2; i++) { - // Use "building1" for the first tower and "building2" for the second tower - skin.add("default", new Label.LabelStyle(new BitmapFont(), Color.WHITE)); - skin.add("building3", new Texture("images/towers/mine_tower.png")); - // Load textures for building1 and building2 - towers3[i] = new Image(skin, "building3"); - towers3[i].setBounds(Gdx.graphics.getWidth() * 60f / 100f, Gdx.graphics.getHeight() * 80f / 100f, 100, 100); - stage.addActor(towers3[i]); - - final int towerIndex3 = i; // Capture the index in a final variable for the listener - towerPositions3[towerIndex3] = new Vector2(towers3[towerIndex3].getX(), towers3[towerIndex3].getY()); - - towers3[i].addListener(new InputListener() { - private float startX, startY; - - public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) { - startX = towers3[towerIndex3].getX(); - startY = towers3[towerIndex3].getY(); - Gdx.app.log("GameAreaDisplay", "Touch Down on Tower " + towerIndex3); - towerDetailsDialog3.setVisible(true); - towerDetailsDialog3.show(stage); - return true; // Return true to indicate that the event was handled - } - - public void touchDragged(InputEvent event, float x, float y, int pointer) { - float deltaX = towers3[towerIndex3].getX() - startX; - float deltaY = towers3[towerIndex3].getY() - startY; - - // Calculate the distance moved - float distanceMoved = (float) Math.sqrt(deltaX * deltaX + deltaY * deltaY); - - // Check if the tower has been moved for a significant distance - if (!towerMoved3[towerIndex3] && distanceMoved >= 100f) { - // Decrement the number of towers and set the flag for this tower - numTowers3--; - numTowersLabel3.setText("TowersB: " + numTowers3); - towerMoved3[towerIndex3] = true; // Set the flag to indicate tower movement - } - - // Implement dragging logic here - towers3[towerIndex3].moveBy(x - towers3[towerIndex3].getWidth() / 2, - y - towers3[towerIndex3].getHeight() / 2); - - towerPositions3[towerIndex3] = new Vector2(towers3[towerIndex3].getX(), towers3[towerIndex3].getY()); - towerDetailsDialog3.setPosition( - towerPositions3[towerIndex3].x + towers3[towerIndex3].getWidth(), - towerPositions3[towerIndex3].y - ); - - } - - public void touchUp(InputEvent event, float x, float y, int pointer, int button) { - towerDetailsDialog3.hide(); - } - }); - } +// for (int i = 0; i < 2; i++) { +// // Use "building1" for the first tower and "building2" for the second tower +// skin.add("default", new Label.LabelStyle(new BitmapFont(), Color.WHITE)); +// skin.add("building1", new Texture("images/towers/wallTower.png")); +// // Load textures for building1 and building2 +// towers1[i] = new Image(skin, "building1"); +// towers1[i].setBounds(Gdx.graphics.getWidth() * 40f / 100f, Gdx.graphics.getHeight() * 80f / 100f, 100, 100); +// // stage.addActor(towers1[i]); +// +// final int towerIndex1 = i; // Capture the index in a final variable for the listener +// towerPositions1[towerIndex1] = new Vector2(towers1[towerIndex1].getX(), towers1[towerIndex1].getY()); +// +// towers1[i].addListener(new InputListener() { +// private float startX, startY; +// +// public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) { +// startX = towers1[towerIndex1].getX(); +// startY = towers1[towerIndex1].getY(); +// Gdx.app.log("GameAreaDisplay", "Touch Down on Tower " + towerIndex1); +// towerDetailsDialog1.setVisible(true); +// towerDetailsDialog1.show(stage); +// +// return true; // Return true to indicate that the event was handled +// } +// +// public void touchDragged(InputEvent event, float x, float y, int pointer) { +// float deltaX = towers1[towerIndex1].getX() - startX; +// float deltaY = towers1[towerIndex1].getY() - startY; +// +// // Calculate the distance moved +// float distanceMoved = (float) Math.sqrt(deltaX * deltaX + deltaY * deltaY); +// +// // Check if the tower has been moved for a significant distance +// if (!towerMoved1[towerIndex1] && distanceMoved >= 100f) { +// // Decrement the number of towers and set the flag for this tower +// numTowers1--; +// towerMoved1[towerIndex1] = true; // Set the flag to indicate tower movement +// } +// +// // Implement dragging logic here +// towers1[towerIndex1].moveBy(x - towers1[towerIndex1].getWidth() / 2, +// y - towers1[towerIndex1].getHeight() / 2); +// +// towerPositions1[towerIndex1] = new Vector2(towers1[towerIndex1].getX(), towers1[towerIndex1].getY()); +// towerDetailsDialog1.setPosition( +// towerPositions1[towerIndex1].x + towers1[towerIndex1].getWidth(), +// towerPositions1[towerIndex1].y); +// +// } +// +// public void touchUp(InputEvent event, float x, float y, int pointer, int button) { +// towerDetailsDialog1.hide(); +// } +// }); +// } +// for (int i = 0; i < 2; i++) { +// // Use "building1" for the first tower and "building2" for the second tower +// skin.add("default", new Label.LabelStyle(new BitmapFont(), Color.WHITE)); +// skin.add("building2", new Texture("images/towers/wallTower.png")); +// towers2[i] = new Image(skin, "building2"); +// towers2[i].setBounds(Gdx.graphics.getWidth() * 50f / 100f, Gdx.graphics.getHeight() * 80f / 100f, 100, 100); +// stage.addActor(towers2[i]); +// +// final int towerIndex2 = i; // Capture the index in a final variable for the listener +// towerPositions2[towerIndex2] = new Vector2(towers2[towerIndex2].getX(), towers2[towerIndex2].getY()); +// +// towers2[i].addListener(new InputListener() { +// private float startX, startY; +// +// public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) { +// startX = towers2[towerIndex2].getX(); +// startY = towers2[towerIndex2].getY(); +// Gdx.app.log("GameAreaDisplay", "Touch Down on Tower " + towerIndex2); +// towerDetailsDialog2.setVisible(true); +// towerDetailsDialog2.show(stage); +// return true; // Return true to indicate that the event was handled +// } +// +// public void touchDragged(InputEvent event, float x, float y, int pointer) { +// float deltaX = towers2[towerIndex2].getX() - startX; +// float deltaY = towers2[towerIndex2].getY() - startY; +// +// // Calculate the distance moved +// float distanceMoved = (float) Math.sqrt(deltaX * deltaX + deltaY * deltaY); +// +// // Check if the tower has been moved for a significant distance +// if (!towerMoved2[towerIndex2] && distanceMoved >= 100f) { +// // Decrement the number of towers and set the flag for this tower +// numTowers2--; +// numTowersLabel2.setText("TowersA: " + numTowers2); +// towerMoved2[towerIndex2] = true; // Set the flag to indicate tower movement +// } +// +// // Implement dragging logic here +// towers2[towerIndex2].moveBy(x - towers2[towerIndex2].getWidth() / 2, +// y - towers2[towerIndex2].getHeight() / 2); +// +// towerPositions2[towerIndex2] = new Vector2(towers2[towerIndex2].getX(), towers2[towerIndex2].getY()); +// towerDetailsDialog2.setPosition( +// towerPositions2[towerIndex2].x + towers2[towerIndex2].getWidth(), +// towerPositions2[towerIndex2].y +// ); +// } +// +// public void touchUp(InputEvent event, float x, float y, int pointer, int button) { +// towerDetailsDialog2.hide(); +// } +// }); +// } +// +// for (int i = 0; i < 2; i++) { +// // Use "building1" for the first tower and "building2" for the second tower +// skin.add("default", new Label.LabelStyle(new BitmapFont(), Color.WHITE)); +// skin.add("building3", new Texture("images/towers/mine_tower.png")); +// // Load textures for building1 and building2 +// towers3[i] = new Image(skin, "building3"); +// towers3[i].setBounds(Gdx.graphics.getWidth() * 60f / 100f, Gdx.graphics.getHeight() * 80f / 100f, 100, 100); +// stage.addActor(towers3[i]); +// +// final int towerIndex3 = i; // Capture the index in a final variable for the listener +// towerPositions3[towerIndex3] = new Vector2(towers3[towerIndex3].getX(), towers3[towerIndex3].getY()); +// +// towers3[i].addListener(new InputListener() { +// private float startX, startY; +// +// public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) { +// startX = towers3[towerIndex3].getX(); +// startY = towers3[towerIndex3].getY(); +// Gdx.app.log("GameAreaDisplay", "Touch Down on Tower " + towerIndex3); +// towerDetailsDialog3.setVisible(true); +// towerDetailsDialog3.show(stage); +// return true; // Return true to indicate that the event was handled +// } +// +// public void touchDragged(InputEvent event, float x, float y, int pointer) { +// float deltaX = towers3[towerIndex3].getX() - startX; +// float deltaY = towers3[towerIndex3].getY() - startY; +// +// // Calculate the distance moved +// float distanceMoved = (float) Math.sqrt(deltaX * deltaX + deltaY * deltaY); +// +// // Check if the tower has been moved for a significant distance +// if (!towerMoved3[towerIndex3] && distanceMoved >= 100f) { +// // Decrement the number of towers and set the flag for this tower +// numTowers3--; +// numTowersLabel3.setText("TowersB: " + numTowers3); +// towerMoved3[towerIndex3] = true; // Set the flag to indicate tower movement +// } +// +// // Implement dragging logic here +// towers3[towerIndex3].moveBy(x - towers3[towerIndex3].getWidth() / 2, +// y - towers3[towerIndex3].getHeight() / 2); +// +// towerPositions3[towerIndex3] = new Vector2(towers3[towerIndex3].getX(), towers3[towerIndex3].getY()); +// towerDetailsDialog3.setPosition( +// towerPositions3[towerIndex3].x + towers3[towerIndex3].getWidth(), +// towerPositions3[towerIndex3].y +// ); +// +// } +// +// public void touchUp(InputEvent event, float x, float y, int pointer, int button) { +// towerDetailsDialog3.hide(); +// } +// }); +// } // Create and add the label for the number of towers - numTowersLabel1 = new Label("TowersA: " + numTowers1, skin); - numTowersLabel1.setPosition(Gdx.graphics.getWidth() * 41f / 100f, Gdx.graphics.getHeight() * 75f / 100f); // Adjust the position as needed - // stage.addActor(numTowersLabel1); - - numTowersLabel2 = new Label("TowersA: " + numTowers2, skin); - numTowersLabel2.setPosition(Gdx.graphics.getWidth() * 51f / 100f, Gdx.graphics.getHeight() * 75f / 100f); // Adjust the position as needed - stage.addActor(numTowersLabel2); - - numTowersLabel3 = new Label("TowersB: " + numTowers3, skin); - numTowersLabel3.setPosition(Gdx.graphics.getWidth() * 61f / 100f, Gdx.graphics.getHeight() * 75f / 100f); // Adjust the position as needed - stage.addActor(numTowersLabel3); +// numTowersLabel1 = new Label("TowersA: " + numTowers1, skin); +// numTowersLabel1.setPosition(Gdx.graphics.getWidth() * 41f / 100f, Gdx.graphics.getHeight() * 75f / 100f); // Adjust the position as needed +// // stage.addActor(numTowersLabel1); +// +// numTowersLabel2 = new Label("TowersA: " + numTowers2, skin); +// numTowersLabel2.setPosition(Gdx.graphics.getWidth() * 51f / 100f, Gdx.graphics.getHeight() * 75f / 100f); // Adjust the position as needed +// stage.addActor(numTowersLabel2); +// +// numTowersLabel3 = new Label("TowersB: " + numTowers3, skin); +// numTowersLabel3.setPosition(Gdx.graphics.getWidth() * 61f / 100f, Gdx.graphics.getHeight() * 75f / 100f); // Adjust the position as needed +// stage.addActor(numTowersLabel3); } - - public void render(float delta) { // ... other rendering logic ... @@ -263,8 +260,9 @@ public void render(float delta) { stage.act(delta); stage.draw(); } + private Dialog createTowerDetailsDialog() { - Skin skin = new Skin(Gdx.files.internal("flat-earth/skin/flat-earth-ui.json")); + Skin skin = new Skin(Gdx.files.internal("images/ui/buttons/glass.json")); // Register a label style named "default" with the skin Label.LabelStyle labelStyle = new Label.LabelStyle(); @@ -282,7 +280,7 @@ private Dialog createTowerDetailsDialog() { return dialog; } private void addActors() { - title = new Label(this.gameAreaName, skin, "large"); + title = new Label(this.gameAreaName, skin, "default"); stage.addActor(title); } diff --git a/source/core/src/main/com/csse3200/game/components/gamearea/PerformanceDisplay.java b/source/core/src/main/com/csse3200/game/components/gamearea/PerformanceDisplay.java index d9fe16de0..47a4fec82 100644 --- a/source/core/src/main/com/csse3200/game/components/gamearea/PerformanceDisplay.java +++ b/source/core/src/main/com/csse3200/game/components/gamearea/PerformanceDisplay.java @@ -20,7 +20,7 @@ public void create() { } private void addActors() { - profileLabel = new Label(getStats(), skin, "small"); + profileLabel = new Label(getStats(), skin, "default"); stage.addActor(profileLabel); } diff --git a/source/core/src/main/com/csse3200/game/components/maingame/MainGameExitDisplay.java b/source/core/src/main/com/csse3200/game/components/maingame/MainGameExitDisplay.java index 105b30874..408cb8b21 100644 --- a/source/core/src/main/com/csse3200/game/components/maingame/MainGameExitDisplay.java +++ b/source/core/src/main/com/csse3200/game/components/maingame/MainGameExitDisplay.java @@ -40,7 +40,7 @@ public void changed(ChangeEvent changeEvent, Actor actor) { } }); - table.add(mainMenuBtn).padTop(10f).padRight(10f); + table.add(mainMenuBtn).padTop(125f).padRight(10f); stage.addActor(table); } diff --git a/source/core/src/main/com/csse3200/game/components/maingame/MainGamePauseDisplay.java b/source/core/src/main/com/csse3200/game/components/maingame/MainGamePauseDisplay.java new file mode 100644 index 000000000..f16605a3f --- /dev/null +++ b/source/core/src/main/com/csse3200/game/components/maingame/MainGamePauseDisplay.java @@ -0,0 +1,88 @@ +package com.csse3200.game.components.maingame; + +import com.badlogic.gdx.audio.Sound; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.badlogic.gdx.scenes.scene2d.Actor; +import com.badlogic.gdx.scenes.scene2d.ui.Table; +import com.badlogic.gdx.scenes.scene2d.ui.TextButton; +import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; +import com.csse3200.game.GdxGame; +import com.csse3200.game.entities.Entity; +import com.csse3200.game.entities.factories.PauseMenuFactory; +import com.csse3200.game.services.ServiceLocator; +import com.csse3200.game.ui.UIComponent; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Displays a button to pause the game and bring up a pause menu. + */ +public class MainGamePauseDisplay extends UIComponent { + private static final Logger logger = LoggerFactory.getLogger(MainGamePauseDisplay.class); + private static final float Z_INDEX = 2f; + private Table table; + private GdxGame game; + private final String[] sounds = { + "sounds/ui/Open_Close/NA_SFUI_Vol1_Open_01.ogg" + }; + private Sound openSound; + + + public MainGamePauseDisplay(GdxGame screenSwitchHandle) { + game = screenSwitchHandle; + } + + @Override + public void create() { + super.create(); + addActors(); + loadSounds(); + } + + private void addActors() { + table = new Table(); + table.top().right(); + table.setFillParent(true); + + TextButton mainMenuBtn = new TextButton("Pause", skin); + + // Spawns a pause menu when the button is pressed. + mainMenuBtn.addListener( + new ChangeListener() { + @Override + public void changed(ChangeEvent changeEvent, Actor actor) { + logger.debug("Pause button clicked"); + openSound.play(0.4f); +// PauseMenuFactory.createPauseMenu(game, false); + PauseMenuFactory.createPauseMenu(game); + + } + }); + + table.add(mainMenuBtn).padTop(100f).padRight(10f); + + stage.addActor(table); + } + + @Override + public void draw(SpriteBatch batch) { + // draw is handled by the stage + } + + @Override + public float getZIndex() { + return Z_INDEX; + } + + @Override + public void dispose() { + table.clear(); + super.dispose(); + } + + public void loadSounds() { + ServiceLocator.getResourceService().loadSounds(sounds); + ServiceLocator.getResourceService().loadAll(); + openSound = ServiceLocator.getResourceService().getAsset(sounds[0], Sound.class); + } +} diff --git a/source/core/src/main/com/csse3200/game/components/maingame/UIElementsDisplay.java b/source/core/src/main/com/csse3200/game/components/maingame/UIElementsDisplay.java new file mode 100644 index 000000000..280cc7197 --- /dev/null +++ b/source/core/src/main/com/csse3200/game/components/maingame/UIElementsDisplay.java @@ -0,0 +1,226 @@ +package com.csse3200.game.components.maingame; + +import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.audio.Sound; +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.badlogic.gdx.math.GridPoint2; +import com.badlogic.gdx.math.Vector3; +import com.badlogic.gdx.scenes.scene2d.Actor; +import com.badlogic.gdx.scenes.scene2d.ui.Button; +import com.badlogic.gdx.scenes.scene2d.ui.Skin; +import com.badlogic.gdx.scenes.scene2d.ui.Table; +import com.badlogic.gdx.scenes.scene2d.ui.TextButton; +import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; +import com.badlogic.gdx.utils.Array; +import com.csse3200.game.entities.Entity; +import com.csse3200.game.entities.factories.TowerFactory; +import com.csse3200.game.screens.TowerType; +import com.csse3200.game.services.ServiceLocator; +import com.csse3200.game.ui.ButtonFactory; +import com.csse3200.game.ui.UIComponent; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashSet; +import java.util.Set; + +/** + * Displays a button to represent the remaining mobs left in the current wave and a button to skip to the next wave. + */ +public class UIElementsDisplay extends UIComponent { + private static final Logger logger = LoggerFactory.getLogger(MainGameExitDisplay.class); + private static final float Z_INDEX = 2f; + private final Table buttonTable = new Table(); + private final Table towerTable = new Table(); + Skin skin = new Skin(Gdx.files.internal("images/ui/buttons/glass.json")); + private String[] sounds = { + "sounds/ui/Click/NA_SFUI_Vol1_Click_01.ogg", + "sounds/ui/Hover/NA_SFUI_Vol1_hover_01.ogg" + }; + private Sound click; + private Sound hover; +// private TextButton remainingMobsButton = new ButtonFactory().createButton("Mobs left:"); +// private final TextButton timerButton = new ButtonFactory().createButton("Next wave:"); + private TextButton remainingMobsButton; + private TextButton timerButton; + private final int timer = 110; + + @Override + public void create() { + super.create(); + addActors(); + loadSounds(); + } + + /** + * This method creates the buttons, adds them to the respective tables and draws them on the screen. + */ + private void addActors() { +// remainingMobsButton = new ButtonFactory().createButton("Mobs:" +// + ServiceLocator.getWaveService().getEnemyCount()); + remainingMobsButton = new TextButton("Mobs:" + + ServiceLocator.getWaveService().getEnemyCount(), skin); + buttonTable.top().right(); + towerTable.top(); + + buttonTable.setFillParent(true); + towerTable.setFillParent(true); + + towerTable.setDebug(true); + towerTable.padTop(50f); + + TowerType[] defaultTowers = { + TowerType.TNT, + TowerType.DROID, + TowerType.INCOME, + TowerType.WALL, + TowerType.WEAPON + }; + + // Fetch the selected tower types if set + Array<TowerType> towers = new Array<>(); + for (TowerType tower : ServiceLocator.getTowerTypes()) { + towers.add(tower); + } + + // If no towers set, populate with default towers + if (towers.isEmpty()) { + towers.addAll(defaultTowers); + } + + TextButton tower1 = new TextButton(towers.get(0).getTowerName(), skin); + TextButton tower2 = new TextButton(towers.get(1).getTowerName(), skin); + TextButton tower3 = new TextButton(towers.get(2).getTowerName(), skin); + TextButton tower4 = new TextButton(towers.get(3).getTowerName(), skin); + TextButton tower5 = new TextButton(towers.get(4).getTowerName(), skin); + + // Triggers an event when the button is pressed. + tower1.addListener( + new ChangeListener() { + @Override + public void changed(ChangeEvent changeEvent, Actor actor) { + logger.debug("Tower 1 build button clicked"); + ServiceLocator.getCurrencyService().setTowerType(towers.get(0)); + click.play(0.4f); + } + }); + + // Triggers an event when the button is pressed. + tower2.addListener( + new ChangeListener() { + @Override + public void changed(ChangeEvent changeEvent, Actor actor) { + logger.debug("Tower 2 build button clicked"); + ServiceLocator.getCurrencyService().setTowerType(towers.get(1)); + click.play(0.4f); + } + }); + + tower3.addListener( + new ChangeListener() { + @Override + public void changed(ChangeEvent changeEvent, Actor actor) { + logger.debug("Tower 3 build button clicked"); + ServiceLocator.getCurrencyService().setTowerType(towers.get(2)); + click.play(0.4f); + } + }); + + tower4.addListener( + new ChangeListener() { + @Override + public void changed(ChangeEvent changeEvent, Actor actor) { + logger.debug("Tower 4 build button clicked"); + ServiceLocator.getCurrencyService().setTowerType(towers.get(3)); + click.play(0.4f); + } + }); + + tower5.addListener( + new ChangeListener() { + @Override + public void changed(ChangeEvent changeEvent, Actor actor) { + logger.debug("Tower 5 build button clicked"); + ServiceLocator.getCurrencyService().setTowerType(towers.get(4)); + click.play(0.4f); + } + }); + + buttonTable.add(remainingMobsButton).padTop(10f).padRight(10f); + buttonTable.row(); + buttonTable.add(timerButton).padRight(10f); + + towerTable.add(tower1).padRight(10f); + towerTable.add(tower2).padRight(10f); + towerTable.add(tower3).padRight(10f); + towerTable.add(tower4).padRight(10f); + towerTable.add(tower5).padRight(10f); + + stage.addActor(buttonTable); + stage.addActor(towerTable); + + createTimerButton(); + } + + /** + * This method updates the mob count button as mobs die in the game + */ + public void updateMobCount() { + remainingMobsButton.setText("Mobs:" + ServiceLocator.getWaveService().getEnemyCount()); + } + + /** + * This method creates the timer button. + */ + public void createTimerButton() { + +// timerButton = new ButtonFactory().createButton("Next wave in:" +// + (ServiceLocator.getWaveService().getNextWaveTime() / 1000)); + timerButton = new TextButton("Next wave in:" + + (ServiceLocator.getWaveService().getNextWaveTime() / 1000), skin); + buttonTable.row(); + buttonTable.add(timerButton).padRight(10f); + } + + /** + * This method updates the text for timer button. + */ + public void updateTimerButton() { + int totalSecs = (int) (timer - (ServiceLocator.getTimeSource().getTime() / 1000)); + int seconds = totalSecs % 60; + int minutes = (totalSecs % 3600) / 60; + String finalTime = String.format("%02d:%02d", minutes, seconds); + timerButton.setText("Next wave in:" + finalTime); + } + + @Override + public void draw(SpriteBatch batch) { + // drawing is handled by the stage + } + + /** + * @return returns the Z_INDEX for this display + */ + @Override + public float getZIndex() { + return Z_INDEX; + } + + private void loadSounds() { + ServiceLocator.getResourceService().loadSounds(sounds); + ServiceLocator.getResourceService().loadAll(); + click = ServiceLocator.getResourceService().getAsset(sounds[0], Sound.class); + hover = ServiceLocator.getResourceService().getAsset(sounds[1], Sound.class); + } + + /** + * Disposes off the tables and buttons created using this display + */ + @Override + public void dispose() { + super.dispose(); + buttonTable.clear(); + towerTable.clear(); + } +} diff --git a/source/core/src/main/com/csse3200/game/components/mainmenu/MainMenuActions.java b/source/core/src/main/com/csse3200/game/components/mainmenu/MainMenuActions.java index 28aaeb805..2f57c0ecc 100644 --- a/source/core/src/main/com/csse3200/game/components/mainmenu/MainMenuActions.java +++ b/source/core/src/main/com/csse3200/game/components/mainmenu/MainMenuActions.java @@ -32,7 +32,6 @@ public void create() { private void onStart() { logger.info("Start game"); game.setScreen(GdxGame.ScreenType.STORY_SCREEN); -// game.setScreen(GdxGame.ScreenType.LEVEL_SELECT); } private void onHelp() { diff --git a/source/core/src/main/com/csse3200/game/components/mainmenu/MainMenuDisplay.java b/source/core/src/main/com/csse3200/game/components/mainmenu/MainMenuDisplay.java index 89f005390..559843d32 100644 --- a/source/core/src/main/com/csse3200/game/components/mainmenu/MainMenuDisplay.java +++ b/source/core/src/main/com/csse3200/game/components/mainmenu/MainMenuDisplay.java @@ -6,11 +6,11 @@ import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.scenes.scene2d.Actor; -import com.badlogic.gdx.scenes.scene2d.ui.Image; -import com.badlogic.gdx.scenes.scene2d.ui.Table; -import com.badlogic.gdx.scenes.scene2d.ui.TextButton; +import com.badlogic.gdx.scenes.scene2d.ui.*; import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; +import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable; import com.csse3200.game.services.ServiceLocator; import com.csse3200.game.ui.ButtonFactory; import com.csse3200.game.ui.UIComponent; @@ -66,17 +66,20 @@ private void addActors() { title.setPosition(0, 0); // Create a "Start" TextButton using the default style - TextButton startBtn = ButtonFactory.createButton("Start"); +// TextButton startBtn = ButtonFactory.createButton("Start"); + TextButton startBtn = new TextButton("Start", skin); // Create a "Help" TextButton using the default style - TextButton helpBtn = ButtonFactory.createButton("Help"); +// TextButton helpBtn = ButtonFactory.createButton("Help"); + TextButton helpBtn = new TextButton("Help", skin); // Create a "Settings" TextButton with a custom image - TextButton settingsBtn =ButtonFactory.createButton("Settings"); +// TextButton settingsBtn =ButtonFactory.createButton("Settings"); + TextButton settingsBtn =new TextButton("Settings", skin); // Create a "Quit" TextButton with a custom image - TextButton exitBtn = ButtonFactory.createButton("Quit"); - +// TextButton exitBtn = ButtonFactory.createButton("Quit"); + TextButton exitBtn = new TextButton("Quit", skin); // Triggers an event when the button is pressed startBtn.addListener( diff --git a/source/core/src/main/com/csse3200/game/components/pausemenu/PauseMenuContinueButton.java b/source/core/src/main/com/csse3200/game/components/pausemenu/PauseMenuContinueButton.java new file mode 100644 index 000000000..1c8ecc4cf --- /dev/null +++ b/source/core/src/main/com/csse3200/game/components/pausemenu/PauseMenuContinueButton.java @@ -0,0 +1,83 @@ +package com.csse3200.game.components.pausemenu; + +import com.badlogic.gdx.audio.Sound; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.badlogic.gdx.scenes.scene2d.Actor; +import com.badlogic.gdx.scenes.scene2d.ui.Table; +import com.badlogic.gdx.scenes.scene2d.ui.TextButton; +import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; +import com.csse3200.game.components.maingame.MainGamePauseDisplay; +import com.csse3200.game.entities.Entity; +import com.csse3200.game.entities.factories.PauseMenuFactory; +import com.csse3200.game.services.ServiceLocator; + +import com.csse3200.game.ui.ButtonFactory; +import com.csse3200.game.ui.UIComponent; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Displays a button in the pause menu to resume the game and put away the pause menu. + */ +public class PauseMenuContinueButton extends UIComponent { + private static final Logger logger = LoggerFactory.getLogger(PauseMenuContinueButton.class); + private static final float Z_INDEX = 2f; + private Table table; + private final String[] sounds = { + "sounds/ui/Open_Close/NA_SFUI_Vol1_Close_01.ogg" + }; + private Sound closeSound; + + @Override + public void create() { + super.create(); + addActors(); + loadSounds(); + } + + private void addActors() { + table = new Table(); + table.top().right(); + table.setFillParent(true); + ButtonFactory buttonFactory = new ButtonFactory(); +// TextButton pauseMenuBtn = buttonFactory.createButton("Continue"); + TextButton pauseMenuBtn = new TextButton("Continue", skin); + + // Triggers an event when the button is pressed. + pauseMenuBtn.addListener( + new ChangeListener() { + @Override + public void changed(ChangeEvent changeEvent, Actor actor) { + logger.debug("Continue button clicked"); + closeSound.play(0.4f); + entity.dispose(); + } + }); + + table.add(pauseMenuBtn).padTop(300f).padRight(700f); + + stage.addActor(table); + } + + @Override + public void draw(SpriteBatch batch) { + // draw is handled by the renderer component + } + + @Override + public float getZIndex() { + return Z_INDEX; + } + + @Override + public void dispose() { + table.clear(); + super.dispose(); + } + + public void loadSounds() { + ServiceLocator.getResourceService().loadSounds(sounds); + ServiceLocator.getResourceService().loadAll(); + closeSound = ServiceLocator.getResourceService().getAsset(sounds[0], Sound.class); + } +} diff --git a/source/core/src/main/com/csse3200/game/components/pausemenu/PauseMenuMainMenuButton.java b/source/core/src/main/com/csse3200/game/components/pausemenu/PauseMenuMainMenuButton.java new file mode 100644 index 000000000..56fbcbcf1 --- /dev/null +++ b/source/core/src/main/com/csse3200/game/components/pausemenu/PauseMenuMainMenuButton.java @@ -0,0 +1,73 @@ +package com.csse3200.game.components.pausemenu; + +import com.badlogic.gdx.Game; +import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.badlogic.gdx.scenes.scene2d.Actor; +import com.badlogic.gdx.scenes.scene2d.ui.Table; +import com.badlogic.gdx.scenes.scene2d.ui.TextButton; +import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; +import com.csse3200.game.GdxGame; +import com.csse3200.game.ui.ButtonFactory; +import com.csse3200.game.ui.UIComponent; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Displays a button in the pause menu to return to the main menu screen. + */ +public class PauseMenuMainMenuButton extends UIComponent { + private static final Logger logger = LoggerFactory.getLogger(PauseMenuMainMenuButton.class); + private static final float Z_INDEX = 2f; + private Table table; + + private final GdxGame game; + + public PauseMenuMainMenuButton(GdxGame screenSwitchHandle) { + game = screenSwitchHandle; + } + @Override + public void create() { + super.create(); + addActors(); + } + + private void addActors() { + table = new Table(); + table.top().right(); + table.setFillParent(true); + ButtonFactory buttonFactory = new ButtonFactory(); +// TextButton pauseMenuBtn = buttonFactory.createButton("Main Menu"); + TextButton pauseMenuBtn = new TextButton("Main Menu", skin); + + // Triggers an event when the button is pressed. + pauseMenuBtn.addListener( + new ChangeListener() { + @Override + public void changed(ChangeEvent changeEvent, Actor actor) { + logger.debug("Main menu button clicked"); + game.setScreen(GdxGame.ScreenType.MAIN_MENU); + } + }); + + table.add(pauseMenuBtn).padTop(400f).padRight(490f); + + stage.addActor(table); + } + + @Override + public void draw(SpriteBatch batch) { + // draw is handled by the renderer component + } + + @Override + public float getZIndex() { + return Z_INDEX; + } + + @Override + public void dispose() { + table.clear(); + super.dispose(); + } +} diff --git a/source/core/src/main/com/csse3200/game/components/pausemenu/PauseMenuPlanetSelectButton.java b/source/core/src/main/com/csse3200/game/components/pausemenu/PauseMenuPlanetSelectButton.java new file mode 100644 index 000000000..31a54cad1 --- /dev/null +++ b/source/core/src/main/com/csse3200/game/components/pausemenu/PauseMenuPlanetSelectButton.java @@ -0,0 +1,73 @@ +package com.csse3200.game.components.pausemenu; + +import com.badlogic.gdx.Game; +import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.badlogic.gdx.scenes.scene2d.Actor; +import com.badlogic.gdx.scenes.scene2d.ui.Table; +import com.badlogic.gdx.scenes.scene2d.ui.TextButton; +import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; +import com.csse3200.game.GdxGame; +import com.csse3200.game.ui.ButtonFactory; +import com.csse3200.game.ui.UIComponent; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Displays a button in the pause menu to return to the planet select screen. + */ +public class PauseMenuPlanetSelectButton extends UIComponent { + private static final Logger logger = LoggerFactory.getLogger(PauseMenuPlanetSelectButton.class); + private static final float Z_INDEX = 2f; + private Table table; + + private final GdxGame game; + + public PauseMenuPlanetSelectButton(GdxGame screenSwitchHandle) { + game = screenSwitchHandle; + } + @Override + public void create() { + super.create(); + addActors(); + } + + private void addActors() { + table = new Table(); + table.top().right(); + table.setFillParent(true); + ButtonFactory buttonFactory = new ButtonFactory(); +// TextButton pauseMenuBtn = buttonFactory.createButton("Planet Select"); + TextButton pauseMenuBtn = new TextButton("Planet Select", skin); + + // Triggers an event when the button is pressed. + pauseMenuBtn.addListener( + new ChangeListener() { + @Override + public void changed(ChangeEvent changeEvent, Actor actor) { + logger.debug("Planet select button clicked"); + game.setScreen(GdxGame.ScreenType.LEVEL_SELECT); + } + }); + + table.add(pauseMenuBtn).padTop(400f).padRight(675f); + + stage.addActor(table); + } + + @Override + public void draw(SpriteBatch batch) { + // draw is handled by the renderer component + } + + @Override + public float getZIndex() { + return Z_INDEX; + } + + @Override + public void dispose() { + table.clear(); + super.dispose(); + } +} diff --git a/source/core/src/main/com/csse3200/game/components/pausemenu/PauseMenuSettingsButton.java b/source/core/src/main/com/csse3200/game/components/pausemenu/PauseMenuSettingsButton.java new file mode 100644 index 000000000..5ad5022af --- /dev/null +++ b/source/core/src/main/com/csse3200/game/components/pausemenu/PauseMenuSettingsButton.java @@ -0,0 +1,73 @@ +package com.csse3200.game.components.pausemenu; + +import com.badlogic.gdx.Game; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.badlogic.gdx.scenes.scene2d.Actor; +import com.badlogic.gdx.scenes.scene2d.ui.Table; +import com.badlogic.gdx.scenes.scene2d.ui.TextButton; +import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; +import com.csse3200.game.GdxGame; +import com.csse3200.game.ui.ButtonFactory; +import com.csse3200.game.ui.UIComponent; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Displays a button in the pause menu to open the game settings. + */ +public class PauseMenuSettingsButton extends UIComponent { + private static final Logger logger = LoggerFactory.getLogger(PauseMenuSettingsButton.class); + private static final float Z_INDEX = 2f; + private Table table; + + private final GdxGame game; + + public PauseMenuSettingsButton(GdxGame screenSwitchHandle) { + game = screenSwitchHandle; + } + + @Override + public void create() { + super.create(); + addActors(); + } + + private void addActors() { + table = new Table(); + table.top().right(); + table.setFillParent(true); + ButtonFactory buttonFactory = new ButtonFactory(); +// TextButton pauseMenuBtn = buttonFactory.createButton("Settings"); + TextButton pauseMenuBtn = new TextButton("Settings", skin); + + // Triggers an event when the button is pressed. + pauseMenuBtn.addListener( + new ChangeListener() { + @Override + public void changed(ChangeEvent changeEvent, Actor actor) { + logger.debug("Settings button clicked"); + game.setScreen(GdxGame.ScreenType.SETTINGS); + } + }); + + table.add(pauseMenuBtn).padTop(300f).padRight(500f); + + stage.addActor(table); + } + + @Override + public void draw(SpriteBatch batch) { + // draw is handled by the renderer component + } + + @Override + public float getZIndex() { + return Z_INDEX; + } + + @Override + public void dispose() { + table.clear(); + super.dispose(); + } +} diff --git a/source/core/src/main/com/csse3200/game/components/pausemenu/PauseMenuTimeStopComponent.java b/source/core/src/main/com/csse3200/game/components/pausemenu/PauseMenuTimeStopComponent.java new file mode 100644 index 000000000..e2c08c105 --- /dev/null +++ b/source/core/src/main/com/csse3200/game/components/pausemenu/PauseMenuTimeStopComponent.java @@ -0,0 +1,42 @@ +package com.csse3200.game.components.pausemenu; + +import com.csse3200.game.components.Component; +import com.csse3200.game.entities.Entity; +import com.badlogic.gdx.utils.Array; +import com.csse3200.game.entities.factories.PauseMenuFactory; +import com.csse3200.game.services.ServiceLocator; + +/** + * Handles the pausing/resuming of time when the pause menu is brought up/put away. + */ +public class PauseMenuTimeStopComponent extends Component { + + private Array<Entity> freezeList; + public PauseMenuTimeStopComponent() { + } + + /** + * Handles the pausing of the game entities when the pause menu is made. + */ + @Override + public void create() { + freezeList = ServiceLocator.getEntityService().getEntities(); + for (Entity pauseTarget : freezeList) { + if (pauseTarget.getId() != getEntity().getId()) { + // ZA WARUDO! TOKI WO TOMARE! + pauseTarget.setEnabled(false); + } + } + } + + /** + * Handles the un-pausing of the game entities when the pause menu is closed. + * Also notifies the pause menu factory that the pause menu is being disposed. + */ + @Override + public void dispose() { + for (Entity pauseTarget : freezeList) { + pauseTarget.setEnabled(true); + } + } +} diff --git a/source/core/src/main/com/csse3200/game/components/player/PlayerStatsDisplay.java b/source/core/src/main/com/csse3200/game/components/player/PlayerStatsDisplay.java index 4fe787609..285b7867b 100644 --- a/source/core/src/main/com/csse3200/game/components/player/PlayerStatsDisplay.java +++ b/source/core/src/main/com/csse3200/game/components/player/PlayerStatsDisplay.java @@ -45,7 +45,7 @@ private void addActors() { // Health text int health = entity.getComponent(CombatStatsComponent.class).getHealth(); CharSequence healthText = String.format("Health: %d", health); - healthLabel = new Label(healthText, skin, "large"); + healthLabel = new Label(healthText, skin, "default"); table.add(heartImage).size(heartSideLength).pad(5); table.add(healthLabel); diff --git a/source/core/src/main/com/csse3200/game/components/tasks/waves/WaveTask.java b/source/core/src/main/com/csse3200/game/components/tasks/waves/WaveTask.java index 8c75b46c5..360509c73 100644 --- a/source/core/src/main/com/csse3200/game/components/tasks/waves/WaveTask.java +++ b/source/core/src/main/com/csse3200/game/components/tasks/waves/WaveTask.java @@ -81,7 +81,7 @@ public void start() { this.level = (LevelWaves) this.owner.getEntity(); this.currentWave = level.getWave(currentWaveIndex); ServiceLocator.getWaveService().setEnemyCount(currentWave.getSize()); - logger.info("Wave {} starting with {} enemies", currentWaveIndex, ServiceLocator.getWaveService().getEnemyCount()); +// logger.info("Wave {} starting with {} enemies", currentWaveIndex, ServiceLocator.getWaveService().getEnemyCount()); this.waveStart.play(); // endTime = globalTime.getTime() + (SPAWNING_INTERVAL * 1000); } diff --git a/source/core/src/main/com/csse3200/game/entities/EntityService.java b/source/core/src/main/com/csse3200/game/entities/EntityService.java index 3511d598b..54b8a9ce1 100644 --- a/source/core/src/main/com/csse3200/game/entities/EntityService.java +++ b/source/core/src/main/com/csse3200/game/entities/EntityService.java @@ -1,9 +1,14 @@ package com.csse3200.game.entities; +import com.badlogic.gdx.maps.tiled.TiledMap; +import com.badlogic.gdx.maps.tiled.TiledMapTileLayer; +import com.badlogic.gdx.math.GridPoint2; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.utils.Array; +import com.csse3200.game.areas.terrain.TerrainComponent; +import com.csse3200.game.areas.terrain.TerrainFactory; import com.csse3200.game.components.npc.DropComponent; import com.csse3200.game.input.DropInputComponent; import com.csse3200.game.physics.PhysicsLayer; @@ -26,7 +31,6 @@ public class EntityService { private static final int INITIAL_CAPACITY = 16; private final Array<Entity> entities = new Array<>(false, INITIAL_CAPACITY); private static final float MAX_RADIUS = 50f; - public static void removeEntity(Entity clickedEntity) { clickedEntity.dispose(); } @@ -173,6 +177,28 @@ private boolean entityContainsPosition(Entity entity, float x, float y) { return (x >= entityX && x <= entityX + entityWidth && y >= entityY && y <= entityY + entityHeight); } + /** + * Determine whether there are any entities within the given tile position (x and y range). Checks for out of bounds + * click location + * @param x_coord the top right x coordinate of the tile + * @param y_coord the top right y coordinate of the tile + * @return true if the tile is occupied, false otherwise + */ + public boolean entitiesInTile(int x_coord, int y_coord) { + TiledMapTileLayer mp; + try { + mp = (TiledMapTileLayer)ServiceLocator.getMapService().getComponent().getMap().getLayers().get(0); + } catch (NullPointerException e) { + // MapService is not running + return true; + } + if (mp.getCell(x_coord, y_coord) != null) { + Entity entity = getEntityAtPosition(x_coord, y_coord); + return entity != null; + } + return true; + } + public Entity getEntityAtPositionLayer(float x, float y, short layer) { for (int i = 0; i < entities.size; i++) { Entity entity = entities.get(i); diff --git a/source/core/src/main/com/csse3200/game/entities/factories/PauseMenuFactory.java b/source/core/src/main/com/csse3200/game/entities/factories/PauseMenuFactory.java new file mode 100644 index 000000000..b4317a5a2 --- /dev/null +++ b/source/core/src/main/com/csse3200/game/entities/factories/PauseMenuFactory.java @@ -0,0 +1,54 @@ +package com.csse3200.game.entities.factories; + +import com.csse3200.game.GdxGame; +import com.csse3200.game.components.pausemenu.*; +import com.csse3200.game.entities.Entity; +import com.csse3200.game.rendering.TextureRenderComponent; +import com.csse3200.game.services.ServiceLocator; +import com.badlogic.gdx.utils.Array; + +/** + * Factory to create the pause menu and attach its components. + */ +public class PauseMenuFactory { + private static int lastPauseMenuID = -1; + + /** + * Creates the pause menu, if no previously made pause menu still exists. + * @param game The Gdx Game that handles screen changes + * @return entity, or null if no entity was created + */ + public static Entity createPauseMenu(GdxGame game) { + if (!previousPauseActive()) { + + Entity pauseMenu = new Entity() + .addComponent(new PauseMenuTimeStopComponent()) + .addComponent(new PauseMenuContinueButton()) + .addComponent(new PauseMenuSettingsButton(game)) + .addComponent(new PauseMenuPlanetSelectButton(game)) + .addComponent(new PauseMenuMainMenuButton(game)) + .addComponent(new TextureRenderComponent("images/ui/Sprites/UI_Glass_Toggle_Bar_01a.png")); + pauseMenu.setScale(8, 8); + pauseMenu.setPosition(6.3f, 2f); + ServiceLocator.getEntityService().register(pauseMenu); + lastPauseMenuID = pauseMenu.getId(); + return pauseMenu; + } else { + return null; + } + } + + /** + * Function for checking if the last pause menu created is still registered to the entity service. + * @return true if the last pause menu's ID is found in the entity service. + */ + private static boolean previousPauseActive() { + Array<Entity> checkList = ServiceLocator.getEntityService().getEntities(); + for (Entity check : checkList) { + if (check.getId() == lastPauseMenuID) { + return true; + } + } + return false; + } +} diff --git a/source/core/src/main/com/csse3200/game/entities/factories/TowerFactory.java b/source/core/src/main/com/csse3200/game/entities/factories/TowerFactory.java index 59fb98b9c..a92dbb234 100644 --- a/source/core/src/main/com/csse3200/game/entities/factories/TowerFactory.java +++ b/source/core/src/main/com/csse3200/game/entities/factories/TowerFactory.java @@ -1,6 +1,8 @@ package com.csse3200.game.entities.factories; - +import com.badlogic.gdx.physics.box2d.Filter; +import com.csse3200.game.components.tasks.DroidCombatTask; +import com.csse3200.game.components.tasks.TNTTowerCombatTask; import com.csse3200.game.components.tasks.*; import com.csse3200.game.components.tower.*; import com.csse3200.game.entities.configs.*; @@ -470,7 +472,9 @@ public static Entity createBaseTower() { .addComponent(new HitboxComponent().setLayer(PhysicsLayer.TOWER)) // TODO: we might have to change the names of the layers .addComponent(new PhysicsComponent().setBodyType(BodyType.StaticBody)) .addComponent(new TowerUpgraderComponent()); + tower.setLayer(1); // Set priority to 1, which is 1 below scrap (which is 0) + return tower; } public static Entity createAndPlaceTower(int lane) { diff --git a/source/core/src/main/com/csse3200/game/input/BuildInputComponent.java b/source/core/src/main/com/csse3200/game/input/BuildInputComponent.java new file mode 100644 index 000000000..451c99129 --- /dev/null +++ b/source/core/src/main/com/csse3200/game/input/BuildInputComponent.java @@ -0,0 +1,133 @@ +package com.csse3200.game.input; + +import com.badlogic.gdx.audio.Sound; +import com.badlogic.gdx.graphics.Camera; +import com.badlogic.gdx.math.Vector2; +import com.badlogic.gdx.math.Vector3; +import com.csse3200.game.areas.ForestGameArea; +import com.csse3200.game.entities.Entity; +import com.csse3200.game.entities.EntityService; +import com.csse3200.game.entities.factories.TowerFactory; +import com.csse3200.game.screens.TowerType; +import com.csse3200.game.services.ServiceLocator; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * Input component for handling in-game tower building. Based on Team 5 implementation of + * DropInputComponent + */ +public class BuildInputComponent extends InputComponent { + private static final Logger logger = LoggerFactory.getLogger(ForestGameArea.class); + private final EntityService entityService; + private final Camera camera; + private final String[] sounds = { + "sounds/economy/buildSound.ogg", + "sounds/ui/Switch/NA_SFUI_Vol1_switch_01.ogg" + }; + private Sound buildSound; + private Sound errorSound; + + /** + * Constructor for the BuildInputComponent + * @param camera the camera to be used, this is the camera that the game is rendered with + */ + public BuildInputComponent(Camera camera) { + this.entityService = ServiceLocator.getEntityService(); + this.camera = camera; + loadSounds(); + } + + /** + * Getter for the camera + * @return the camera + */ + public Camera getCamera() { + return camera; + } + + /** + * When the mouse is clicked, this method is called. + * Checks that the mouse is clicked on an empty tile + * Instantiates a new Tower entity at the clicked location if valid, and decrements the + * cost of the build from the currency pool + * + * @param screenX The x coordinate, origin is in the upper left corner + * @param screenY The y coordinate, origin is in the upper left corner + * @param pointer the pointer for the event. + * @param button the button + * @return true if successful, false otherwise + */ + @Override + public boolean touchDown(int screenX, int screenY, int pointer, int button) { + + Vector3 worldCoordinates = new Vector3((float) screenX , (float) screenY, 0); + getCamera().unproject(worldCoordinates); // translate from screen to world coordinates + Vector2 cursorPosition = new Vector2(worldCoordinates.x, worldCoordinates.y); + + // determine if the tile is unoccupied + boolean tileOccupied = entityService.entitiesInTile((int)cursorPosition.x, (int)cursorPosition.y); + logger.debug("Tile is occupied: " + tileOccupied ); + + // check that no entities are occupying the tile + if (!tileOccupied) { + buildTower((int)cursorPosition.x, (int)cursorPosition.y); + logger.debug("spawning a tower at {}, {}", cursorPosition.x, cursorPosition.y); + return true; + } + return false; + } + + /** + * Instantiates and spawns the selected tower at the given x y coordinates on the tile map. Assumes that the given + * x and y coordinate is valid and that the TowerType exists in the CurrencyService. + * + * @param x x-coordinate int value + * @param y y-coordinate int value + */ + public void buildTower(int x, int y) { + // fetch the currently set TowerType in the currency service, and its associated build cost. + TowerType tower = ServiceLocator.getCurrencyService().getTower(); + if (tower != null) { + // fetch the price of the selected tower and attempt to instantiate + int cost = Integer.parseInt(ServiceLocator.getCurrencyService().getTower().getPrice()); + + if (cost <= ServiceLocator.getCurrencyService().getScrap().getAmount()) { + Entity newTower = switch (tower) { + case WEAPON -> TowerFactory.createWeaponTower(); + case INCOME -> TowerFactory.createIncomeTower(); + case TNT -> TowerFactory.createTNTTower(); + case DROID -> TowerFactory.createDroidTower(); + case WALL -> TowerFactory.createWallTower(); + case FIRE -> TowerFactory.createFireTower(); + case STUN -> TowerFactory.createStunTower(); + }; + // build the selected tower + newTower.setPosition(x, y); + ServiceLocator.getEntityService().register(newTower); + // Decrement currency and show a popup that reflects the cost of the build + ServiceLocator.getCurrencyService().getScrap().modify(-cost); + ServiceLocator.getCurrencyService().getDisplay().updateScrapsStats(); + ServiceLocator.getCurrencyService().getDisplay().currencyPopUp(x, y, -cost, 10); + + long soundId = buildSound.play(); + buildSound.setVolume(soundId, 0.4f); + } else { + // play a sound to indicate an invalid action + long soundId = errorSound.play(); + errorSound.setVolume(soundId, 0.5f); + } + } + } + + /** + * Load the sound assets related to in-game tower building activity + */ + private void loadSounds() { + ServiceLocator.getResourceService().loadSounds(sounds); + ServiceLocator.getResourceService().loadAll(); + buildSound = ServiceLocator.getResourceService().getAsset("sounds/economy/buildSound.ogg", Sound.class); + errorSound = ServiceLocator.getResourceService().getAsset("sounds/ui/Switch/NA_SFUI_Vol1_switch_01.ogg", Sound.class); + } +} diff --git a/source/core/src/main/com/csse3200/game/screens/AssetLoader.java b/source/core/src/main/com/csse3200/game/screens/AssetLoader.java index 4c0ec4738..4a275d33f 100644 --- a/source/core/src/main/com/csse3200/game/screens/AssetLoader.java +++ b/source/core/src/main/com/csse3200/game/screens/AssetLoader.java @@ -64,13 +64,26 @@ public class AssetLoader { "images/projectiles/basic_projectile.png", "images/projectiles/mobProjectile.png", "images/projectiles/engineer_projectile.png", - "images/projectiles/mobKing_projectile.png", + "images/projectiles/mobBoss_projectile.png", "images/projectiles/snow_ball.png", "images/projectiles/burn_effect.png", "images/projectiles/stun_effect.png", "images/projectiles/firework_anim.png", "images/projectiles/pierce_anim.png", - "images/projectiles/snow_ball.png" + "images/projectiles/snow_ball.png", + "images/mobboss/demon.png", + "images/mobboss/demon2.png", + "images/mobs/fire_worm.png", + "images/mobboss/patrick.png", + "images/GrassTile/grass_tile_1.png", + "images/GrassTile/grass_tile_2.png", + "images/GrassTile/grass_tile_3.png", + "images/GrassTile/grass_tile_4.png", + "images/GrassTile/grass_tile_5.png", + "images/GrassTile/grass_tile_6.png", + "images/GrassTile/grass_tile_7.png", + "images/highlight_tile.png", + "images/ui/Sprites/UI_Glass_Toggle_Bar_01a.png" }; public static final String[] textureAtlases = { @@ -97,13 +110,22 @@ public class AssetLoader { "images/projectiles/mobProjectile.atlas", "images/projectiles/mobProjectile.atlas", "images/projectiles/engineer_projectile.atlas", - "images/projectiles/mobKing_projectile.atlas", + "images/projectiles/mobBoss_projectile.atlas", "images/projectiles/snow_ball.atlas", "images/projectiles/pierce_anim.atlas", "images/projectiles/burn_effect.atlas", "images/projectiles/firework_anim.atlas", "images/projectiles/mobProjectile.atlas", - "images/projectiles/stun_effect.atlas" + "images/projectiles/stun_effect.atlas", + "images/mobboss/demon.atlas", + "images/mobs/fire_worm.atlas", + "images/mobs/dragon_knight.atlas", + "images/mobs/skeleton.atlas", + "images/mobs/wizard.atlas", + "images/mobs/water_queen.atlas", + "images/mobs/water_slime.atlas", + "images/mobboss/patrick.atlas", + "images/mobboss/iceBaby.atlas" }; @@ -115,6 +137,7 @@ public class AssetLoader { "sounds/Impact4.ogg", "sounds/economy/click.wav", "sounds/economy/click_1.wav", + "sounds/economy/buildSound.ogg", "sounds/towers/gun_shot_trimmed.mp3", "sounds/towers/deploy.mp3", "sounds/towers/stow.mp3", @@ -122,6 +145,53 @@ public class AssetLoader { "sounds/engineers/firing_single.mp3", "sounds/projectiles/on_collision.mp3", "sounds/projectiles/explosion.mp3", + "sounds/waves/wave-start/Wave_Start_Alarm.ogg", + "sounds/waves/wave-end/Wave_Over_01.ogg", + "sounds/mobBoss/iceBabySound.mp3", + "sounds/mobBoss/mobSpawnStomp.mp3", + "sounds/mobBoss/iceBabyAOE.mp3", + "sounds/mobs/wizardSpell.mp3", + "sounds/mobs/waterQueenSpell.mp3", + "sounds/mobs/boneBreak.mp3", + "sounds/mobs/fireWormRoar.mp3", + "sounds/mobBoss/demonBreath.mp3", + "sounds/mobBoss/demonSpawn.wav", + "sounds/mobBoss/demonAttack.wav", + "sounds/mobBoss/demonBreathIn.mp3", + "sounds/mobBoss/demonLand.mp3", + "sounds/mobBoss/demonJump.mp3", + "sounds/mobBoss/demonHeal.mp3", + "sounds/mobBoss/demonCleave.mp3", + "sounds/mobBoss/demonDeath.mp3", + "sounds/mobBoss/slimeySplat.mp3", + "sounds/mobBoss/slimeJump.mp3", + "sounds/mobBoss/slimePop.mp3", + "sounds/mobBoss/patrickAttack.mp3", + "sounds/mobBoss/patrickAppear.mp3", + "sounds/mobBoss/patrickScream.mp3", + "sounds/mobBoss/patrickSpell.mp3", + "sounds/mobBoss/patrickSpawn.mp3", + "sounds/mobBoss/patrickCast.mp3", + "sounds/mobBoss/patrickThunder.mp3", + "sounds/mobBoss/patrickHit.mp3", + "sounds/ui/Click/NA_SFUI_Vol1_Click_01.ogg", + "sounds/ui/Hover/NA_SFUI_Vol1_hover_01.ogg", + "sounds/ui/Open_Close/NA_SFUI_Vol1_Close_01.ogg", + "sounds/ui/Open_Close/NA_SFUI_Vol1_Open_01.ogg", + "sounds/ui/Switch/NA_SFUI_Vol1_switch_01.ogg", + "sounds/background/desert/Elements.ogg", + "sounds/background/desert/Rocks1.ogg", + "sounds/background/desert/Rocks2.ogg", + "sounds/background/ice/Sequences1.ogg", + "sounds/background/ice/Sequences2.ogg", + "sounds/background/ice/Sequences3.ogg", + "sounds/background/lava/Burst.ogg", + "sounds/background/lava/Glitch_ripples.ogg", + "sounds/background/lava/Sizzling.ogg", + "sounds/background/lava/Swoosh.ogg", + "sounds/background/loss/RisingScreams.ogg", + "sounds/waves/wave-start/Wave_Start_Alarm.ogg", + "sounds/waves/wave-end/Wave_Over_01.ogg" }; diff --git a/source/core/src/main/com/csse3200/game/screens/LevelSelectScreen.java b/source/core/src/main/com/csse3200/game/screens/LevelSelectScreen.java index b4738a456..4db4580f7 100644 --- a/source/core/src/main/com/csse3200/game/screens/LevelSelectScreen.java +++ b/source/core/src/main/com/csse3200/game/screens/LevelSelectScreen.java @@ -59,7 +59,7 @@ public LevelSelectScreen(GdxGame game) { stage = new Stage(new FitViewport(Gdx.graphics.getWidth(), Gdx.graphics.getHeight())); - Skin skin = new Skin(Gdx.files.internal("flat-earth/skin/flat-earth-ui.json")); + Skin skin = new Skin(Gdx.files.internal("images/ui/buttons/glass.json")); TextButton BackButton = new TextButton("Back", skin); // Universal Skip button BackButton.addListener(new ClickListener() { @Override diff --git a/source/core/src/main/com/csse3200/game/screens/LosingScreen.java b/source/core/src/main/com/csse3200/game/screens/LosingScreen.java index b52e4642b..5456209b7 100644 --- a/source/core/src/main/com/csse3200/game/screens/LosingScreen.java +++ b/source/core/src/main/com/csse3200/game/screens/LosingScreen.java @@ -2,6 +2,7 @@ import com.badlogic.gdx.Gdx; import com.badlogic.gdx.ScreenAdapter; +import com.badlogic.gdx.audio.Sound; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.BitmapFont; @@ -16,6 +17,8 @@ import com.badlogic.gdx.utils.viewport.ScreenViewport; import com.csse3200.game.GdxGame; import com.csse3200.game.screens.text.AnimatedText; +import com.csse3200.game.services.ResourceService; +import com.csse3200.game.services.ServiceLocator; public class LosingScreen extends ScreenAdapter { private final GdxGame game; @@ -27,10 +30,11 @@ public class LosingScreen extends ScreenAdapter { private static final String INTRO_TEXT = """ The aliens gained control. You lose! """; - + private static final String[] lossSounds = {"sounds/background/loss/RisingScreams.ogg"}; private BitmapFont font; private AnimatedText text; private Stage stage; + private ResourceService resourceService; private TextButton exitButton; private TextButton mainMenuButton; private TextButton playAgainButton; @@ -40,6 +44,10 @@ public LosingScreen(GdxGame game) { font = new BitmapFont(); text = new AnimatedText(INTRO_TEXT, font, 0.05f); font.getData().setScale(2, 2); + resourceService = new ResourceService(); + ServiceLocator.registerResourceService(resourceService); + resourceService.loadSounds(lossSounds); + resourceService.loadAll(); } @Override @@ -52,7 +60,7 @@ public void show() { stage = new Stage(new ScreenViewport()); Gdx.input.setInputProcessor(stage); - Skin skin = new Skin(Gdx.files.internal("flat-earth/skin/flat-earth-ui.json")); + Skin skin = new Skin(Gdx.files.internal("images/ui/buttons/glass.json")); exitButton = new TextButton("Exit Game", skin); exitButton.addListener(new ClickListener(){ public void clicked(InputEvent even, float x, float y) { @@ -71,16 +79,17 @@ public void clicked(InputEvent event, float x, float y) { playAgainButton = new TextButton("Play Again", skin); playAgainButton.addListener(new ClickListener() { public void clicked(InputEvent even, float x, float y) { - game.setScreen(GdxGame.ScreenType.MAIN_GAME); + game.setScreen(GdxGame.ScreenType.LEVEL_SELECT); } }); - Table table = new Table(); table.setFillParent(true); table.add(exitButton).padTop(-100).row(); table.add(mainMenuButton).padTop(-200).row(); table.add(playAgainButton).padTop(-300).row(); stage.addActor(table); + // play loss sound + resourceService.getAsset(lossSounds[0], Sound.class).play(0.3f); } @Override diff --git a/source/core/src/main/com/csse3200/game/screens/MainGameScreen.java b/source/core/src/main/com/csse3200/game/screens/MainGameScreen.java index dc7f8d293..05d47629a 100644 --- a/source/core/src/main/com/csse3200/game/screens/MainGameScreen.java +++ b/source/core/src/main/com/csse3200/game/screens/MainGameScreen.java @@ -2,19 +2,22 @@ import com.badlogic.gdx.Gdx; import com.badlogic.gdx.ScreenAdapter; +import com.badlogic.gdx.audio.Music; +import com.badlogic.gdx.audio.Sound; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.scenes.scene2d.Stage; +import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.viewport.ScreenViewport; import com.csse3200.game.GdxGame; import com.csse3200.game.areas.ForestGameArea; -import com.csse3200.game.areas.terrain.TerrainFactory; import com.csse3200.game.components.gamearea.PerformanceDisplay; import com.csse3200.game.components.maingame.MainGameActions; import com.csse3200.game.components.maingame.MainGameLoseDisplay; +import com.csse3200.game.components.maingame.MainGamePauseDisplay; import com.csse3200.game.entities.Entity; import com.csse3200.game.entities.EntityService; import com.csse3200.game.entities.factories.RenderFactory; @@ -37,7 +40,47 @@ */ public class MainGameScreen extends ScreenAdapter { private static final Logger logger = LoggerFactory.getLogger(MainGameScreen.class); - private static final String[] mainGameTextures = {"images/heart.png","images/ice_bg.png","images/lava_bg.png","images/desert_bg.png","images/terrain_use.png"}; + private static final String[] mainGameTextures = { + "images/heart.png", + "images/ice_bg.png", + "images/lava_bg.png", + "images/desert_bg.png" + }; + + private static final String ICE_BACKDROP = mainGameTextures[1]; + private static final String LAVA_BACKDROP = mainGameTextures[2]; + private static final String DESERT_BACKDROP = mainGameTextures[3]; + private static final String[] backgroundMusic = { + "sounds/background/ice/ice_bgm.ogg", + "sounds/background/lava/lava_bgm.ogg", + "sounds/background/desert/desert_bgm.ogg" + }; + private static final String[] uiSounds = { + "sounds/ui/Click/NA_SFUI_Vol1_Click_01.ogg", + "sounds/ui/Hover/NA_SFUI_Vol1_hover_01.ogg", + "sounds/ui/Open_Close/NA_SFUI_Vol1_Close_01.ogg", + "sounds/ui/Open_Close/NA_SFUI_Vol1_Open_01.ogg", + "sounds/ui/Switch/NA_SFUI_Vol1_switch_01.ogg" + }; + private static final String[] desertSounds = { + "sounds/background/desert/Elements.ogg", + "sounds/background/desert/Rocks1.ogg", + "sounds/background/desert/Rocks2.ogg" + }; + private static final String[] iceSounds = { + "sounds/background/ice/Sequences1.ogg", + "sounds/background/ice/Sequences2.ogg", + "sounds/background/ice/Sequences3.ogg" + }; + private static final String[] lavaSounds = { + "sounds/background/lava/Burst.ogg", + "sounds/background/lava/Glitch_ripples.ogg", + "sounds/background/lava/Sizzling.ogg", + "sounds/background/lava/Swoosh.ogg" + }; + private static final String ICE_BGM = backgroundMusic[0]; + private static final String LAVA_BGM = backgroundMusic[1]; + private static final String DESERT_BGM = backgroundMusic[2]; private static final Vector2 CAMERA_POSITION = new Vector2(10f, 5.64f); private final GdxGame game; @@ -47,10 +90,8 @@ public class MainGameScreen extends ScreenAdapter { private final Stage stage; static int screenWidth = Gdx.graphics.getWidth(); static int screenHeight = Gdx.graphics.getHeight(); - private Entity ui; - - + private int random = 0; public static int viewportWidth = screenWidth; public static int viewportHeight= screenHeight; int selectedLevel = GameLevelData.getSelectedLevel(); @@ -59,6 +100,8 @@ public class MainGameScreen extends ScreenAdapter { private SpriteBatch batch; private Texture backgroundTexture; + private Music music; + private Array<String> ambientSounds = new Array<>(false, 5, String.class); public MainGameScreen(GdxGame game) { this.game = game; @@ -91,20 +134,23 @@ public MainGameScreen(GdxGame game) { renderer = RenderFactory.createRenderer(); renderer.getCamera().getEntity().setPosition(CAMERA_POSITION); renderer.getDebug().renderPhysicsWorld(physicsEngine.getWorld()); + InputComponent inputHandler = new DropInputComponent(renderer.getCamera().getCamera()); + InputComponent buildHandler = new BuildInputComponent(renderer.getCamera().getCamera()); InputComponent UpgradedInputHandler = new UpgradeUIComponent(renderer.getCamera().getCamera(), renderer.getStage()); + InputComponent engineerInputHandler = new EngineerInputComponent(game, renderer.getCamera().getCamera()); - InputComponent engineerInputHnadler = new EngineerInputComponent(game, renderer.getCamera().getCamera()); ServiceLocator.getInputService().register(inputHandler); - ServiceLocator.getInputService().register(engineerInputHnadler); + ServiceLocator.getInputService().register(buildHandler); + ServiceLocator.getInputService().register(engineerInputHandler); ServiceLocator.getInputService().register(UpgradedInputHandler); + ServiceLocator.getCurrencyService().getDisplay().setCamera(renderer.getCamera().getCamera()); loadAssets(); createUI(); ServiceLocator.registerMapService(new MapService(renderer.getCamera())); logger.debug("Initialising main game screen entities"); -// TerrainFactory terrainFactory = new TerrainFactory(renderer.getCamera()); ForestGameArea forestGameArea = new ForestGameArea(); forestGameArea.create(); } @@ -126,14 +172,20 @@ public Texture getBackgroundTexture() { switch (selectedLevel) { // Desert case 1: // Ice - background = ServiceLocator.getResourceService().getAsset("images/ice_bg.png", Texture.class); + background = ServiceLocator.getResourceService().getAsset(ICE_BACKDROP, Texture.class); + music = ServiceLocator.getResourceService().getAsset(ICE_BGM, Music.class); + ambientSounds.addAll(iceSounds); break; case 2: // Lava - background = ServiceLocator.getResourceService().getAsset("images/lava_bg.png", Texture.class); + background = ServiceLocator.getResourceService().getAsset(LAVA_BACKDROP, Texture.class); + music = ServiceLocator.getResourceService().getAsset(LAVA_BGM, Music.class); + ambientSounds.addAll(lavaSounds); break; default: // Use a default background for other levels or planets - background = ServiceLocator.getResourceService().getAsset("images/desert_bg.png", Texture.class); + background = ServiceLocator.getResourceService().getAsset(DESERT_BACKDROP, Texture.class); + music = ServiceLocator.getResourceService().getAsset(DESERT_BGM, Music.class); + ambientSounds.addAll(desertSounds); break; } return background; @@ -167,6 +219,8 @@ public void render(float delta) { ui.getEvents().trigger("lose"); } + ServiceLocator.getWaveService().getDisplay().updateTimerButton(); + ServiceLocator.getWaveService().getDisplay().updateMobCount(); renderer.render(); } @@ -204,6 +258,11 @@ private void loadAssets() { logger.debug("Loading assets"); ResourceService resourceService = ServiceLocator.getResourceService(); resourceService.loadTextures(mainGameTextures); + ServiceLocator.getResourceService().loadMusic(backgroundMusic); + ServiceLocator.getResourceService().loadSounds(iceSounds); + ServiceLocator.getResourceService().loadSounds(desertSounds); + ServiceLocator.getResourceService().loadSounds(lavaSounds); + ServiceLocator.getResourceService().loadSounds(uiSounds); ServiceLocator.getResourceService().loadAll(); backgroundTexture = getBackgroundTexture(); // Load the background image } @@ -212,6 +271,11 @@ private void unloadAssets() { logger.debug("Unloading assets"); ResourceService resourceService = ServiceLocator.getResourceService(); resourceService.unloadAssets(mainGameTextures); + ServiceLocator.getResourceService().unloadAssets(backgroundMusic); + ServiceLocator.getResourceService().unloadAssets(iceSounds); + ServiceLocator.getResourceService().unloadAssets(desertSounds); + ServiceLocator.getResourceService().unloadAssets(lavaSounds); + ServiceLocator.getResourceService().unloadAssets(uiSounds); } /** @@ -226,14 +290,31 @@ private void createUI() { ui = new Entity(); ui.addComponent(new InputDecorator(stage, 10)) - .addComponent(new PerformanceDisplay()) + + .addComponent(new PerformanceDisplay()) .addComponent(new MainGameActions(this.game)) + .addComponent(ServiceLocator.getWaveService().getDisplay()) .addComponent(new MainGameExitDisplay()) .addComponent(new MainGameLoseDisplay()) + .addComponent(new MainGamePauseDisplay(this.game)) .addComponent(new Terminal()) .addComponent(inputComponent) .addComponent(new TerminalDisplay()); + ServiceLocator.getEntityService().register(ui); + + music.setLooping(true); + music.setVolume(0.3f); + music.play(); + playAmbientSound(); + } + + /** + * Plays one of the ambient sounds for the level at random + */ + private void playAmbientSound() { + + ServiceLocator.getResourceService().getAsset(ambientSounds.random(), Sound.class).play(0.2f); } } \ No newline at end of file diff --git a/source/core/src/main/com/csse3200/game/screens/MainMenuScreen.java b/source/core/src/main/com/csse3200/game/screens/MainMenuScreen.java index 6b2de82e9..ed30d9031 100644 --- a/source/core/src/main/com/csse3200/game/screens/MainMenuScreen.java +++ b/source/core/src/main/com/csse3200/game/screens/MainMenuScreen.java @@ -2,6 +2,7 @@ import com.badlogic.gdx.Gdx; import com.badlogic.gdx.ScreenAdapter; +import com.badlogic.gdx.audio.Music; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.scenes.scene2d.Stage; import com.csse3200.game.GdxGame; @@ -33,6 +34,10 @@ public class MainMenuScreen extends ScreenAdapter { private final Renderer renderer; private Texture backgroundTexture; private final SpriteBatch batch; + private static final String[] mainMenuAtlases = { + "images/ui/buttons/glass.atlas" + }; + private static final String[] titleMusic = {"sounds/background/title_screen/ScifiAmbient.ogg"}; private Animation<TextureRegion> MM_Star1_animation; private Animation<TextureRegion> MM_Galaxy1_animation; private Animation<TextureRegion> MM_Planet1_animation; @@ -211,6 +216,8 @@ private void loadAssets() { logger.debug("Loading assets"); ResourceService resourceService = ServiceLocator.getResourceService(); resourceService.loadTextures(mainMenuTextures); + resourceService.loadTextureAtlases(mainMenuAtlases); + ServiceLocator.getResourceService().loadMusic(titleMusic); backgroundTexture = new Texture("images/background/main_menu/main_menu_bg.png"); // MM_Star1 @@ -308,6 +315,8 @@ private void unloadAssets() { logger.debug("Unloading assets"); ResourceService resourceService = ServiceLocator.getResourceService(); resourceService.unloadAssets(mainMenuTextures); + resourceService.unloadAssets(mainMenuAtlases); + resourceService.unloadAssets(titleMusic); MM_Star1_Texture.dispose(); MM_Galaxy1_Texture.dispose(); MM_Planet1_Texture.dispose(); @@ -327,5 +336,9 @@ private void createUI() { .addComponent(new InputDecorator(stage, 10)) .addComponent(new MainMenuActions(game)); ServiceLocator.getEntityService().register(ui); + Music music = ServiceLocator.getResourceService().getAsset(titleMusic[0], Music.class); + music.setLooping(true); + music.setVolume(0.3f); + music.play(); } } \ No newline at end of file diff --git a/source/core/src/main/com/csse3200/game/screens/StoryScreen.java b/source/core/src/main/com/csse3200/game/screens/StoryScreen.java index 98adfb109..d294730be 100644 --- a/source/core/src/main/com/csse3200/game/screens/StoryScreen.java +++ b/source/core/src/main/com/csse3200/game/screens/StoryScreen.java @@ -97,8 +97,10 @@ public void show() { Gdx.input.setInputProcessor(stage); shapeRenderer = new ShapeRenderer(); - // Create UI - Skin skin = new Skin(Gdx.files.internal("flat-earth/skin/flat-earth-ui.json")); + Skin skin = new Skin(Gdx.files.internal("images/ui/buttons/glass.json")); +// +// // Create UI +// Skin skin = new Skin(Gdx.files.internal("flat-earth/skin/flat-earth-ui.json")); continueButton = new TextButton("Continue", skin); continueButton.addListener(new ClickListener() { @Override diff --git a/source/core/src/main/com/csse3200/game/screens/TurretSelectionScreen.java b/source/core/src/main/com/csse3200/game/screens/TurretSelectionScreen.java index 48cfee714..357ab0fd6 100644 --- a/source/core/src/main/com/csse3200/game/screens/TurretSelectionScreen.java +++ b/source/core/src/main/com/csse3200/game/screens/TurretSelectionScreen.java @@ -4,7 +4,6 @@ import com.badlogic.gdx.ScreenAdapter; import com.badlogic.gdx.audio.Sound; import com.badlogic.gdx.graphics.GL20; -import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.Sprite; @@ -20,15 +19,11 @@ import com.badlogic.gdx.scenes.scene2d.utils.ClickListener; import com.badlogic.gdx.scenes.scene2d.utils.Drawable; import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable; -import com.badlogic.gdx.utils.Align; import com.badlogic.gdx.utils.viewport.ScreenViewport; import com.csse3200.game.GdxGame; -import com.badlogic.gdx.scenes.scene2d.ui.Image; -import com.csse3200.game.services.ResourceService; import com.csse3200.game.services.ServiceLocator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.w3c.dom.Text; import java.util.*; @@ -76,7 +71,9 @@ public TurretSelectionScreen(GdxGame game) { turretList.addAll(Arrays.asList(TowerType.values())); // Restrictions can be added to the arrays i.e. map == "Forest" && level == 1 using for loop - Skin skin = new Skin(Gdx.files.internal("flat-earth/skin/flat-earth-ui.json")); + Skin skin = new Skin(Gdx.files.internal("images/ui/buttons/glass.json")); +//======= +// Skin skin = new Skin(Gdx.files.internal("flat-earth/skin/flat-earth-ui.json")); backButton = new TextButton("Back", skin); backButton.addListener(new ClickListener() { @Override @@ -102,6 +99,8 @@ public void clicked(InputEvent event, float x, float y) { confirmButton.addListener(new ClickListener() { @Override public void clicked(InputEvent event, float x, float y) { + // Store the selected towers in the ServiceLocator for transferring across screens + ServiceLocator.setTowerTypes(selectedTurrets);; game.setScreen(GdxGame.ScreenType.MAIN_GAME); } }); diff --git a/source/core/src/main/com/csse3200/game/services/CurrencyService.java b/source/core/src/main/com/csse3200/game/services/CurrencyService.java index efce403e2..d76f7b147 100644 --- a/source/core/src/main/com/csse3200/game/services/CurrencyService.java +++ b/source/core/src/main/com/csse3200/game/services/CurrencyService.java @@ -4,13 +4,16 @@ import com.csse3200.game.currency.Crystal; import com.csse3200.game.currency.Scrap; +import java.lang.reflect.Array; import java.util.ArrayList; import com.csse3200.game.currency.Currency; +import com.csse3200.game.screens.TowerType; public class CurrencyService { private ArrayList<Currency> currencies; private CurrencyDisplay display; + private TowerType tower = null; /** * Constructor for the CurrencyService class @@ -45,4 +48,16 @@ public Crystal getCrystal() { public CurrencyDisplay getDisplay() { return display; } + + public void setTowerType(TowerType newTower) { + if (tower == newTower) { + tower = null; + } else { + tower = newTower; + } + } + + public TowerType getTower() { + return tower; + } } diff --git a/source/core/src/main/com/csse3200/game/services/ServiceLocator.java b/source/core/src/main/com/csse3200/game/services/ServiceLocator.java index 449b7f11a..8f3c72154 100644 --- a/source/core/src/main/com/csse3200/game/services/ServiceLocator.java +++ b/source/core/src/main/com/csse3200/game/services/ServiceLocator.java @@ -1,12 +1,17 @@ package com.csse3200.game.services; +import com.badlogic.gdx.utils.Array; import com.csse3200.game.entities.EntityService; import com.csse3200.game.input.InputService; import com.csse3200.game.physics.PhysicsService; import com.csse3200.game.rendering.RenderService; +import com.csse3200.game.screens.TowerType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.HashSet; +import java.util.Set; + /** * A simplified implementation of the Service Locator pattern: * https://martinfowler.com/articles/injection.html#UsingAServiceLocator @@ -28,6 +33,8 @@ public class ServiceLocator { private static WaveService waveService; private static MapService mapService; + private static Set<TowerType> towerTypes = new HashSet<>(); + public static CurrencyService getCurrencyService() { return currencyService; } @@ -113,6 +120,15 @@ public static void registerMapService(MapService source) { mapService = source; } + public static void setTowerTypes(Set<TowerType> selectedTowers) { + towerTypes.clear(); + towerTypes.addAll(selectedTowers); + } + + public static Set<TowerType> getTowerTypes() { + return towerTypes; + } + public static void clear() { entityService = null; renderService = null; diff --git a/source/core/src/main/com/csse3200/game/services/WaveService.java b/source/core/src/main/com/csse3200/game/services/WaveService.java index cd26acf8b..0e50a7fc1 100644 --- a/source/core/src/main/com/csse3200/game/services/WaveService.java +++ b/source/core/src/main/com/csse3200/game/services/WaveService.java @@ -1,5 +1,6 @@ package com.csse3200.game.services; +import com.csse3200.game.components.maingame.UIElementsDisplay; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -14,6 +15,7 @@ public class WaveService { private boolean levelCompleted = false; private long nextWaveTime; + private final UIElementsDisplay display; /** @@ -21,6 +23,7 @@ public class WaveService { */ public WaveService() { this.enemyCount = 0; + this.display = new UIElementsDisplay(); } /** @@ -30,6 +33,7 @@ public WaveService() { public void setEnemyCount(int newLimit) { if (newLimit > 0) { enemyCount = newLimit; + display.updateMobCount(); } } @@ -116,4 +120,13 @@ public long getNextWaveTime() { public void setNextWaveTime(long nextWaveTime) { this.nextWaveTime = nextWaveTime; } + + /** + * Used for adding this instance of UIElementsDisplay to the mainGameScreen. This is needed as update is performed + * for this instance of the display. + * @return the updating instance of UIElementsDisplay + */ + public UIElementsDisplay getDisplay() { + return this.display; + } } diff --git a/source/core/src/main/com/csse3200/game/ui/ButtonFactory.java b/source/core/src/main/com/csse3200/game/ui/ButtonFactory.java index 67fafb0c0..073aaa0e9 100644 --- a/source/core/src/main/com/csse3200/game/ui/ButtonFactory.java +++ b/source/core/src/main/com/csse3200/game/ui/ButtonFactory.java @@ -79,9 +79,10 @@ public static TextButton createCustomButtonWithAtlas(String text, String atlasPa TextureAtlas atlas = new TextureAtlas(Gdx.files.internal(atlasPath)); Skin customSkin = new Skin(atlas); - TextButton.TextButtonStyle style = new TextButton.TextButtonStyle(); - style.font = defaultSkin.getFont("default"); // Use the default font - TextButton button = new TextButton(text, style); +// TextButton.TextButtonStyle style = new TextButton.TextButtonStyle(); +// style.font = defaultSkin.getFont("default"); // Use the default font + TextButton button = new TextButton(text, customSkin); + button.getLabel().setFontScale(0.8f); // Adjust text size button.pad(10f); // Adjust padding diff --git a/source/core/src/main/com/csse3200/game/ui/UIComponent.java b/source/core/src/main/com/csse3200/game/ui/UIComponent.java index efbba0cf6..60cfe7009 100644 --- a/source/core/src/main/com/csse3200/game/ui/UIComponent.java +++ b/source/core/src/main/com/csse3200/game/ui/UIComponent.java @@ -13,7 +13,8 @@ public abstract class UIComponent extends RenderComponent implements Renderable { private static final int UI_LAYER = 2; protected static final Skin skin = - new Skin(Gdx.files.internal("flat-earth/skin/flat-earth-ui.json")); +// new Skin(Gdx.files.internal("flat-earth/skin/flat-earth-ui.json")); + new Skin(Gdx.files.internal("images/ui/buttons/glass.json")); protected Stage stage; @Override diff --git a/source/core/src/test/com/csse3200/game/components/maingame/UIElementsDisplayTest.java b/source/core/src/test/com/csse3200/game/components/maingame/UIElementsDisplayTest.java new file mode 100644 index 000000000..79916fc4a --- /dev/null +++ b/source/core/src/test/com/csse3200/game/components/maingame/UIElementsDisplayTest.java @@ -0,0 +1,61 @@ +//package com.csse3200.game.components.maingame; +// +//import com.badlogic.gdx.scenes.scene2d.Stage; +//import com.badlogic.gdx.scenes.scene2d.ui.Skin; +//import com.badlogic.gdx.scenes.scene2d.ui.TextButton; +//import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; +//import com.csse3200.game.components.maingame.UIElementsDisplay; +//import com.csse3200.game.rendering.RenderService; +//import com.csse3200.game.screens.MainGameScreen; +//import com.csse3200.game.services.ResourceService; +//import com.csse3200.game.services.ServiceLocator; +//import com.csse3200.game.services.WaveService; +//import com.csse3200.game.ui.ButtonFactory;F +//import org.junit.Before; +//import org.junit.Test; +//import org.mockito.Mockito; +// +//import java.security.Provider; +// +//import static org.junit.Assert.assertEquals; +//import static org.junit.Assert.assertNull; +//import static org.mockito.Mockito.*; +// +//public class UIElementsDisplayTest { +// +// private UIElementsDisplay display; +// +// @Before +// public void setUp() { +// RenderService renderService = mock(RenderService.class); +// ResourceService resourceService = mock(ResourceService.class); +// WaveService waveService = mock(WaveService.class); +// +// display = new UIElementsDisplay(); +// +// ServiceLocator.registerRenderService(renderService); +// ServiceLocator.registerResourceService(resourceService); +// ServiceLocator.registerWaveService(waveService); +// +// when(ServiceLocator.getWaveService().getEnemyCount()).thenReturn(10); +// when(ServiceLocator.getWaveService().getNextWaveTime()).thenReturn(10000L); // Example time +// when(ServiceLocator.getWaveService().getDisplay()).thenReturn(display); +// +// } +// +// @Test +// public void testUpdateMobCount() { +// TextButton mobButton = display.getRemainingMobsButton(); +// assertEquals("Mobs:10", mobButton.getText()); +// +// display.updateMobCount(); +// assertEquals("Mobs:9", mobButton.getText()); +// } +// +// @Test +// public void testCreateTimerButton() { +// assertNull(display.getTimerButton()); +// display.createTimerButton(); +// assertEquals("Next wave in:10", display.getTimerButton().getText()); +// } +//} diff --git a/source/core/src/test/com/csse3200/game/components/pausemenu/PauseMenuTimeStopComponentTest.java b/source/core/src/test/com/csse3200/game/components/pausemenu/PauseMenuTimeStopComponentTest.java new file mode 100644 index 000000000..65cf8cb8b --- /dev/null +++ b/source/core/src/test/com/csse3200/game/components/pausemenu/PauseMenuTimeStopComponentTest.java @@ -0,0 +1,49 @@ +package com.csse3200.game.components.pausemenu; + +import com.csse3200.game.entities.Entity; +import com.csse3200.game.entities.EntityService; +import com.csse3200.game.extensions.GameExtension; +import com.csse3200.game.services.ServiceLocator; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.mockito.Mockito.*; + +@ExtendWith(GameExtension.class) +public class PauseMenuTimeStopComponentTest { + Entity pauseMenu; + Entity entity; + @BeforeEach + void beforeEach() { + EntityService entityService = new EntityService(); + ServiceLocator.registerEntityService(entityService); + entity = mock(Entity.class); + when(entity.getId()).thenReturn(-1); //Ensure it does not coincide with the pause menu's ID + entityService.register(entity); + PauseMenuTimeStopComponent timeStopComponent = new PauseMenuTimeStopComponent(); + pauseMenu = new Entity(); + pauseMenu.addComponent(timeStopComponent); + } + + @Test + void pausesEntities() { + ServiceLocator.getEntityService().register(pauseMenu); + verify(entity).setEnabled(false); + } + + @Test + void unpausesEntitiesWhenDisposed() { + ServiceLocator.getEntityService().register(pauseMenu); + pauseMenu.dispose(); + verify(entity).setEnabled(true); + } + + @Test + void doesNotPauseNewEntities() { + ServiceLocator.getEntityService().register(pauseMenu); + Entity lateEntity = mock(Entity.class); + when(entity.getId()).thenReturn(-1); //Ensure it does not coincide with the pause menu's ID + ServiceLocator.getEntityService().register(lateEntity); + verify(lateEntity, times(0)).setEnabled(false); + } +} diff --git a/source/core/src/test/com/csse3200/game/entities/factories/PauseMenuFactoryTest.java b/source/core/src/test/com/csse3200/game/entities/factories/PauseMenuFactoryTest.java new file mode 100644 index 000000000..347868521 --- /dev/null +++ b/source/core/src/test/com/csse3200/game/entities/factories/PauseMenuFactoryTest.java @@ -0,0 +1,70 @@ +package com.csse3200.game.entities.factories; + +import com.badlogic.gdx.scenes.scene2d.Stage; +import com.csse3200.game.GdxGame; +import com.csse3200.game.components.pausemenu.*; +import com.csse3200.game.entities.Entity; +import com.csse3200.game.entities.EntityService; +import com.csse3200.game.extensions.GameExtension; +import com.csse3200.game.rendering.RenderService; +import com.csse3200.game.rendering.TextureRenderComponent; +import com.csse3200.game.services.ResourceService; +import com.csse3200.game.services.ServiceLocator; +import org.junit.jupiter.api.*; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.Mockito.*; + + +@ExtendWith(GameExtension.class) +public class PauseMenuFactoryTest { + Entity entity; + GdxGame game; + + String[] texture = { + "images/ui/Sprites/UI_Glass_Toggle_Bar_01a.png" + }; + @BeforeEach + void beforeEach() { + EntityService entityService = new EntityService(); + ServiceLocator.registerEntityService(entityService); + RenderService renderService = mock(RenderService.class); + when(renderService.getStage()).thenReturn(mock(Stage.class)); + ServiceLocator.registerRenderService(renderService); + ResourceService resourceService = new ResourceService(); + ServiceLocator.registerResourceService(resourceService); + resourceService.loadTextures(texture); + resourceService.loadAll(); + + game = mock(GdxGame.class); + entity = PauseMenuFactory.createPauseMenu(game); + } + + @Test + void createsEntity() { + assertNotNull(entity); + } + + @Test + void entityHasRequiredComponents() { + assertNotNull(entity.getComponent(PauseMenuTimeStopComponent.class)); + assertNotNull(entity.getComponent(PauseMenuContinueButton.class)); + assertNotNull(entity.getComponent(PauseMenuSettingsButton.class)); + assertNotNull(entity.getComponent(PauseMenuPlanetSelectButton.class)); + assertNotNull(entity.getComponent(PauseMenuMainMenuButton.class)); + assertNotNull(entity.getComponent(TextureRenderComponent.class)); + } + + @Test + void duplicateNotCreated() { + Entity secondEntity = PauseMenuFactory.createPauseMenu(game); + assertNull(secondEntity); + } + + @Test + void createsSecondEntityAfterFirstIsDisposed() { + entity.dispose(); + Entity secondEntity = PauseMenuFactory.createPauseMenu(game); + assertNotNull(secondEntity); + } +} diff --git a/source/core/src/test/com/csse3200/game/input/BuildInputComponentTest.java b/source/core/src/test/com/csse3200/game/input/BuildInputComponentTest.java new file mode 100644 index 000000000..f5f7fe1cc --- /dev/null +++ b/source/core/src/test/com/csse3200/game/input/BuildInputComponentTest.java @@ -0,0 +1,148 @@ +package com.csse3200.game.input; + +import com.badlogic.gdx.math.Vector2; +import com.csse3200.game.extensions.GameExtension; +import com.csse3200.game.services.ServiceLocator; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.verify; + +@ExtendWith(GameExtension.class) +class BuildInputComponentTest { + + @BeforeEach + void setup() { + + } + + @AfterEach + void tearDown() { + + } + + @Test + void shouldUpdatePriority() { + int newPriority = 100; + InputComponent inputComponent = spy(InputComponent.class); + + inputComponent.setPriority(newPriority); + verify(inputComponent).setPriority(newPriority); + + int priority = inputComponent.getPriority(); + verify(inputComponent).getPriority(); + + assertEquals(newPriority, priority); + } + + @Test + void shouldRegisterOnCreate() { + InputService inputService = spy(InputService.class); + ServiceLocator.registerInputService(inputService); + + InputComponent inputComponent = spy(InputComponent.class); + inputComponent.create(); + verify(inputService).register(inputComponent); + } + + @Test + void shouldHandleKeyDown(){ + InputComponent inputComponent = spy(InputComponent.class); + assertFalse(inputComponent.keyDown(1)); + } + + @Test + void shouldHandleKeyTyped() { + InputComponent inputComponent = spy(InputComponent.class); + assertFalse(inputComponent.keyTyped('a')); + } + + @Test + void shouldHandleKeyUp() { + InputComponent inputComponent = spy(InputComponent.class); + assertFalse(inputComponent.keyUp(1)); + } + + @Test + void shouldHandleMouseMoved() { + InputComponent inputComponent = spy(InputComponent.class); + assertFalse(inputComponent.mouseMoved( 5, 6)); + } + + @Test + void shouldHandleScrolled() { + InputComponent inputComponent = spy(InputComponent.class); + assertFalse(inputComponent.scrolled( 5f, 6f)); + } + + @Test + void shouldHandleTouchDown() { + InputComponent inputComponent = spy(InputComponent.class); + assertFalse(inputComponent.touchDown( 5, 6, 7, 8)); + } + + @Test + void shouldHandleTouchDragged() { + InputComponent inputComponent = spy(InputComponent.class); + assertFalse(inputComponent.touchDragged(5, 6, 7)); + } + + @Test + void shouldHandleTouchUp() { + InputComponent inputComponent = spy(InputComponent.class); + assertFalse(inputComponent.touchUp( 5, 6, 7, 8)); + } + + @Test + void shouldHandleFling(){ + InputComponent inputComponent = spy(InputComponent.class); + assertFalse(inputComponent.fling( 5f, 6f, 7)); + } + + @Test + void shouldHandleLongPress(){ + InputComponent inputComponent = spy(InputComponent.class); + assertFalse(inputComponent.longPress(5f, 6f)); + } + + @Test + void shouldHandlePan(){ + InputComponent inputComponent = spy(InputComponent.class); + assertFalse(inputComponent.pan( 5f, 6f, 7f, 8f)); + } + + @Test + void shouldHandlePanStop(){ + InputComponent inputComponent = spy(InputComponent.class); + assertFalse(inputComponent.panStop( 5f, 6f, 7, 8)); + } + + @Test + void shouldHandlePinch(){ + InputComponent inputComponent = spy(InputComponent.class); + assertFalse(inputComponent.pinch(Vector2.Zero, Vector2.Zero, Vector2.Zero, Vector2.Zero)); + } + + @Test + void shouldHandleTap() { + InputComponent inputComponent = spy(InputComponent.class); + assertFalse(inputComponent.tap(5f, 6f, 7, 8)); + } + + @Test + void shouldHandleTouchDownGesture(){ + InputComponent inputComponent = spy(InputComponent.class); + assertFalse(inputComponent.touchDown(5f, 6f, 7, 8)); + } + + @Test + void shouldHandleZoom(){ + InputComponent inputComponent = spy(InputComponent.class); + assertFalse(inputComponent.zoom(5f, 6f)); + } +}