Dojo now uses the short ship name (ie ~todsel_lithex or ~torbyt^sogwyx) in the prompt. Dojo and talk now use dedicated function in lib/sole.hoon for ship name shortening.

This commit is contained in:
Fang 2016-07-28 14:36:01 +02:00
parent 8cfbd216d1
commit 937438798d
3 changed files with 14 additions and 16 deletions

View File

@ -1875,21 +1875,8 @@
++ sn-curt :: render name in 14
|= mup/?
^- tape
=+ rac=(clan p.one)
=+ raw=(scow %p p.one)
=. raw ?.(mup raw ['*' (slag 2 raw)])
?- rac
$czar (weld " " raw)
$king (weld " " raw)
$duke raw
$earl ;: welp
(scag 1 raw)
(scag 6 (slag 15 raw))
"^"
(scag 6 (slag 22 raw))
==
$pawn :(welp (scag 7 raw) "_" (scag 6 (slag 51 raw)))
==
=+ raw=(shortship %p p.one)
(runt [(sub 14 (lent raw)) ' '] raw)
::
++ sn-nick
|. ^- tape

View File

@ -968,7 +968,7 @@
::
++ ta-pro :: set prompt
|= pom/sole-prompt
+>(pom pom(cad :(welp (scow %p p.gyl) ":" (trip q.gyl) cad.pom)))
+>(pom pom(cad :(welp (shortship:sole p.gyl) ":" (trip q.gyl) cad.pom)))
::
++ ta-ret :: hear return
(ta-act %ret ~)

View File

@ -138,4 +138,15 @@
=+ dat=(transmute [%mor leg] [%ins pos `@c`0])
?> ?=($ins -.dat)
p.dat
::
++ shortship
|= ship/@p
^- tape
=+ kind=(clan ship)
=+ name=(scow %p ship)
?: =(%earl kind)
:(weld "~" (swag [15 6] name) "^" (swag [22 6] name))
?: =(%pawn kind)
:(weld (swag [0 7] name) "_" (swag [51 6] name))
name
--