From: Ian Jackson Date: Tue, 15 Dec 2009 01:58:48 +0000 (+0000) Subject: where-vessels: Better icons for lock, after fruitless unicode search X-Git-Tag: 6.3.4~2 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.db-live.git;a=commitdiff_plain;h=15a33b9bcca5a2932534c7ab5952961bf278faf8 where-vessels: Better icons for lock, after fruitless unicode search --- diff --git a/yarrg/icons/atsea.xbm b/yarrg/icons/atsea.xbm new file mode 100644 index 0000000..cf835f0 --- /dev/null +++ b/yarrg/icons/atsea.xbm @@ -0,0 +1,4 @@ +#define atsea_width 5 +#define atsea_height 9 +static unsigned char atsea_bits[] = { + 0x02, 0x15, 0x08, 0x02, 0x15, 0x08, 0x02, 0x15, 0x08}; diff --git a/yarrg/icons/borrow.xbm b/yarrg/icons/borrow.xbm index 598f76c..d3db364 100644 --- a/yarrg/icons/borrow.xbm +++ b/yarrg/icons/borrow.xbm @@ -1,4 +1,4 @@ #define borrow_width 5 #define borrow_height 9 static unsigned char borrow_bits[] = { - 0x00, 0x00, 0x00, 0x04, 0x0a, 0x04, 0x00, 0x00, 0x00}; + 0x00, 0x00, 0x00, 0x00, 0x12, 0x12, 0x12, 0x0c, 0x00}; diff --git a/yarrg/icons/dot.xbm b/yarrg/icons/dot.xbm index c551fca..d17d9b6 100644 --- a/yarrg/icons/dot.xbm +++ b/yarrg/icons/dot.xbm @@ -1,4 +1,4 @@ -#define unlocked_width 5 -#define unlocked_height 9 -static unsigned char unlocked_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00}; +#define dot_width 5 +#define dot_height 9 +static unsigned char dot_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00}; diff --git a/yarrg/icons/ours.xbm b/yarrg/icons/ours.xbm index 1c4aa86..9b94638 100644 --- a/yarrg/icons/ours.xbm +++ b/yarrg/icons/ours.xbm @@ -1,4 +1,4 @@ #define ours_width 5 #define ours_height 9 static unsigned char ours_bits[] = { - 0x00, 0x00, 0x0f, 0x09, 0x09, 0x09, 0x0f, 0x04, 0x00}; + 0x00, 0x00, 0x00, 0x0a, 0x1f, 0x1f, 0x0e, 0x04, 0x00}; 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} \