logging
This commit is contained in:
@@ -1 +1 @@
|
||||
32
|
||||
34
|
||||
|
||||
@@ -9,10 +9,11 @@
|
||||
[com.badlogicgames.gdx/gdx-backend-lwjgl "1.5.3"]
|
||||
[com.badlogicgames.gdx/gdx-platform "1.5.3" :classifier "natives-desktop"]
|
||||
[org.clojure/clojure "1.6.0"]
|
||||
|
||||
[play-clj "0.4.5-BRYCE"]
|
||||
[log4j/log4j "1.2.16"]
|
||||
[org.clojure/data.priority-map "0.0.5"]
|
||||
[org.clojure/core.async "0.1.338.0-5c5012-alpha"]]
|
||||
[org.clojure/core.async "0.1.338.0-5c5012-alpha"]
|
||||
[org.clojure/tools.logging "0.3.1"]]
|
||||
:source-paths ["src" "src-common"]
|
||||
:javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"]
|
||||
:omit-source true
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
[clojure.string :as s]
|
||||
[clojure.zip :as zip]
|
||||
[clojure.set :as set]
|
||||
[clojure.tools.logging :as log]
|
||||
[advent.pathfind]
|
||||
[advent.actions :as actions]
|
||||
[advent.screens.dialogue :as dialogue]
|
||||
@@ -60,7 +61,7 @@
|
||||
(let [result# (<!! c#)]
|
||||
(if (= :end result#)
|
||||
(do
|
||||
(println "ending script")
|
||||
(log/info "ending script")
|
||||
(throw (ex-info "User quit script" {:type :end-script})))
|
||||
(reset! ~entities result#))))))
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
[play-clj.g2d :refer :all]
|
||||
[advent.screens.scene :as scene]
|
||||
[advent.screens.dialogue :as dialogue]
|
||||
[clojure.tools.logging :as log]
|
||||
[advent.screens.title :as title]
|
||||
[advent.screens.credits :as credits]
|
||||
[advent.screens.inventory :as inventory]
|
||||
@@ -33,5 +34,5 @@
|
||||
(try (screen-fn)
|
||||
(catch Exception e
|
||||
(.log Gdx/app "ERROR" (with-out-str (.printStackTrace e)))
|
||||
(.printStackTrace e)
|
||||
(log/error e)
|
||||
(set-screen! advent title/title-screen)))))
|
||||
|
||||
@@ -115,7 +115,6 @@
|
||||
(defn test-pathfind []
|
||||
(let [my-map (random-map)
|
||||
path (visit-all my-map [1 1] [639 479 ])]
|
||||
(println "Test")
|
||||
(print-resolved path my-map)
|
||||
(println path)))
|
||||
|
||||
|
||||
@@ -536,7 +536,7 @@
|
||||
(utils/fast-forward-particle (get-in entities [:room :entities :outside-particles]))
|
||||
|
||||
(as-> entities entities
|
||||
(if (doto (get-in entities [:state :seen-intro?]) println)
|
||||
(if (get-in entities [:state :seen-intro?])
|
||||
(set-opacity entities 1.0 1.0)
|
||||
(set-opacity entities 0.0 0.0))
|
||||
(if (actions/has-item? entities :broom)
|
||||
|
||||
@@ -705,7 +705,7 @@
|
||||
(do (walk-to-sheep entities)
|
||||
(actions/play-animation entities :ego :reach)
|
||||
(actions/update-state entities #(assoc % :wool-count (inc (or (:wool-count %) 0))))
|
||||
(when (= 3 (doto (get-in @entities [:state :wool-count]) println))
|
||||
(when (= 3 (get-in @entities [:state :wool-count]))
|
||||
(steam/set-achievement "SHEEP_HORDER"))
|
||||
|
||||
(actions/update-entities entities #(update-in
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
[clojure.zip :as zip]
|
||||
[clojure.pprint]
|
||||
[clojure.java.io :as io]
|
||||
[clojure.tools.logging :as log]
|
||||
[advent.pathfind]
|
||||
[advent.actions :as actions]
|
||||
[advent.zone :as zone]
|
||||
@@ -202,7 +203,7 @@ void main ()
|
||||
|
||||
(= :end (actions/skip-type current-action screen entities))
|
||||
(let [terminated-entities (actions/terminate current-action screen entities)]
|
||||
(println "trying to end")
|
||||
(log/info "Attempting to end action")
|
||||
(actions/force-end terminated-entities current-action :fg-actions)
|
||||
)
|
||||
:else
|
||||
@@ -213,7 +214,7 @@ void main ()
|
||||
(get-in entities [:room :interactions]))) )
|
||||
|
||||
(defn get-interacting-entity [entities x y]
|
||||
(let [interactable-entities (if (= (doto (get-in entities [:cursor :current]) println) :main)
|
||||
(let [interactable-entities (if (= (doto (get-in entities [:cursor :current]) (#(log/info "clicked with " %)) ) :main)
|
||||
(vals (dissoc (get-in entities [:room :entities]) :ego))
|
||||
(vals (get-in entities [:room :entities])))
|
||||
interacting-entity (first (sort-by (comp - :baseline)
|
||||
@@ -225,7 +226,7 @@ void main ()
|
||||
|
||||
(defn left-click [screen entities]
|
||||
(let [[x y] (utils/unproject screen)
|
||||
_ (println "clicked " x y)
|
||||
_ (log/info (str "clicked " x y))
|
||||
interaction (get-interaction entities x y)
|
||||
interacting-entity (get-interacting-entity entities x y)
|
||||
current-action (get-in entities [:fg-actions :current])
|
||||
@@ -785,7 +786,7 @@ void main ()
|
||||
(if next-script
|
||||
(do
|
||||
(next-script entities)
|
||||
(println "starting script")
|
||||
(log/info "starting script")
|
||||
|
||||
(assoc-in entities [key :script-running?] true))
|
||||
entities)))))
|
||||
@@ -991,25 +992,7 @@ void main ()
|
||||
e)))
|
||||
|
||||
|
||||
(defn shift-range-to-bounds [x1 x2 min max]
|
||||
(println x1 x2 "->" (cond (and (< x1 min)
|
||||
(> x2 max))
|
||||
[min max]
|
||||
(< x1 min)
|
||||
[min (+ x2 (- min x1))]
|
||||
(> x2 max)
|
||||
[(- x1 (- x2 max)) max]
|
||||
:else
|
||||
[x1 x2]))
|
||||
(cond (and (< x1 min)
|
||||
(> x2 max))
|
||||
[min max]
|
||||
(< x1 min)
|
||||
[min (+ x2 (- min x1))]
|
||||
(> x2 max)
|
||||
[(- x1 (- x2 max)) max]
|
||||
:else
|
||||
[x1 x2]))
|
||||
|
||||
|
||||
(defn mouse-moved [{:keys [input-x input-y viewport] :as screen} [entities]]
|
||||
(utils/update-override screen (assoc-in entities [:cursor :last-pos] [input-x input-y])))
|
||||
@@ -1054,7 +1037,7 @@ void main ()
|
||||
(let [[^OrthographicCamera cam] (utils/setup-viewport screen 320 240)]
|
||||
(set! (. cam zoom) 0.95)
|
||||
(let [shader (ShaderProgram. ^String v-shader ^String pix-shader)
|
||||
#_#__ (println (.getLog shader))
|
||||
#_#__ (log/info "shader log:" (.getLog shader))
|
||||
state (get-state @utils/selected-save)
|
||||
start-pos [(:x state) (:y state)]
|
||||
has-start-pos? (:x state)
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
[play-clj.entities :refer [->TextureEntity]]
|
||||
[clojure.java.io :as io]
|
||||
[clojure.edn :as edn]
|
||||
[clojure.tools.logging :as log]
|
||||
[clojure.string :as str]
|
||||
[advent.saves :as saves]
|
||||
[advent.steam :as steam])
|
||||
@@ -24,7 +25,7 @@
|
||||
|
||||
(defn log-coords [screen entities]
|
||||
(let [{:keys [x y]} (input->screen screen {:x (:input-x screen) :y (:input-y screen)})]
|
||||
(println (:input-x screen) (:input-y screen) "->" x y)))
|
||||
(log/info (:input-x screen) (:input-y screen) "->" x y)))
|
||||
|
||||
(def +all-cursors+ [:main :wool :mushrooms :carrot :right :down :left :up :flask :flask-with-contents :trophy :ladder :stick :cat-toy :balloon :frog-legs :teddy :portrait :recipe :glass-eye :motivational-tapes :used-earplugs :grass :slobber :flask-with-strength :medal :kiss :sword :hourglass :mandrake :ball-n-chain :key :rope :crowbar :note-1 :ash :sack-lunch :flies :spear :monocle :feather :spell-component :money :charcoal :broken-clock :slingshot :camera :walkie-talkies :alarm-clock :walkie-talkie :flask-water :flask-water-stuff :flask-water-stuff-2 :note-2 :magic-slingshot :active-main :shovel :broom])
|
||||
|
||||
@@ -294,7 +295,7 @@
|
||||
(try
|
||||
(sound f)
|
||||
(catch Exception e
|
||||
(println e)
|
||||
(log/info e)
|
||||
(sound (str f ".mp3")))))
|
||||
|
||||
|
||||
@@ -430,8 +431,8 @@
|
||||
(try
|
||||
(if val
|
||||
(on-gl (.setDisplayMode Gdx/graphics
|
||||
(doto (.width (.getDesktopDisplayMode Gdx/graphics)) println)
|
||||
(doto (.height (.getDesktopDisplayMode Gdx/graphics)) println)
|
||||
(doto (.width (.getDesktopDisplayMode Gdx/graphics)) log/info)
|
||||
(doto (.height (.getDesktopDisplayMode Gdx/graphics)) log/info)
|
||||
true)
|
||||
(set! (.foregroundFPS (-> (class Gdx/graphics)
|
||||
(.getDeclaredField (name "config"))
|
||||
@@ -443,7 +444,7 @@
|
||||
(save-settings!))
|
||||
nil
|
||||
(catch Exception e
|
||||
(println e))))
|
||||
(log/error e))))
|
||||
|
||||
(defn toggle-fullscreen! []
|
||||
(if (.isFullscreen Gdx/graphics)
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
(ns advent.core.desktop-launcher
|
||||
(:require [advent.core :refer :all]
|
||||
[advent.utils :as utils]
|
||||
[play-clj.core :refer :all])
|
||||
[play-clj.core :refer :all]
|
||||
[clojure.tools.logging :as log])
|
||||
(:import [com.badlogic.gdx.backends.lwjgl LwjglApplication LwjglApplicationConfiguration]
|
||||
[org.lwjgl.input Keyboard]
|
||||
[com.badlogic.gdx Gdx Files$FileType])
|
||||
@@ -14,31 +15,19 @@
|
||||
(require '[play-clj-nrepl.core :as a])
|
||||
(System/getProperty "use-repl")
|
||||
(catch Exception e
|
||||
(println e)
|
||||
false)))
|
||||
|
||||
(defn -main
|
||||
[& [port]]
|
||||
(when has-nrepl?
|
||||
(play-clj-nrepl.core/start-nrepl advent.core/advent port))
|
||||
(eval `(play-clj-nrepl.core/start-nrepl advent.core/advent ~port)))
|
||||
|
||||
|
||||
(let [cfg (LwjglApplicationConfiguration.)]
|
||||
#_(println (.exists (files! :classpath "icon/icon_128x128.png")))
|
||||
(.addIcon cfg "icon/icon_128x128.png" Files$FileType/Classpath)
|
||||
(.addIcon cfg "icon/icon_32x32.png" Files$FileType/Classpath)
|
||||
(.addIcon cfg "icon/icon_16x16.png" Files$FileType/Classpath)
|
||||
|
||||
(if false
|
||||
(do
|
||||
(set! (.width cfg) (doto (.width (LwjglApplicationConfiguration/getDesktopDisplayMode)) println))
|
||||
(set! (.height cfg) (doto (.height (LwjglApplicationConfiguration/getDesktopDisplayMode)) println))
|
||||
(set! (.resizable cfg) true)
|
||||
(set! (.useHDPI cfg) false)
|
||||
(set! (.fullscreen cfg) true))
|
||||
(do
|
||||
(set! (.width cfg) 1280)
|
||||
(set! (.height cfg) 960)))
|
||||
(set! (.title cfg) "Tick's Tales: Up All Knight")
|
||||
(set! (.foregroundFPS cfg) 60)
|
||||
(set! (.backgroundFPS cfg) 60)
|
||||
|
||||
Reference in New Issue
Block a user