chiark / gitweb /
Junks. Pants icon.
[ypp-sc-tools.main.git] / yarrg / where-vessels
index b007a67b878ed873b4964f68554853b322110ed6..af77cbab45221214c58b5d6296ec42c192bd82f0 100755 (executable)
@@ -133,6 +133,9 @@ proc argdefaults {} {
        if {[info exists ocean]} { lappend cmd --ocean $ocean }
        if {[info exists pirate]} { lappend cmd --pirate $pirate }
        manyset [split [eval exec $cmd] " "] ocean pirate
+       if {![llength $ocean] || ![llength $pirate]} {
+           error "$ocean $pirate ?"
+       }
     }
     lappend scraper $ocean
 }
@@ -251,6 +254,7 @@ proc vesselclasses-init {} {
        dhow            cm      dh      Dhow
        longship        dm      ls      Longship
        baghlah         em      bg      Baghlah
+       junk            eo      jk      Junk
        merchbrig       fm      mb      {Merchant Brig}
        warbrig         gm      wb      {War Brig}
        xebec           hm      xe      Xebec
@@ -376,7 +380,11 @@ proc show-report-decode {code} {
 
     switch -exact $subclass {
        {} { report-set subclass {Ordinary} }
-       F { report-set subclass {"Frost class"} }
+       E { report-set subclass {Emerald class} }
+       F { report-set subclass {Frost class} }
+       R { report-set subclass {Rogue class} }
+       V { report-set subclass {Verdant class} }
+       I { report-set subclass {Inferno class} }
        default { report-set subclass "Subclass \"$subclass\"" }
     }
 
@@ -579,7 +587,11 @@ proc vessel {vin} {
     set subclass [errexpect-arrayget vi vesselSubclass]
     switch -exact $subclass {
        null            { lappend codel {} }
+       celtic          { lappend codel E }
        icy             { lappend codel F }
+       rogue           { lappend codel R }
+       verdant         { lappend codel V }
+       inferno         { lappend codel I }
        default         { lappend codel ($subclass) }
     }
 
@@ -625,7 +637,7 @@ proc vessel {vin} {
     lappend newnotes [list $vid $realname $owner $xabbrev]
     set kk "$island [join $codel _]"
     upvar #0 found($kk) k
-    lappend k [list $vid $realname]
+    lappend k [list $vid $realname $owner]
  
     debug "CODED $kk $vid $realname"
 }
@@ -1079,8 +1091,20 @@ proc show-report {islandname code} {
     .cp.report.list delete 0 end
 
     foreach entry $k {
-       manyset $entry vid name
-       .cp.report.list insert end $name
+       manyset $entry vid name owner
+       lappend owned($owner) $name
+    }
+
+    foreach owner [lsort [array names owned]] {
+       if {[string length $owner]} {
+           set owndesc "$owner's"
+       } else {
+           set owndesc "Owner unknown"
+       }
+       .cp.report.list insert end "$owndesc:"
+       foreach name $owned($owner) {
+           .cp.report.list insert end " $name"
+       }
     }
 }