X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=yarrg%2Fwhere-vessels;h=8d6de95900fcd15d64f480cac5d05238b78f2945;hb=15a33b9bcca5a2932534c7ab5952961bf278faf8;hp=2e625c1e12e12815ec9ad13a3acf9ec51e0fc4d4;hpb=27d9c020c52e2ad3d6e8ae5c4b113f062ec01251;p=ypp-sc-tools.main.git diff --git a/yarrg/where-vessels b/yarrg/where-vessels index 2e625c1..8d6de95 100755 --- a/yarrg/where-vessels +++ b/yarrg/where-vessels @@ -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} \