chiark / gitweb /
where-vessels: Better icons for lock, after fruitless unicode search
[ypp-sc-tools.db-live.git] / yarrg / where-vessels
index 2e625c1e12e12815ec9ad13a3acf9ec51e0fc4d4..8d6de95900fcd15d64f480cac5d05238b78f2945 100755 (executable)
@@ -254,8 +254,8 @@ proc vesselclasses-init {} {
        merchbrig       fm      mb      {Merchant Brig}
        warbrig         gm      wb      {War Brig}
        xebec           hm      xe      Xebec
-       warfrig         im      wf      {War Frigate}
        merchgal        jm      mg      {Merchant Galleon}
+       warfrig         im      wf      {War Frigate}
        grandfrig       km      gf      {Grand Frigate}
     }
     set vc_codes {}
@@ -270,6 +270,7 @@ proc vesselclasses-init {} {
     load-icon unlocked
     load-icon locked
     load-icon battle
+    load-icon atsea
     load-icon borrow
     load-icon query
     load-icon ours
@@ -282,8 +283,8 @@ proc load-icon {icon} {
 
 proc code2abbrev-lock {lockown} {
     manyset [split $lockown ""] lock notown
-    append abbrev [lindex {* + -} $lock]
-    append abbrev [lindex {= - ?} [regsub {\D} $notown 2]]
+    append abbrev [lindex {x u .} $lock]
+    append abbrev [lindex {m . ?} [regsub {\D} $notown 2]]
 }    
 
 proc canvas-horiz-stack {xvar xoff y bind type args} {
@@ -306,12 +307,19 @@ proc code2canvas {code canvas x yvar qty qtylen bind} {
     incr stackx 2
     set imy [expr {$y+2}]
 
-    append qty [lindex {? {}} $inport]
+    if {!$inport} { incr qtylen -1 }
+    if {$qtylen<=0} { set qtylen {} }
     set qty [format "%${qtylen}s" $qty]
 
     set qtyid [canvas-horiz-stack stackx 0 $y $bind \
                   text -anchor nw -font fixed -text $qty]
 
+    if {!$inport} {
+       canvas-horiz-stack stackx 0 $imy $bind \
+           image -anchor nw -image icon/atsea
+       incr stackx
+    }
+    
     canvas-horiz-stack stackx -1 $imy $bind \
            image -anchor nw -image icon/$vc_code2abbrev($class)
 
@@ -325,7 +333,7 @@ proc code2canvas {code canvas x yvar qty qtylen bind} {
 
     incr stackx
     canvas-horiz-stack stackx 0 $imy $bind \
-       image -anchor nw -image icon/[lindex {battle dot locked} $lock]
+       image -anchor nw -image icon/[lindex {battle borrow dot} $lock]
     incr stackx
     canvas-horiz-stack stackx 0 $imy $bind \
        image -anchor nw -image icon/[lindex {ours dot query} \