Baseline support for translations! :D
It’s not using gettext or anything, just a simple system I cooked up for having the translations hard-coded in, side-by-side. … it’s easier for me this way when writing, and it’ll make things easier later on, during distribution :P
This commit is contained in:
parent
b617e92aba
commit
495ed87f09
|
@ -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,7 +283,7 @@ 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
|
||||
(optimal-text-placement-horizontally text coords :width width :height height
|
||||
:rightp (not leftp)))))
|
||||
|
||||
|
||||
|
|
|
@ -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)))))
|
||||
(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)))
|
||||
(💬: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 ()
|
||||
|
|
11
util.lisp
11
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))))
|
||||
|
|
Ŝarĝante…
Reference in New Issue