IAPing.
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
(defproject advent "1.3.16-SNAPSHOT"
|
(def version (str "2.0." (clojure.string/trim-newline (slurp "../desktop/last-release")) "-snapshot"))
|
||||||
|
(defproject advent version
|
||||||
:description "FIXME: write description"
|
:description "FIXME: write description"
|
||||||
|
:manifest {"Implementation-Version" version}
|
||||||
|
|
||||||
:dependencies [[com.badlogicgames.gdx/gdx "1.9.3" :use-resources true]
|
:dependencies [[com.badlogicgames.gdx/gdx "1.9.3" :use-resources true]
|
||||||
[com.badlogicgames.gdx/gdx-backend-lwjgl "1.9.3"]
|
[com.badlogicgames.gdx/gdx-backend-lwjgl "1.9.3"]
|
||||||
@@ -38,6 +40,7 @@
|
|||||||
;; key you want to sign APKs with.
|
;; key you want to sign APKs with.
|
||||||
;; :keystore-path "ticks-talkes-release.jks"
|
;; :keystore-path "ticks-talkes-release.jks"
|
||||||
;; :key-alias "ticks-tales-release"
|
;; :key-alias "ticks-tales-release"
|
||||||
|
:jvm-opts ["-Dplatform=android"]
|
||||||
:build-type :release
|
:build-type :release
|
||||||
:aot :all-with-unused
|
:aot :all-with-unused
|
||||||
:aot-exclude-ns [cljs.core.async.macros cljs.core.impl-ioc-macros cljs.core.impl.ioc_macros]}}}
|
:aot-exclude-ns [cljs.core.async.macros cljs.core.impl-ioc-macros cljs.core.impl.ioc_macros]}}}
|
||||||
|
|||||||
@@ -1,22 +1,22 @@
|
|||||||
(ns advent.android
|
(ns advent.android
|
||||||
(:import [com.android.billingclient.api PurchasesUpdatedListener PurchaseHistoryResponseListener Purchase$PurchasesResult])
|
(:import [com.android.billingclient.api PurchasesUpdatedListener PurchaseHistoryResponseListener Purchase$PurchasesResult]
|
||||||
(:require [clojure.core.async :as a]))
|
[com.badlogic.gdx Gdx Application])
|
||||||
|
(:require [clojure.core.async :as a]
|
||||||
(def purchase-chan (a/chan))
|
[advent.iap :as iap]))
|
||||||
|
|
||||||
(def listener
|
(def listener
|
||||||
(reify PurchasesUpdatedListener
|
(reify PurchasesUpdatedListener
|
||||||
(onPurchasesUpdated [this response-code purchases]
|
(onPurchasesUpdated [this response-code purchases]
|
||||||
(println response-code purchases)
|
(println response-code purchases)
|
||||||
(let [result (and purchases (> (.size purchases) 0))]
|
(let [result (and purchases (> (.size purchases) 0))]
|
||||||
(reset! @(resolve 'advent.core/has-purchased?) (if result true false))
|
(println "purchase response" result)
|
||||||
(a/go (a/>! purchase-chan (if result true false)))))) )
|
(iap/set-purchase-pref (if result true false))))) )
|
||||||
|
|
||||||
(def history-listener
|
(def history-listener
|
||||||
(reify PurchaseHistoryResponseListener
|
(reify PurchaseHistoryResponseListener
|
||||||
(onPurchaseHistoryResponse [this purchases-result]
|
(onPurchaseHistoryResponse [this purchases-result]
|
||||||
(println "got history")
|
(reset! iap/can-purchase? true)
|
||||||
(let [result (and purchases-result (.getPurchasesList purchases-result) (> (.size (.getPurchasesList purchases-result)) 0))]
|
(let [result (and purchases-result (.getPurchasesList purchases-result) (> (.size (.getPurchasesList purchases-result)) 0))]
|
||||||
(reset! @(resolve 'advent.core/has-purchased?) (if result true false))
|
(println "purchase history" result)
|
||||||
(a/go (a/>! purchase-chan (if result true false)))))) )
|
(iap/set-purchase-pref (if result true false))))) )
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import com.android.billingclient.api.BillingClient.SkuType;
|
|||||||
import com.android.billingclient.api.SkuDetails.SkuDetailsResult;
|
import com.android.billingclient.api.SkuDetails.SkuDetailsResult;
|
||||||
import com.android.billingclient.api.BillingFlowParams;
|
import com.android.billingclient.api.BillingFlowParams;
|
||||||
import com.android.billingclient.api.BillingFlowParams.Builder;
|
import com.android.billingclient.api.BillingFlowParams.Builder;
|
||||||
|
import android.content.pm.*;
|
||||||
|
|
||||||
public class MainActivity extends AndroidApplication {
|
public class MainActivity extends AndroidApplication {
|
||||||
public boolean triggerPurchase() {
|
public boolean triggerPurchase() {
|
||||||
@@ -26,10 +27,19 @@ public class MainActivity extends AndroidApplication {
|
|||||||
|
|
||||||
public void onCreate (android.os.Bundle savedInstanceState) {
|
public void onCreate (android.os.Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
RT.var("clojure.core", "require").invoke(Symbol.intern("clojure.core.async"));
|
RT.var("clojure.core", "require").invoke(Symbol.intern("clojure.core.async"));
|
||||||
RT.var("clojure.core", "require").invoke(Symbol.intern("advent.core"));
|
RT.var("clojure.core", "require").invoke(Symbol.intern("advent.core"));
|
||||||
RT.var("clojure.core", "require").invoke(Symbol.intern("advent.android"));
|
RT.var("clojure.core", "require").invoke(Symbol.intern("advent.android"));
|
||||||
|
|
||||||
|
try {
|
||||||
|
PackageInfo pInfo = this.getPackageManager().getPackageInfo(this.getPackageName(), 0);
|
||||||
|
String version = pInfo.versionName;
|
||||||
|
RT.var("advent.version", "version-override").bindRoot(version);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.out.println("Importing failed");
|
System.out.println("Importing failed");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
4
|
6
|
||||||
|
|||||||
@@ -37,12 +37,12 @@
|
|||||||
"script" ["run" "-m" "advent.analyze/dump-speech"]}
|
"script" ["run" "-m" "advent.analyze/dump-speech"]}
|
||||||
:profiles {
|
:profiles {
|
||||||
:uberjar {
|
:uberjar {
|
||||||
:jvm-opts ["-Duse-repl=false" "-Dui_scale=1.0" "-Dno-steam=true" "-Dclojure.compiler.direct-linking=true" "-Dis-desktop=true"]
|
:jvm-opts ["-Duse-repl=false" "-Dui_scale=1.0" "-Dno-steam=true" "-Dclojure.compiler.direct-linking=true" "-Dis-desktop=true" "-Dplatform=desktop"]
|
||||||
:aot :all
|
:aot :all
|
||||||
}
|
}
|
||||||
:dev {
|
:dev {
|
||||||
:source-paths ["src" "src-common" "src-dev"]
|
:source-paths ["src" "src-common" "src-dev"]
|
||||||
:jvm-opts ["-Duse-repl=true" "-Dui_scale=1.0" "-Dno-steam=true" "-Dclojure.compiler.direct-linking=true" "-Dis-desktop=true"]
|
:jvm-opts ["-Duse-repl=true" "-Dui_scale=1.0" "-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.5.3"]
|
||||||
[org.clojure/tools.nrepl "0.2.12"]
|
[org.clojure/tools.nrepl "0.2.12"]
|
||||||
[play-clj-nrepl "0.1.0" :exclusions [play-clj]]
|
[play-clj-nrepl "0.1.0" :exclusions [play-clj]]
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
:warn-on-reflection true}
|
:warn-on-reflection true}
|
||||||
:mobile-dev {
|
:mobile-dev {
|
||||||
:source-paths ["src" "src-common" "src-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"]
|
: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.5.3"]
|
||||||
[org.clojure/tools.nrepl "0.2.12"]
|
[org.clojure/tools.nrepl "0.2.12"]
|
||||||
[play-clj-nrepl "0.1.0" :exclusions [play-clj]]
|
[play-clj-nrepl "0.1.0" :exclusions [play-clj]]
|
||||||
@@ -62,16 +62,16 @@
|
|||||||
#_#_:warn-on-reflection true}
|
#_#_:warn-on-reflection true}
|
||||||
:app-store {
|
:app-store {
|
||||||
:source-paths ["src" "src-common" "src-dev"]
|
:source-paths ["src" "src-common" "src-dev"]
|
||||||
:jvm-opts ["-Dapp-store=true" "-Dui_scale=1.0" "-Dno-steam=true" "-Dis-desktop=true"]
|
:jvm-opts ["-Dapp-store=true" "-Dui_scale=1.0" "-Dno-steam=true" "-Dis-desktop=true" "-Dplatform=desktop"]
|
||||||
|
|
||||||
:aot :all
|
:aot :all
|
||||||
|
|
||||||
:warn-on-reflection true}
|
:warn-on-reflection true}
|
||||||
:steam {:dependencies [[com.code-disaster.steamworks4j/steamworks4j "1.2.2"]]
|
:steam {:dependencies [[com.code-disaster.steamworks4j/steamworks4j "1.2.2"]]
|
||||||
:jvm-opts ["-Dis-desktop=true" "-Dui_scale=1.0" ]}
|
:jvm-opts ["-Dis-desktop=true" "-Dui_scale=1.0" "-Dplatform=desktop"]}
|
||||||
:steam-dev {
|
:steam-dev {
|
||||||
:source-paths ["src" "src-common" "src-dev"]
|
:source-paths ["src" "src-common" "src-dev"]
|
||||||
:jvm-opts ["-Duse-repl=true" "-Dui_scale=1.0" "-Dis-desktop=true"]
|
: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.5.3"]
|
||||||
[org.clojure/tools.nrepl "0.2.7"]
|
[org.clojure/tools.nrepl "0.2.7"]
|
||||||
[play-clj-nrepl "0.1.0" :exclusions [play-clj]]
|
[play-clj-nrepl "0.1.0" :exclusions [play-clj]]
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
[advent.screens.safe :as safe]
|
[advent.screens.safe :as safe]
|
||||||
[advent.screens.fade :as fade]
|
[advent.screens.fade :as fade]
|
||||||
[advent.steam :as steam]
|
[advent.steam :as steam]
|
||||||
|
[advent.iap :as iap]
|
||||||
|
|
||||||
[advent.pathfind])
|
[advent.pathfind])
|
||||||
(:import [com.badlogic.gdx.graphics Pixmap Pixmap$Filter Texture Texture$TextureFilter]
|
(:import [com.badlogic.gdx.graphics Pixmap Pixmap$Filter Texture Texture$TextureFilter]
|
||||||
@@ -21,12 +22,13 @@
|
|||||||
[com.badlogic.gdx Gdx Application]
|
[com.badlogic.gdx Gdx Application]
|
||||||
[java.io FileOutputStream File PrintStream]))
|
[java.io FileOutputStream File PrintStream]))
|
||||||
|
|
||||||
(def has-purchased? (atom false))
|
|
||||||
|
|
||||||
(defonce am (asset-manager))
|
(defonce am (asset-manager))
|
||||||
|
|
||||||
|
|
||||||
(set-asset-manager! am)
|
(set-asset-manager! am)
|
||||||
(defn create-game [advent]
|
(defn create-game [advent]
|
||||||
|
(iap/use-pref)
|
||||||
|
|
||||||
(set-screen-wrapper! (fn [screen screen-fn]
|
(set-screen-wrapper! (fn [screen screen-fn]
|
||||||
(try (screen-fn)
|
(try (screen-fn)
|
||||||
(catch Exception e
|
(catch Exception e
|
||||||
|
|||||||
@@ -16,7 +16,9 @@
|
|||||||
[play-clj.math :refer :all]
|
[play-clj.math :refer :all]
|
||||||
[play-clj.ui :refer :all]
|
[play-clj.ui :refer :all]
|
||||||
[play-clj.utils :refer :all]
|
[play-clj.utils :refer :all]
|
||||||
[play-clj.g2d :refer :all])
|
[play-clj.g2d :refer :all]
|
||||||
|
[advent.iap :as iap]
|
||||||
|
[advent.ios :as ios])
|
||||||
(:import [com.badlogic.gdx.graphics Color]
|
(:import [com.badlogic.gdx.graphics Color]
|
||||||
[com.badlogic.gdx Application Gdx]))
|
[com.badlogic.gdx Application Gdx]))
|
||||||
|
|
||||||
@@ -378,15 +380,10 @@
|
|||||||
:label "Pit of destiny"
|
:label "Pit of destiny"
|
||||||
:cursor :look
|
:cursor :look
|
||||||
:script (actions/get-script entities
|
:script (actions/get-script entities
|
||||||
(println "billing purchased before" @@(resolve 'advent.core/has-purchased?))
|
|
||||||
|
|
||||||
(when-not @@(resolve 'advent.core/has-purchased?)
|
|
||||||
(.triggerPurchase (Gdx/app))
|
(actions/walk-to entities :ego [154 41])
|
||||||
(a/<!! @(resolve 'advent.android/purchase-chan)))
|
(actions/talk entities :ego "Wow! That's a long way down."))
|
||||||
(println "billing purchased now:" @@(resolve 'advent.core/has-purchased?))
|
|
||||||
(when @@(resolve 'advent.core/has-purchased?)
|
|
||||||
(actions/walk-to entities :ego [154 41])
|
|
||||||
(actions/talk entities :ego "Wow! That's a long way down.")))
|
|
||||||
:scripts {:shovel (actions/get-script entities
|
:scripts {:shovel (actions/get-script entities
|
||||||
(actions/walk-to entities :ego [154 41])
|
(actions/walk-to entities :ego [154 41])
|
||||||
(actions/talk entities :ego "I guess I'm doomed to be a gravedigger.")
|
(actions/talk entities :ego "I guess I'm doomed to be a gravedigger.")
|
||||||
|
|||||||
@@ -8,7 +8,9 @@
|
|||||||
[advent.tween :as tween]
|
[advent.tween :as tween]
|
||||||
[advent.steam :as steam]
|
[advent.steam :as steam]
|
||||||
[advent.utils :as utils]
|
[advent.utils :as utils]
|
||||||
|
[advent.iap :as iap]
|
||||||
[clojure.zip :as zip]
|
[clojure.zip :as zip]
|
||||||
|
[clojure.core.async :as a]
|
||||||
[clojure.string :as str]
|
[clojure.string :as str]
|
||||||
[play-clj.core :refer :all]
|
[play-clj.core :refer :all]
|
||||||
[play-clj.ui :refer :all]
|
[play-clj.ui :refer :all]
|
||||||
@@ -634,28 +636,35 @@
|
|||||||
(actions/walk-to entities :ego [257 90] :face :right :skip-type :end)
|
(actions/walk-to entities :ego [257 90] :face :right :skip-type :end)
|
||||||
(actions/talk entities :ego (str "Anyone home?"))
|
(actions/talk entities :ego (str "Anyone home?"))
|
||||||
(actions/play-animation entities :ego :reach)
|
(actions/play-animation entities :ego :reach)
|
||||||
(cond
|
(when-not @iap/has-purchased?
|
||||||
(get-in @entities [:room :entities :wizard])
|
(when @iap/can-purchase?
|
||||||
(actions/do-dialogue entities :wizard "What are you doing, boy?"
|
(actions/talk entities :ego "Uh-oh! It looks like it's guarded by a warding spell!")
|
||||||
:wizard "I'm right here.")
|
(actions/talk entities :ego "Looks like I need to buy an unwarding spell.")
|
||||||
|
(iap/start-purchase)
|
||||||
|
(a/<!! iap/purchase-chan)))
|
||||||
|
(when @iap/has-purchased?
|
||||||
|
(cond
|
||||||
|
(get-in @entities [:room :entities :wizard])
|
||||||
|
(actions/do-dialogue entities :wizard "What are you doing, boy?"
|
||||||
|
:wizard "I'm right here.")
|
||||||
|
|
||||||
(= :night (get-in @entities [:state :time]))
|
(= :night (get-in @entities [:state :time]))
|
||||||
(actions/talk entities :ego "It's locked.")
|
(actions/talk entities :ego "It's locked.")
|
||||||
|
|
||||||
:else
|
:else
|
||||||
(do (actions/play-animation entities :door :open)
|
(do (actions/play-animation entities :door :open)
|
||||||
(actions/transition-background entities :inside-house [237 0] :between (fn [s e]
|
(actions/transition-background entities :inside-house [237 0] :between (fn [s e]
|
||||||
(if (= 1 (rand-int 5))
|
(if (= 1 (rand-int 5))
|
||||||
(assoc-in e [:room :entities :experiment] (get-in e [:room :experiment]))
|
(assoc-in e [:room :entities :experiment] (get-in e [:room :experiment]))
|
||||||
e)))
|
e)))
|
||||||
(when (get-in @entities [:room :entities :experiment])
|
(when (get-in @entities [:room :entities :experiment])
|
||||||
(actions/play-animation entities :experiment :experiment)
|
(actions/play-animation entities :experiment :experiment)
|
||||||
(actions/remove-entity entities :experiment))
|
(actions/remove-entity entities :experiment))
|
||||||
|
|
||||||
(if (get-in @entities [:state :convinced-wizard?])
|
(if (get-in @entities [:state :convinced-wizard?])
|
||||||
(do (actions/talk entities :wizard "Oh, hello there, boy.")
|
(do (actions/talk entities :wizard "Oh, hello there, boy.")
|
||||||
(utils/save @entities "autosave" "Autosave"))
|
(utils/save @entities "autosave" "Autosave"))
|
||||||
(wizard-dialogue entities)))))
|
(wizard-dialogue entities))))))
|
||||||
:cursor :right}
|
:cursor :right}
|
||||||
|
|
||||||
:right-dir {:box [220 141 320 204]
|
:right-dir {:box [220 141 320 204]
|
||||||
|
|||||||
@@ -228,6 +228,17 @@
|
|||||||
regular-version
|
regular-version
|
||||||
mobile-version))
|
mobile-version))
|
||||||
|
|
||||||
|
(defmacro platformify [ios-version android-version regular-version]
|
||||||
|
(println "Platforming: " (System/getProperty "platform"))
|
||||||
|
(cond (= "desktop" (System/getProperty "platform"))
|
||||||
|
regular-version
|
||||||
|
|
||||||
|
(= "android" (System/getProperty "platform"))
|
||||||
|
android-version
|
||||||
|
|
||||||
|
:else
|
||||||
|
ios-version))
|
||||||
|
|
||||||
(def screenshot-chan (chan))
|
(def screenshot-chan (chan))
|
||||||
|
|
||||||
(defn publish-screenshot-fn []
|
(defn publish-screenshot-fn []
|
||||||
|
|||||||
@@ -21,7 +21,9 @@
|
|||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>126</string>
|
<string>135</string>
|
||||||
|
<key>CFBundleIconName</key>
|
||||||
|
<string>AppIcon</string>
|
||||||
<key>MinimumOSVersion</key>
|
<key>MinimumOSVersion</key>
|
||||||
<string>8.0</string>
|
<string>8.0</string>
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
@@ -56,20 +58,6 @@
|
|||||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleIcons</key>
|
|
||||||
<dict>
|
|
||||||
<key>CFBundlePrimaryIcon</key>
|
|
||||||
<dict>
|
|
||||||
<key>CFBundleIconFiles</key>
|
|
||||||
<array>
|
|
||||||
<string>iTunesArtwork</string>
|
|
||||||
<string>Icon</string>
|
|
||||||
<string>Icon-60</string>
|
|
||||||
<string>Icon-76</string>
|
|
||||||
<string>Icon-83.5</string>
|
|
||||||
</array>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
<key>ITSAppUsesNonExemptEncryption</key><false/>
|
<key>ITSAppUsesNonExemptEncryption</key><false/>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
(defproject advent "advent-2.0.4"
|
(def version (str "2.0." (clojure.string/trim-newline (slurp "../desktop/last-release")) "-snapshot"))
|
||||||
|
(defproject advent version
|
||||||
:description "FIXME: write description"
|
:description "FIXME: write description"
|
||||||
:dependencies [[com.badlogicgames.gdx/gdx "1.9.4"]
|
:dependencies [[com.badlogicgames.gdx/gdx "1.9.4"]
|
||||||
[com.badlogicgames.gdx/gdx-backend-robovm "1.9.4"]
|
[com.badlogicgames.gdx/gdx-backend-robovm "1.9.4"]
|
||||||
@@ -10,12 +11,13 @@
|
|||||||
[com.mobidevelop.robovm/robovm-rt "2.3.0"]
|
[com.mobidevelop.robovm/robovm-rt "2.3.0"]
|
||||||
[play-clj "0.4.6-BRYCE" :exclusions [com.badlogicgames.gdx/gdx-box2d com.badlogicgames.gdx/gdx-bullet]]]
|
[play-clj "0.4.6-BRYCE" :exclusions [com.badlogicgames.gdx/gdx-box2d com.badlogicgames.gdx/gdx-bullet]]]
|
||||||
:source-paths ["src/clojure" "../desktop/src-common"]
|
:source-paths ["src/clojure" "../desktop/src-common"]
|
||||||
|
|
||||||
:java-source-paths ["src/java"]
|
:java-source-paths ["src/java"]
|
||||||
:plugins [[lein-fruit "0.2.4-SNAPSHOT"]
|
:plugins [[lein-fruit "0.2.4-SNAPSHOT"]
|
||||||
[org.skummet/lein-skummet "0.2.2"]
|
|
||||||
]
|
]
|
||||||
:javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"]
|
:javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"]
|
||||||
:jvm-opts ["-Dno-steam=true" "-Dclojure.compiler.direct-linking=true" "-Dclojure.compiler.elide-meta=[:doc :file :line :added]"]
|
:jvm-opts ["-Dno-steam=true" "-Dclojure.compiler.direct-linking=true" "-Dclojure.compiler.elide-meta=[:doc :file :line :added]"
|
||||||
|
"-Dplatform=ios"]
|
||||||
:ios {:robovm-opts ["-config" "robovm.xml"]
|
:ios {:robovm-opts ["-config" "robovm.xml"]
|
||||||
:robovm-path "/Users/brycecovert/.robovm-sdks/robovm-2.3.0"
|
:robovm-path "/Users/brycecovert/.robovm-sdks/robovm-2.3.0"
|
||||||
:version 2.1}
|
:version 2.1}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 26 KiB |
@@ -27,6 +27,8 @@
|
|||||||
</resource>
|
</resource>
|
||||||
</resources>
|
</resources>
|
||||||
<forceLinkClasses>
|
<forceLinkClasses>
|
||||||
|
|
||||||
|
<pattern>org.robovm.apple.storekit.**</pattern>
|
||||||
<pattern>advent.**</pattern>
|
<pattern>advent.**</pattern>
|
||||||
<pattern>clojure.genclass*</pattern>
|
<pattern>clojure.genclass*</pattern>
|
||||||
<pattern>clojure.gvec*</pattern>
|
<pattern>clojure.gvec*</pattern>
|
||||||
@@ -98,5 +100,6 @@
|
|||||||
<framework>OpenAL</framework>
|
<framework>OpenAL</framework>
|
||||||
<framework>AudioToolbox</framework>
|
<framework>AudioToolbox</framework>
|
||||||
<framework>AVFoundation</framework>
|
<framework>AVFoundation</framework>
|
||||||
|
<framework>StoreKit</framework>
|
||||||
</frameworks>
|
</frameworks>
|
||||||
</config>
|
</config>
|
||||||
|
|||||||
@@ -1,18 +1,35 @@
|
|||||||
package advent.core;
|
package advent.core;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
import clojure.lang.RT;
|
import clojure.lang.RT;
|
||||||
import clojure.lang.Symbol;
|
import clojure.lang.Symbol;
|
||||||
|
// import advent.ios.*;
|
||||||
|
|
||||||
import com.badlogic.gdx.*;
|
import com.badlogic.gdx.*;
|
||||||
import com.badlogic.gdx.backends.iosrobovm.*;
|
import com.badlogic.gdx.backends.iosrobovm.*;
|
||||||
|
|
||||||
import org.robovm.apple.foundation.*;
|
import org.robovm.apple.foundation.*;
|
||||||
import org.robovm.apple.uikit.UIApplication;
|
import org.robovm.apple.uikit.*;
|
||||||
import org.robovm.apple.glkit.GLKViewDrawableColorFormat;
|
import org.robovm.apple.glkit.GLKViewDrawableColorFormat;
|
||||||
import org.robovm.apple.glkit.GLKViewDrawableDepthFormat;
|
import org.robovm.apple.glkit.GLKViewDrawableDepthFormat;
|
||||||
|
import org.robovm.apple.storekit.*;
|
||||||
|
|
||||||
public class IOSLauncher extends IOSApplication.Delegate {
|
public class IOSLauncher extends IOSApplication.Delegate {
|
||||||
protected IOSApplication createApplication() {
|
TransactionObserver transactionObserver;
|
||||||
|
@Override
|
||||||
|
public boolean didFinishLaunching (UIApplication application, UIApplicationLaunchOptions launchOptions) {
|
||||||
|
transactionObserver = new TransactionObserver();
|
||||||
|
SKPaymentQueue.getDefaultQueue().addTransactionObserver(transactionObserver);
|
||||||
|
return super.didFinishLaunching(application, launchOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void willTerminate(UIApplication application) {
|
||||||
|
SKPaymentQueue.getDefaultQueue().removeTransactionObserver(transactionObserver);
|
||||||
|
super.willTerminate(application);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected IOSApplication createApplication() {
|
||||||
IOSApplicationConfiguration config = new IOSApplicationConfiguration();
|
IOSApplicationConfiguration config = new IOSApplicationConfiguration();
|
||||||
// config.colorFormat = GLKViewDrawableColorFormat.SRGBA8888;
|
// config.colorFormat = GLKViewDrawableColorFormat.SRGBA8888;
|
||||||
// config.depthFormat = GLKViewDrawableDepthFormat._24;
|
// config.depthFormat = GLKViewDrawableDepthFormat._24;
|
||||||
@@ -22,8 +39,14 @@ public class IOSLauncher extends IOSApplication.Delegate {
|
|||||||
config.useAccelerometer=false;
|
config.useAccelerometer=false;
|
||||||
config.useCompass=false;
|
config.useCompass=false;
|
||||||
System.out.println("application created.");
|
System.out.println("application created.");
|
||||||
|
HashSet<String> products = new HashSet();
|
||||||
|
products.add("fullgame");
|
||||||
|
SKProductsRequest request = new SKProductsRequest(products);
|
||||||
|
request.setDelegate(new ProductDelegate());
|
||||||
|
request.start();
|
||||||
|
|
||||||
RT.var("clojure.core", "require").invoke(Symbol.intern("advent.core"));
|
RT.var("clojure.core", "require").invoke(Symbol.intern("advent.core"));
|
||||||
|
RT.var("clojure.core", "require").invoke(Symbol.intern("advent.ios"));
|
||||||
System.out.println("clojure loaded");
|
System.out.println("clojure loaded");
|
||||||
try {
|
try {
|
||||||
NSDictionary infoDictionary = NSBundle.getMainBundle().getInfoDictionary();
|
NSDictionary infoDictionary = NSBundle.getMainBundle().getInfoDictionary();
|
||||||
|
|||||||
Reference in New Issue
Block a user