X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.db-test.git;a=blobdiff_plain;f=yarrg%2Fwhere-vessels;h=092e8dad663e8c642edffc1cc92f8b59c2a16bd2;hp=c6636d6a96ff20bcf6c45eddf370dc4396ca874a;hb=a3b33e44585826206ea6ccd78cac39f452bf0daf;hpb=5ec8840d7a85a2eb96eea32c50c1139c83f92c70 diff --git a/yarrg/where-vessels b/yarrg/where-vessels index c6636d6..092e8da 100755 --- a/yarrg/where-vessels +++ b/yarrg/where-vessels @@ -361,8 +361,14 @@ proc code2canvas {code canvas x yvar qty qtylen bind} { incr stackx } + upvar #0 vc_code2abbrev($class) vcabb + if {![info exists vcabb]} { + set vcabb vc-$class + image create bitmap icon/$vcabb -data \ + [exec pbmtext -builtin fixed $class | pnminvert | pnmcrop >t.pnm] + } canvas-horiz-stack stackx -1 $imy $bind \ - image -anchor nw -image icon/$vc_code2abbrev($class) + image -anchor nw -image icon/$vcabb if {[string length $subclass]} { canvas-horiz-stack stackx 0 $y $bind \ @@ -602,7 +608,18 @@ proc vessel {vin} { set gameclass [errexpect-arrayget vi vesselClass] upvar #0 vc_game2code($gameclass) class - if {![info exists class]} { errexpect-error "unexpected vesselClass"} + if {![info exists class]} { + set class "($gameclass)" + upvar #0 vc_code2abbrev($class) vcabb + set vcabb vc-$class + set data [exec pbmtext -builtin fixed " $gameclass " \ + | pnminvert | pnmcrop | pbmtoxbm] + debug "INVENTED ICON $vcabb $data" + image create bitmap icon/$vcabb -data $data + + global vc_code2full + set vc_code2full($class) "Type \"$gameclass\"" + } lappend codel $class set gamesubclass [errexpect-arrayget vi vesselSubclass]