From d1a898035dfb382c0919c7de0f9a20088f1a4f7d Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Tue, 7 Jan 2020 22:18:35 -0800 Subject: [PATCH] Beginning to get IOS, Android, and Desktop all working at once. Re-enabling steam. --- desktop/project.clj | 4 +- desktop/resources/packed-pop-logo/pack.atlas | 800 +++++++++--------- desktop/resources/ui/ui.json | 2 +- desktop/src-common/advent/core.clj | 3 +- .../advent/screens/rooms/common.clj | 10 +- .../advent/screens/rooms/tongue_fight.clj | 5 + desktop/src-common/advent/screens/scene.clj | 5 +- desktop/src-common/advent/screens/splash.clj | 19 +- desktop/src-common/advent/screens/title.clj | 25 +- desktop/src-common/advent/steam.clj | 160 +++- desktop/src-common/advent/utils.clj | 6 +- 11 files changed, 582 insertions(+), 457 deletions(-) diff --git a/desktop/project.clj b/desktop/project.clj index 92020ea5..7f67ebe3 100644 --- a/desktop/project.clj +++ b/desktop/project.clj @@ -53,7 +53,7 @@ :mobile-dev { :source-paths ["src" "src-common" "src-dev"] :jvm-opts ["-Duse-repl=true" "-Dui_scale=1.5" "-Dno-steam=true" "-Dclojure.compiler.direct-linking=true" "-Dis-desktop=true" "-Dplatform=desktop"] - :dependencies [[com.badlogicgames.gdx/gdx-tools "1.5.3"] + :dependencies [[com.badlogicgames.gdx/gdx-tools "1.9.4"] [org.clojure/tools.nrepl "0.2.12"] [play-clj-nrepl "0.1.0" :exclusions [play-clj]] [slamhound "1.5.5"] @@ -72,7 +72,7 @@ :steam-dev { :source-paths ["src" "src-common" "src-dev"] :jvm-opts ["-Duse-repl=true" "-Dui_scale=1.0" "-Dis-desktop=true" "-Dplatform=desktop"] - :dependencies [[com.badlogicgames.gdx/gdx-tools "1.5.3"] + :dependencies [[com.badlogicgames.gdx/gdx-tools "1.9.4"] [org.clojure/tools.nrepl "0.2.7"] [play-clj-nrepl "0.1.0" :exclusions [play-clj]] [slamhound "1.5.5"] diff --git a/desktop/resources/packed-pop-logo/pack.atlas b/desktop/resources/packed-pop-logo/pack.atlas index 3124dc25..9550af01 100644 --- a/desktop/resources/packed-pop-logo/pack.atlas +++ b/desktop/resources/packed-pop-logo/pack.atlas @@ -4,1403 +4,1403 @@ size: 4096,4096 format: RGBA4444 filter: Nearest,Nearest repeat: none -POPPixelLogo_02_1 +POPPixelLogo_02 rotate: false xy: 2, 3632 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_5 + index: 0 +POPPixelLogo_02 rotate: false xy: 2, 3632 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_3 + index: 4 +POPPixelLogo_02 rotate: false xy: 2, 3632 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_191 + index: 2 +POPPixelLogo_02 rotate: false xy: 2, 3632 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_195 + index: 190 +POPPixelLogo_02 rotate: false xy: 2, 3632 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_193 + index: 194 +POPPixelLogo_02 rotate: false xy: 2, 3632 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_188 + index: 192 +POPPixelLogo_02 rotate: false xy: 2, 3632 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_192 + index: 187 +POPPixelLogo_02 rotate: false xy: 2, 3632 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_199 + index: 191 +POPPixelLogo_02 rotate: false xy: 2, 3632 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_200 + index: 198 +POPPixelLogo_02 rotate: false xy: 2, 3632 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_196 + index: 199 +POPPixelLogo_02 rotate: false xy: 2, 3632 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_194 + index: 195 +POPPixelLogo_02 rotate: false xy: 2, 3632 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_2 + index: 193 +POPPixelLogo_02 rotate: false xy: 2, 3632 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_189 + index: 1 +POPPixelLogo_02 rotate: false xy: 2, 3632 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_4 + index: 188 +POPPixelLogo_02 rotate: false xy: 2, 3632 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_197 + index: 3 +POPPixelLogo_02 rotate: false xy: 2, 3632 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_198 + index: 196 +POPPixelLogo_02 rotate: false xy: 2, 3632 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_10 + index: 197 +POPPixelLogo_02 rotate: false xy: 324, 3390 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_100 + index: 9 +POPPixelLogo_02 rotate: false xy: 2256, 2422 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_101 + index: 99 +POPPixelLogo_02 rotate: false xy: 2578, 2664 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_102 + index: 100 +POPPixelLogo_02 rotate: false xy: 2900, 2906 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_103 + index: 101 +POPPixelLogo_02 rotate: false xy: 3222, 3148 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_104 + index: 102 +POPPixelLogo_02 rotate: false xy: 3544, 3390 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_105 + index: 103 +POPPixelLogo_02 rotate: false xy: 2, 486 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_106 + index: 104 +POPPixelLogo_02 rotate: false xy: 324, 728 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_107 + index: 105 +POPPixelLogo_02 rotate: false xy: 646, 970 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_108 + index: 106 +POPPixelLogo_02 rotate: false xy: 968, 1212 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_109 + index: 107 +POPPixelLogo_02 rotate: false xy: 968, 1212 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_11 + index: 108 +POPPixelLogo_02 rotate: false xy: 646, 3632 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_110 + index: 10 +POPPixelLogo_02 rotate: false xy: 1290, 1454 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_111 + index: 109 +POPPixelLogo_02 rotate: false xy: 1612, 1696 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_112 + index: 110 +POPPixelLogo_02 rotate: false xy: 1934, 1938 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_113 + index: 111 +POPPixelLogo_02 rotate: false xy: 2256, 2180 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_114 + index: 112 +POPPixelLogo_02 rotate: false xy: 2578, 2422 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_115 + index: 113 +POPPixelLogo_02 rotate: false xy: 2900, 2664 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_116 + index: 114 +POPPixelLogo_02 rotate: false xy: 3222, 2906 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_117 + index: 115 +POPPixelLogo_02 rotate: false xy: 3544, 3148 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_118 + index: 116 +POPPixelLogo_02 rotate: false xy: 2, 244 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_119 + index: 117 +POPPixelLogo_02 rotate: false xy: 2, 244 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_12 + index: 118 +POPPixelLogo_02 rotate: false xy: 2, 2906 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_120 + index: 11 +POPPixelLogo_02 rotate: false xy: 324, 486 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_121 + index: 119 +POPPixelLogo_02 rotate: false xy: 646, 728 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_122 + index: 120 +POPPixelLogo_02 rotate: false xy: 968, 970 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_123 + index: 121 +POPPixelLogo_02 rotate: false xy: 1290, 1212 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_124 + index: 122 +POPPixelLogo_02 rotate: false xy: 1612, 1454 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_125 + index: 123 +POPPixelLogo_02 rotate: false xy: 1934, 1696 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_126 + index: 124 +POPPixelLogo_02 rotate: false xy: 2256, 1938 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_127 + index: 125 +POPPixelLogo_02 rotate: false xy: 2578, 2180 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_128 + index: 126 +POPPixelLogo_02 rotate: false xy: 2900, 2422 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_129 + index: 127 +POPPixelLogo_02 rotate: false xy: 2900, 2422 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_13 + index: 128 +POPPixelLogo_02 rotate: false xy: 324, 3148 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_130 + index: 12 +POPPixelLogo_02 rotate: false xy: 3222, 2664 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_131 + index: 129 +POPPixelLogo_02 rotate: false xy: 3544, 2906 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_132 + index: 130 +POPPixelLogo_02 rotate: false xy: 2, 2 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_133 + index: 131 +POPPixelLogo_02 rotate: false xy: 324, 244 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_134 + index: 132 +POPPixelLogo_02 rotate: false xy: 646, 486 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_135 + index: 133 +POPPixelLogo_02 rotate: false xy: 968, 728 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_136 + index: 134 +POPPixelLogo_02 rotate: false xy: 1290, 970 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_137 + index: 135 +POPPixelLogo_02 rotate: false xy: 1612, 1212 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_138 + index: 136 +POPPixelLogo_02 rotate: false xy: 1934, 1454 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_139 + index: 137 +POPPixelLogo_02 rotate: false xy: 1934, 1454 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_14 + index: 138 +POPPixelLogo_02 rotate: false xy: 646, 3390 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_140 + index: 13 +POPPixelLogo_02 rotate: false xy: 2256, 1696 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_141 + index: 139 +POPPixelLogo_02 rotate: false xy: 2578, 1938 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_142 + index: 140 +POPPixelLogo_02 rotate: false xy: 2900, 2180 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_143 + index: 141 +POPPixelLogo_02 rotate: false xy: 3222, 2422 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_144 + index: 142 +POPPixelLogo_02 rotate: false xy: 3544, 2664 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_145 + index: 143 +POPPixelLogo_02 rotate: false xy: 324, 2 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_146 + index: 144 +POPPixelLogo_02 rotate: false xy: 646, 244 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_147 + index: 145 +POPPixelLogo_02 rotate: false xy: 968, 486 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_148 + index: 146 +POPPixelLogo_02 rotate: false xy: 1290, 728 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_149 + index: 147 +POPPixelLogo_02 rotate: false xy: 1290, 728 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_15 + index: 148 +POPPixelLogo_02 rotate: false xy: 968, 3632 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_150 + index: 14 +POPPixelLogo_02 rotate: false xy: 1612, 970 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_151 + index: 149 +POPPixelLogo_02 rotate: false xy: 1934, 1212 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_152 + index: 150 +POPPixelLogo_02 rotate: false xy: 2256, 1454 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_153 + index: 151 +POPPixelLogo_02 rotate: false xy: 2578, 1696 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_154 + index: 152 +POPPixelLogo_02 rotate: false xy: 2900, 1938 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_155 + index: 153 +POPPixelLogo_02 rotate: false xy: 3222, 2180 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_156 + index: 154 +POPPixelLogo_02 rotate: false xy: 3544, 2422 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_157 + index: 155 +POPPixelLogo_02 rotate: false xy: 646, 2 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_158 + index: 156 +POPPixelLogo_02 rotate: false xy: 968, 244 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_159 + index: 157 +POPPixelLogo_02 rotate: false xy: 968, 244 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_16 + index: 158 +POPPixelLogo_02 rotate: false xy: 2, 2664 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_160 + index: 15 +POPPixelLogo_02 rotate: false xy: 1290, 486 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_161 + index: 159 +POPPixelLogo_02 rotate: false xy: 1612, 728 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_162 + index: 160 +POPPixelLogo_02 rotate: false xy: 1934, 970 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_163 + index: 161 +POPPixelLogo_02 rotate: false xy: 2256, 1212 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_164 + index: 162 +POPPixelLogo_02 rotate: false xy: 2578, 1454 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_165 + index: 163 +POPPixelLogo_02 rotate: false xy: 2900, 1696 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_166 + index: 164 +POPPixelLogo_02 rotate: false xy: 3222, 1938 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_167 + index: 165 +POPPixelLogo_02 rotate: false xy: 3544, 2180 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_168 + index: 166 +POPPixelLogo_02 rotate: false xy: 968, 2 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_169 + index: 167 +POPPixelLogo_02 rotate: false xy: 968, 2 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_17 + index: 168 +POPPixelLogo_02 rotate: false xy: 324, 2906 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_170 + index: 16 +POPPixelLogo_02 rotate: false xy: 1290, 244 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_171 + index: 169 +POPPixelLogo_02 rotate: false xy: 1612, 486 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_172 + index: 170 +POPPixelLogo_02 rotate: false xy: 1934, 728 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_173 + index: 171 +POPPixelLogo_02 rotate: false xy: 2256, 970 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_174 + index: 172 +POPPixelLogo_02 rotate: false xy: 2578, 1212 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_175 + index: 173 +POPPixelLogo_02 rotate: false xy: 2900, 1454 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_176 + index: 174 +POPPixelLogo_02 rotate: false xy: 3222, 1696 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_177 + index: 175 +POPPixelLogo_02 rotate: false xy: 3544, 1938 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_178 + index: 176 +POPPixelLogo_02 rotate: false xy: 1290, 2 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_179 + index: 177 +POPPixelLogo_02 rotate: false xy: 1290, 2 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_18 + index: 178 +POPPixelLogo_02 rotate: false xy: 646, 3148 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_19 + index: 17 +POPPixelLogo_02 rotate: false xy: 646, 3148 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_180 + index: 18 +POPPixelLogo_02 rotate: false xy: 1612, 244 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_181 + index: 179 +POPPixelLogo_02 rotate: false xy: 1934, 486 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_182 + index: 180 +POPPixelLogo_02 rotate: false xy: 2256, 728 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_183 + index: 181 +POPPixelLogo_02 rotate: false xy: 2578, 970 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_184 + index: 182 +POPPixelLogo_02 rotate: false xy: 2900, 1212 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_185 + index: 183 +POPPixelLogo_02 rotate: false xy: 3222, 1454 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_186 + index: 184 +POPPixelLogo_02 rotate: false xy: 3544, 1696 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_187 + index: 185 +POPPixelLogo_02 rotate: false xy: 1612, 2 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_190 + index: 186 +POPPixelLogo_02 rotate: false xy: 1934, 244 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_20 + index: 189 +POPPixelLogo_02 rotate: false xy: 968, 3390 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_21 + index: 19 +POPPixelLogo_02 rotate: false xy: 1290, 3632 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_22 + index: 20 +POPPixelLogo_02 rotate: false xy: 2, 2422 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_23 + index: 21 +POPPixelLogo_02 rotate: false xy: 324, 2664 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_24 + index: 22 +POPPixelLogo_02 rotate: false xy: 646, 2906 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_25 + index: 23 +POPPixelLogo_02 rotate: false xy: 968, 3148 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_26 + index: 24 +POPPixelLogo_02 rotate: false xy: 1290, 3390 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_27 + index: 25 +POPPixelLogo_02 rotate: false xy: 1612, 3632 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_28 + index: 26 +POPPixelLogo_02 rotate: false xy: 2, 2180 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_29 + index: 27 +POPPixelLogo_02 rotate: false xy: 2, 2180 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_30 + index: 28 +POPPixelLogo_02 rotate: false xy: 324, 2422 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_31 + index: 29 +POPPixelLogo_02 rotate: false xy: 646, 2664 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_32 + index: 30 +POPPixelLogo_02 rotate: false xy: 968, 2906 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_33 + index: 31 +POPPixelLogo_02 rotate: false xy: 1290, 3148 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_34 + index: 32 +POPPixelLogo_02 rotate: false xy: 1612, 3390 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_35 + index: 33 +POPPixelLogo_02 rotate: false xy: 1934, 3632 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_36 + index: 34 +POPPixelLogo_02 rotate: false xy: 2, 1938 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_37 + index: 35 +POPPixelLogo_02 rotate: false xy: 324, 2180 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_38 + index: 36 +POPPixelLogo_02 rotate: false xy: 646, 2422 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_39 + index: 37 +POPPixelLogo_02 rotate: false xy: 646, 2422 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_40 + index: 38 +POPPixelLogo_02 rotate: false xy: 968, 2664 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_41 + index: 39 +POPPixelLogo_02 rotate: false xy: 1290, 2906 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_42 + index: 40 +POPPixelLogo_02 rotate: false xy: 1612, 3148 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_43 + index: 41 +POPPixelLogo_02 rotate: false xy: 1934, 3390 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_44 + index: 42 +POPPixelLogo_02 rotate: false xy: 2256, 3632 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_45 + index: 43 +POPPixelLogo_02 rotate: false xy: 2, 1696 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_46 + index: 44 +POPPixelLogo_02 rotate: false xy: 324, 1938 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_47 + index: 45 +POPPixelLogo_02 rotate: false xy: 646, 2180 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_48 + index: 46 +POPPixelLogo_02 rotate: false xy: 968, 2422 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_49 + index: 47 +POPPixelLogo_02 rotate: false xy: 968, 2422 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_50 + index: 48 +POPPixelLogo_02 rotate: false xy: 1290, 2664 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_51 + index: 49 +POPPixelLogo_02 rotate: false xy: 1612, 2906 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_52 + index: 50 +POPPixelLogo_02 rotate: false xy: 1934, 3148 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_53 + index: 51 +POPPixelLogo_02 rotate: false xy: 2256, 3390 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_54 + index: 52 +POPPixelLogo_02 rotate: false xy: 2578, 3632 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_55 + index: 53 +POPPixelLogo_02 rotate: false xy: 2, 1454 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_56 + index: 54 +POPPixelLogo_02 rotate: false xy: 324, 1696 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_57 + index: 55 +POPPixelLogo_02 rotate: false xy: 646, 1938 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_58 + index: 56 +POPPixelLogo_02 rotate: false xy: 968, 2180 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_59 + index: 57 +POPPixelLogo_02 rotate: false xy: 968, 2180 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_6 + index: 58 +POPPixelLogo_02 rotate: false xy: 2, 3390 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_60 + index: 5 +POPPixelLogo_02 rotate: false xy: 1290, 2422 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_61 + index: 59 +POPPixelLogo_02 rotate: false xy: 1612, 2664 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_62 + index: 60 +POPPixelLogo_02 rotate: false xy: 1934, 2906 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_63 + index: 61 +POPPixelLogo_02 rotate: false xy: 2256, 3148 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_64 + index: 62 +POPPixelLogo_02 rotate: false xy: 2578, 3390 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_65 + index: 63 +POPPixelLogo_02 rotate: false xy: 2900, 3632 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_66 + index: 64 +POPPixelLogo_02 rotate: false xy: 2, 1212 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_67 + index: 65 +POPPixelLogo_02 rotate: false xy: 324, 1454 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_68 + index: 66 +POPPixelLogo_02 rotate: false xy: 646, 1696 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_69 + index: 67 +POPPixelLogo_02 rotate: false xy: 646, 1696 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_7 + index: 68 +POPPixelLogo_02 rotate: false xy: 324, 3632 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_70 + index: 6 +POPPixelLogo_02 rotate: false xy: 968, 1938 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_71 + index: 69 +POPPixelLogo_02 rotate: false xy: 1290, 2180 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_72 + index: 70 +POPPixelLogo_02 rotate: false xy: 1612, 2422 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_73 + index: 71 +POPPixelLogo_02 rotate: false xy: 1934, 2664 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_74 + index: 72 +POPPixelLogo_02 rotate: false xy: 2256, 2906 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_75 + index: 73 +POPPixelLogo_02 rotate: false xy: 2578, 3148 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_76 + index: 74 +POPPixelLogo_02 rotate: false xy: 2900, 3390 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_77 + index: 75 +POPPixelLogo_02 rotate: false xy: 3222, 3632 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_78 + index: 76 +POPPixelLogo_02 rotate: false xy: 2, 970 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_79 + index: 77 +POPPixelLogo_02 rotate: false xy: 2, 970 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_8 + index: 78 +POPPixelLogo_02 rotate: false xy: 2, 3148 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_9 + index: 7 +POPPixelLogo_02 rotate: false xy: 2, 3148 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_80 + index: 8 +POPPixelLogo_02 rotate: false xy: 324, 1212 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_81 + index: 79 +POPPixelLogo_02 rotate: false xy: 646, 1454 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_82 + index: 80 +POPPixelLogo_02 rotate: false xy: 968, 1696 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_83 + index: 81 +POPPixelLogo_02 rotate: false xy: 1290, 1938 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_84 + index: 82 +POPPixelLogo_02 rotate: false xy: 1612, 2180 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_85 + index: 83 +POPPixelLogo_02 rotate: false xy: 1934, 2422 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_86 + index: 84 +POPPixelLogo_02 rotate: false xy: 2256, 2664 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_87 + index: 85 +POPPixelLogo_02 rotate: false xy: 2578, 2906 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_88 + index: 86 +POPPixelLogo_02 rotate: false xy: 2900, 3148 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_89 + index: 87 +POPPixelLogo_02 rotate: false xy: 2900, 3148 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_90 + index: 88 +POPPixelLogo_02 rotate: false xy: 3222, 3390 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_91 + index: 89 +POPPixelLogo_02 rotate: false xy: 3544, 3632 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_92 + index: 90 +POPPixelLogo_02 rotate: false xy: 2, 728 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_93 + index: 91 +POPPixelLogo_02 rotate: false xy: 324, 970 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_94 + index: 92 +POPPixelLogo_02 rotate: false xy: 646, 1212 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_95 + index: 93 +POPPixelLogo_02 rotate: false xy: 968, 1454 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_96 + index: 94 +POPPixelLogo_02 rotate: false xy: 1290, 1696 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_97 + index: 95 +POPPixelLogo_02 rotate: false xy: 1612, 1938 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_98 + index: 96 +POPPixelLogo_02 rotate: false xy: 1934, 2180 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 -POPPixelLogo_02_99 + index: 97 +POPPixelLogo_02 rotate: false xy: 1934, 2180 size: 320, 240 orig: 320, 240 offset: 0, 0 - index: -1 + index: 98 diff --git a/desktop/resources/ui/ui.json b/desktop/resources/ui/ui.json index abbd2a24..19dea2c2 100644 --- a/desktop/resources/ui/ui.json +++ b/desktop/resources/ui/ui.json @@ -1,5 +1,5 @@ { - com.badlogic.gdx.graphics.g2d.BitmapFont: { default-font: { file: ego/font.fnt, scale: 0.5 }, button-font: { file: ego/button-font.fnt }} + com.badlogic.gdx.graphics.g2d.BitmapFont: { default-font: { file: ego/font.fnt, scale: 0.5 }, button-font: { file: ego/button-font.fnt, scale: 0.5 }} com.badlogic.gdx.graphics.Color: { button-font-up: {hex: 19003Dff }, gray: {hex: 21172Eff }, diff --git a/desktop/src-common/advent/core.clj b/desktop/src-common/advent/core.clj index 40ecbd21..55824593 100644 --- a/desktop/src-common/advent/core.clj +++ b/desktop/src-common/advent/core.clj @@ -43,7 +43,8 @@ (defgame advent :on-create (fn [this] - (create-game advent))) + (steam/init) + (create-game advent))) (defn reload [] (on-gl (set-screen! advent title/title-screen))) diff --git a/desktop/src-common/advent/screens/rooms/common.clj b/desktop/src-common/advent/screens/rooms/common.clj index 4b8fa059..76f00c8c 100644 --- a/desktop/src-common/advent/screens/rooms/common.clj +++ b/desktop/src-common/advent/screens/rooms/common.clj @@ -545,10 +545,12 @@ (-> e (assoc-in [:room :entities :penultimate-black :opacity] 1) (assoc-in [:cam :paused?] false) - (update-in [:room :entities :black-blowup] (fn [b] - (particle-effect! b :reset) - (particle-effect! b :start) - b))))) + (update-in [:room :entities (if won? :black-blowup-big + :black-blowup)] + (fn [b] + (particle-effect! b :reset) + (particle-effect! b :start) + b))))) (println "doing screen shake?") (actions/camera-shake entities 8.0) diff --git a/desktop/src-common/advent/screens/rooms/tongue_fight.clj b/desktop/src-common/advent/screens/rooms/tongue_fight.clj index 34c14e78..23892e7c 100644 --- a/desktop/src-common/advent/screens/rooms/tongue_fight.clj +++ b/desktop/src-common/advent/screens/rooms/tongue_fight.clj @@ -145,6 +145,7 @@ heart (utils/make-anim-seq atlas "heart" [24 24] 0.08 [3]) beat (utils/make-anim-seq atlas "heart" [24 24] 0.08 [0 1 0 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3]) black-blowup (particle-effect "particles/black-blowup") + black-blowup-big (particle-effect "particles/black-blowup-big") tongue-idle (utils/make-anim-seq atlas "tongue-idle/tongue-idle" [135 145] 0.16 (range 5)) tongue-windup (utils/make-anim-seq atlas "tongue-windup" [135 145] 0.16 [0 1 2 3 2 1 2 3 2 1 0 ]) @@ -195,6 +196,10 @@ :black-blowup (assoc black-blowup :x 222 :y 85 :baseline 241) + + :black-blowup-big (assoc black-blowup-big + :x 222 :y 85 + :baseline 241) :hair-0 (assoc (animation->texture screen hair-0) :x 35 :y 46 diff --git a/desktop/src-common/advent/screens/scene.clj b/desktop/src-common/advent/screens/scene.clj index e06092c5..374aba2c 100644 --- a/desktop/src-common/advent/screens/scene.clj +++ b/desktop/src-common/advent/screens/scene.clj @@ -1098,7 +1098,10 @@ (update-in entities [:tweens] dissoc :cam-x :cam-y :cam-zoom)) (defn render [{:keys [^OrthographicCamera camera ^FitViewport viewport ^Stage renderer] :as screen} {{:keys [last-pos ] [cursor-offset-x cursor-offset-y] :offset} :cursor :keys [tweens] :as entities} options] - #_(steam/update) + (utils/platformify + nil + nil + (steam/update)) (.apply viewport) (if (-> entities :closing? :value) diff --git a/desktop/src-common/advent/screens/splash.clj b/desktop/src-common/advent/screens/splash.clj index e5d682f9..2ffe2101 100644 --- a/desktop/src-common/advent/screens/splash.clj +++ b/desktop/src-common/advent/screens/splash.clj @@ -94,6 +94,7 @@ (utils/play-music (:pop-music entities)) (-> entities (assoc-in [:pop-logo :anim-start] (:total-time screen)) + (assoc-in [:pop-logo :opacity] 1.0) (assoc-in [:pop-logo :anim] (get-in entities [:pop-logo :main-anim])))) :duration 10.0}])) @@ -112,12 +113,17 @@ :on-show (fn [screen entities options] (let [[screen splash-atlas] (utils/acquire-atlas screen "packed/splash.atlas") - [screen global-atlas] (utils/acquire-atlas screen "packed/global.atlas")] + [screen global-atlas] (utils/acquire-atlas screen "packed/global.atlas") + [screen pop-logo-atlas] (if utils/mobile? + [screen nil] + (utils/acquire-atlas screen "packed-pop-logo/pack.atlas"))] (utils/setup-viewport screen 1280 960) (log/info "Starting splash screen.") (graphics! :set-cursor (utils/cursor "cursor.png" :hourglass)) (let [screen (assoc screen :total-time 0) - pop-anim (make-anim-seq splash-atlas "POPPixelLogo_02" [320 240] 0.05 (repeat 200 0)) + pop-anim (if utils/mobile? + (make-anim-seq splash-atlas "POPPixelLogo_02" [320 240] 0.05 (repeat 200 0)) + (make-anim-seq pop-logo-atlas "POPPixelLogo_02" [320 240] 0.05 (range 200))) entities {:background (assoc (utils/atlas->texture global-atlas "black.png") :scale-x 80 :scale-y 80 @@ -126,12 +132,12 @@ :origin-y 0 :z 0) :pop-logo (assoc (animation->texture screen pop-anim) - :anim pop-anim + :main-anim pop-anim :x 0 :y 0 :origin-x 0 :origin-y 0 :scale-x 4 :scale-y 4 :z 1 - :opacity (if utils/mobile? 0.0 1.0)) + :opacity 0.0) :dbhlogo (assoc (utils/atlas->texture splash-atlas "dbh.png") :x 0 :y 0 :origin-x 0 :origin-y 0 :scale-x 4 :scale-y 4 :z 1 :opacity 0.0) :steps steps :pop-music (utils/make-music "music/POPPixelLogo2Audiomix_mixdown.ogg") @@ -144,7 +150,10 @@ :on-render (fn [{:keys [^FitViewport viewport] :as screen} entities options] - #_(steam/update) + (utils/platformify + nil + nil + (steam/update)) (.apply viewport) (clear!) (let [entities (utils/apply-tweens screen entities (:tweens entities)) diff --git a/desktop/src-common/advent/screens/title.clj b/desktop/src-common/advent/screens/title.clj index 80e74b66..b2156bbf 100644 --- a/desktop/src-common/advent/screens/title.clj +++ b/desktop/src-common/advent/screens/title.clj @@ -134,6 +134,7 @@ (tween/tween :fade-out-music screen [:volume] 1.0 0.0 1.0))))) (defn button-style [] + (let [^TextButton$TextButtonStyle style (skin! (skin "ui/ui.json") :get TextButton$TextButtonStyle) tx (-> style .font .getRegion .getTexture)] (-> style .font .getData (.setScale utils/button-font-scale)) @@ -149,7 +150,11 @@ ([msg & rest] (let [button (merge (text-button msg (button-style)) (apply hash-map rest))] - + (utils/platformify + nil + nil + (doto (text-button! button :get-label) + (.setFontScale 0.5))) (doto button save-object)))) @@ -164,10 +169,15 @@ ([msg checked & rest] (let [s (skin! (skin "ui/ui.json") :get CheckBox$CheckBoxStyle)] (-> s .font .getData (.setScale utils/title-label-scale)) - (doto (merge (check-box msg s) - (apply hash-map rest)) - (set-checkbox-state checked) - save-object)))) + (let [checkbox-entity (merge (check-box msg s) + (apply hash-map rest))] + (utils/platformify + nil + nil + (doto (check-box! checkbox-entity :get-label) + (.setFontScale 0.25))) + (set-checkbox-state checkbox-entity checked) + (save-object checkbox-entity))))) (defn make-label ([msg] @@ -456,7 +466,10 @@ :on-render (fn [{:keys [^FitViewport viewport] :as screen} entities options] - #_(steam/update) + (utils/platformify + nil + nil + (steam/update)) (.apply viewport) (clear!) (let [entities (utils/apply-tweens screen entities (:tweens entities)) diff --git a/desktop/src-common/advent/steam.clj b/desktop/src-common/advent/steam.clj index 05790fd8..13eb0a70 100644 --- a/desktop/src-common/advent/steam.clj +++ b/desktop/src-common/advent/steam.clj @@ -1,59 +1,151 @@ (ns advent.steam (:require [play-clj.core :refer :all]) - (:import [com.badlogic.gdx.graphics Pixmap PixmapIO$PNG] + (:import [java.nio ByteBuffer CharBuffer] + [java.io ByteArrayOutputStream] + [com.badlogic.gdx.graphics Pixmap PixmapIO$PNG] [com.badlogic.gdx.files FileHandle])) (def has-steam? - false - ) + (if (= "desktop" (System/getProperty "platform")) + (try + (import '[com.codedisaster.steamworks SteamUserStats SteamUserStatsCallback SteamAPI SteamRemoteStorage]) + true + (catch Exception e + false)) + false)) (println "loading steam") -(def is-app-store? false) +(defmacro steamify [steam-version & [regular-version]] + (if has-steam? + `(if (and has-steam? (not (System/getProperty "no-steam"))) + ~steam-version + ~regular-version) + regular-version)) + +(defn init [] + (steamify + (if (SteamAPI/init) + (println "Steam initialized") + (do + (println "Steam not initialized") + (def has-steam? false))))) + +(defn update [] + (steamify + (when (SteamAPI/isSteamRunning) + (SteamAPI/runCallbacks)))) + +(if has-steam? + (eval + '(do + (defn achievement-fn [f achievement] + (steamify + (let [stats (atom nil)] + (println "Getting stats...") + (reset! stats (SteamUserStats. (reify SteamUserStatsCallback + (onUserStatsReceived [_ _ _ _] + (f @stats achievement) + ) + (onUserStatsStored [_ _ _]) + (onUserAchievementStored [_ _ _ _ _ _])))) + (.requestCurrentStats @stats)))) + + (def set-achievement (partial achievement-fn + (fn [^SteamUserStats stats ^String achievement] + (println "Setting achievement" achievement) + (.setAchievement stats achievement) + (.storeStats stats) + (println "Done setting achievement" achievement)))) + + (def clear-achievement (partial achievement-fn + (fn [^SteamUserStats stats ^String achievement] + (println "Clearing achievement" achievement) + (.clearAchievement stats achievement) + (.storeStats stats) + (println "Done clearing achievement" achievement))))) + + ) + (do + (defn set-achievement [achievement]) + (defn clear-achievement [achievement]))) + + +(def is-app-store? (System/getProperty "app-store")) (def all-achievements ["PARDON" "EX_CON" "PRO_WRESTLER" "SHEEP_HORDER" "SAFE_AND_SOUND" "DESTINY" "WISE_UP" "TONGUESBANE" "KITTY_KISS" "BEHOLDER" "MOUTH_DIVER"]) -(defn clear-achievement []) - -(defn set-achievement [x]) - (defn clear-all-achievements [] (doall (map clear-achievement all-achievements))) (defn get-bytes [filename] - (.readBytes (if is-app-store? - (files! :external filename) - (files! :local filename)))) + (steamify + (let [rs (SteamRemoteStorage. nil) + len (.getFileSize rs filename) + bb (ByteBuffer/allocateDirect len) + bytes (make-array Byte/TYPE len)] + (.fileRead rs filename bb len) + (.get bb bytes) + bytes) + (.readBytes (if is-app-store? + (files! :external filename) + (files! :local filename))))) (defn write-bytes [filename bytes] - (let [f (if is-app-store? - (files! :external filename) - (files! :local filename))] - (.writeBytes f bytes false))) + (steamify + (let [rs (SteamRemoteStorage. nil) + bb (ByteBuffer/allocateDirect (* 2 (count bytes)))] + (-> bb (.put bytes) ) + (.fileWrite rs filename bb (* 2 (count bytes)))) + (let [f (if is-app-store? + (files! :external filename) + (files! :local filename))] + (.writeBytes f bytes false)))) (defn list-edn-files [] - (if is-app-store? - (for [save-file (.list (files! :external "saves/") ".edn")] - (str "saves/" (.name ^FileHandle save-file))) - (for [save-file (.list (files! :local "saves/") ".edn")] - (str "saves/" (.name ^FileHandle save-file))))) + (steamify + (let [rs (SteamRemoteStorage. nil)] + (for [i (range (.getFileCount rs)) + :let [n (.getFileNameAndSize rs i (make-array Integer/TYPE 1))] + :when (.endsWith n ".edn")] + n)) + (if is-app-store? + (for [save-file (.list (files! :external "saves/") ".edn")] + (str "saves/" (.name ^FileHandle save-file))) + (for [save-file (.list (files! :local "saves/") ".edn")] + (str "saves/" (.name ^FileHandle save-file)))))) (defn save-screenshot [^Pixmap pm ^String filename] - (let [f (if is-app-store? - (files! :external filename) - (files! :local filename)) - png (PixmapIO$PNG. (* (.getWidth pm) (.getHeight pm) 1.5))] - - (.write png f pm) - (.dispose png))) + (steamify + (let [rs (SteamRemoteStorage. nil) + png (PixmapIO$PNG. (* (.getWidth pm) (.getHeight pm) 1.5)) + baos (ByteArrayOutputStream. (* (.getWidth pm) (.getHeight pm) 1.5)) + _ (.write png baos pm) + bytes (.toByteArray baos) + bb (ByteBuffer/allocateDirect (count bytes))] + (.put bb bytes) + (.fileWrite rs filename bb (count bytes))) + (let [f (if is-app-store? + (files! :external filename) + (files! :local filename)) + png (PixmapIO$PNG. (* (.getWidth pm) (.getHeight pm) 1.5))] + + (.write png f pm) + (.dispose png)))) (defn delete-file [filename] - (let [file (if is-app-store? - (files! :external filename) - (files! :local filename))] - (when (.exists file) - (.delete file)))) + (steamify + (.fileDelete (SteamRemoteStorage. nil) filename) + (let [file (if is-app-store? + (files! :external filename) + (files! :local filename))] + (when (.exists file) + (.delete file))))) (defn save-screenshot-file-name [name] - (str "saves/screenshot-" (clojure.core/name name) ".png" )) + (steamify + (str "screenshot-" (clojure.core/name name) ".png" ) + (str "saves/screenshot-" (clojure.core/name name) ".png" ))) (defn save-file-name [id] - (str "saves/" id ".edn")) + (steamify + (str id ".edn") + (str "saves/" id ".edn"))) diff --git a/desktop/src-common/advent/utils.clj b/desktop/src-common/advent/utils.clj index e49998a7..18b963d8 100644 --- a/desktop/src-common/advent/utils.clj +++ b/desktop/src-common/advent/utils.clj @@ -33,7 +33,8 @@ entity) -(def ui-scale (Double/parseDouble (str (or (System/getProperty "ui_scale") 1.5)))) + +(def ui-scale (doto (Double/parseDouble (str (or (System/getProperty "ui_scale") 1.5))) (println "UI scale"))) (def button-scale (+ 1 (* (- ui-scale 1.0) 2.0))) (def mobile? (= 1.5 ui-scale)) (def max-zoom (if mobile? 0.5 0.75)) @@ -306,8 +307,7 @@ edn/read-string))) (defn get-font [filename] - (let [font (-> (bitmap-font filename) - #_(doto (bitmap-font! :set-font-scale 0.5 0.5))) + (let [font (-> (bitmap-font filename)) tr (bitmap-font! font :get-region) tx (.getTexture tr)] (call! ^Texture tx :set-filter Texture$TextureFilter/Linear Texture$TextureFilter/Linear)