diff --git a/dialogue.lisp b/dialogue.lisp index 4214bc8..fbe4bdf 100644 --- a/dialogue.lisp +++ b/dialogue.lisp @@ -21,7 +21,8 @@ (:nicknames :fsa.dia :dialogue :πŸ’¬) (:use :cl) (:export #:dialogue-state - #:start-dialogue #:face #:say #:mumble #:move)) + #:start-dialogue #:face #:say #:mumble #:move + :normal-face :talking-face)) (in-package :flora-search-aurora.dialogue) @@ -56,20 +57,22 @@ If not, have some tea on me: I’m paying. =w=" (list :speaker speaker :face face))) -(defun say (speaker text) +(defun say (speaker &rest text) (list - (list :speaker speaker :text text :face 'talking-face :progress 0) + (list :speaker speaker :face 'talking-face :progress 0 + :text (or (getf text (…:system-language)) (getf text :en))) (car (face speaker 'normal-face)))) -(defun mumble (speaker text) +(defun mumble (speaker &rest text) (list - (list :speaker speaker :text text :progress 0))) + (list :speaker speaker :progress 0 + :text (or (getf text (…:system-language)) (getf text :en))))) -(defun move (speaker world-coords) +(defun move (speaker world-coords &key (delay .05)) (list - (list :speaker speaker :coords world-coords))) + (list :speaker speaker :coords world-coords :delay delay))) @@ -140,7 +143,8 @@ coordinates listed in the DIALOGUE’s :COORDS property. … If applicable, ofc. ('t 0)) :y (cond ((< (getf target-coords :y) (getf speaker-coords :y)) -1) ((> (getf target-coords :y) (getf speaker-coords :y)) 1) - ('t 0)))) + ('t 0))) + (sleep (or (getf dialogue :delay) 0))) finished-moving-p)) @@ -279,8 +283,8 @@ and max-row; for use with RENDER-STRING. Like so: ;; … Worst-case scenario, just do whatever’ll fit :w:” (optimal-text-placement-vertically text coords :width width :height height :downp (not playerp)) - (optimal-text-palcement-horizontally text coords :width width :height height - :rightp (not leftp))))) + (optimal-text-placement-horizontally text coords :width width :height height + :rightp (not leftp))))) (defun render-dialogue-block (matrix map dialogue) diff --git a/flora-search-aurora.lisp b/flora-search-aurora.lisp index f2dc644..1abfdd1 100644 --- a/flora-search-aurora.lisp +++ b/flora-search-aurora.lisp @@ -38,17 +38,25 @@ (in-package :flora-search-aurora) + (defun literary-girl-dialogue-2 (map) (print "OWO")) + (defun literary-girl-dialogue (map) - (lambda (matrix &key (map map) - (dialogue (πŸ’¬:start-dialogue - (πŸ’¬:say "literary-girl" "Blah blah, testing. A multi-lined one. For real! jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj akls djlaks jdlaksj dlakjsd") - (πŸ’¬:say "player" "ktp ktp jes jes?") - (πŸ’¬:move "player" '(:x 30 :y 10))))) - (🌍:overworld-state-draw matrix map) - (πŸ’¬:dialogue-state matrix :map map :dialogue dialogue))) + (let + ((dialogue + (πŸ’¬:start-dialogue + (πŸ’¬:mumble "literary-girl" :en "...") + (πŸ’¬:say "player" :eo "Kielas apud la mar'?" + :en "How's the view?") + (πŸ’¬:face "player" "<.<") + (πŸ’¬:say "literary-girl" :eo "Kielas apud la ruinoj de via viv'?" + :en "How's your trainwreck of a life?") + (πŸ’¬:face "player" 'πŸ’¬:normal-face)))) + (lambda (matrix &key (map map) (dialogue dialogue)) + (🌍:overworld-state-draw matrix map) + (πŸ’¬:dialogue-state matrix :map map :dialogue dialogue)))) (defun state-loop @@ -109,6 +117,8 @@ with STATE-LOOP." ((label . "QUIT") (return . nil)))) + + (defun main () "A pathetic fascimile of a main loop. What does it do? WHAST DOES TI DODOO?" (cl-charms:with-curses () diff --git a/util.lisp b/util.lisp index 616b1b6..d99d20c 100644 --- a/util.lisp +++ b/util.lisp @@ -20,7 +20,7 @@ (defpackage :flora-search-aurora.util (:nicknames :fsa.ut :util :…) (:use :cl :assoc-utils) - (:export #:split-string-by-length #:plist= #:at-least #:at-most)) + (:export #:split-string-by-length #:plist= #:at-least #:at-most #:system-language)) (in-package :flora-search-aurora.util) @@ -69,3 +69,12 @@ minimum returns your more pitiful of moments." (if (> num maximum) maximum num)) + + +(defun system-language () + "Return the system language, if among the supported; otherwise, EN-glish." + (let ((lang (subseq (uiop:getenv "LANG") 0 2))) + (cond + ((string-equal lang "eo") :eo) + ((string-equal lang "en") :en) + ('t :en))))