From ab1d444a460c0620cbd3b246dd5245c7b5880201 Mon Sep 17 00:00:00 2001 From: Alejandro Aguilera Date: Wed, 8 Jun 2011 00:28:58 +0200 Subject: [PATCH 1/6] Update sample.settings.py with the new optimizeimg options. --- sample.settings.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sample.settings.py b/sample.settings.py index 863b266..8c85a3e 100644 --- a/sample.settings.py +++ b/sample.settings.py @@ -92,9 +92,11 @@ imgformat = "jpg" ################################################################################ ### optimizeimg ## If using png, perform image file size optimizations on the output. Specify 1 -## for pngcrush, 2 for pngcrush+optipng+advdef. This may double (or more) -## render times, but will produce up to 30% smaller images. NOTE: requires -## corresponding programs in $PATH or %PATH% +## for pngcrush, 2 for pngcrush+advdef, 3 for pngcrush+advdef with more agressive +## options. Option 1 gives around 19% of reduction, option 2 gives around 21% +## (it doubles the optimizing time) and option 3 gives around 23% (it doubles, +## again, the optimizing time). Using this option may double (or more) +## render times. NOTE: requires corresponding programs in $PATH or %PATH% ## Default: not set ## Type: integer ## Example: From c2bf7ff34e02b5add60799d54df300f24c143781 Mon Sep 17 00:00:00 2001 From: Aaron Griffith Date: Wed, 8 Jun 2011 14:41:43 -0400 Subject: [PATCH 2/6] added --no-signs option --- googlemap.py | 12 +++++++++--- overviewer.py | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/googlemap.py b/googlemap.py index daf0e0e..0e99639 100644 --- a/googlemap.py +++ b/googlemap.py @@ -66,7 +66,8 @@ class MapGen(object): image format, and world. Note:tiledir for each quadtree should be unique. By default the tiledir is determined by the rendermode""" - self.skipjs = configInfo.get('skipjs', None) + self.skipjs = configInfo.get('skipjs', False) + self.nosigns = configInfo.get('nosigns', False) self.web_assets_hook = configInfo.get('web_assets_hook', None) self.web_assets_path = configInfo.get('web_assets_path', None) self.bg_color = configInfo.get('bg_color') @@ -153,13 +154,18 @@ class MapGen(object): # we need to merge self.world.POI with the persistant data in world.PersistentData self.world.POI += filter(lambda x: x['type'] != 'spawn', self.world.persistentData['POI']) + + if self.nosigns: + markers = filter(lambda x: x['type'] != 'sign', self.world.POI) + else: + markers = self.world.POI # write out the default marker table with open(os.path.join(self.destdir, "markers.js"), 'w') as output: output.write("overviewer.collections.markerDatas.push([\n") - for marker in self.world.POI: + for marker in markers: output.write(json.dumps(marker)) - if marker != self.world.POI[-1]: + if marker != markers[-1]: output.write(",") output.write("\n") output.write("]);\n") diff --git a/overviewer.py b/overviewer.py index 22a103c..1bf6790 100755 --- a/overviewer.py +++ b/overviewer.py @@ -107,6 +107,7 @@ def main(): parser.add_option("-q", "--quiet", dest="quiet", action="count", default=0, help="Print less output. You can specify this option multiple times.") parser.add_option("-v", "--verbose", dest="verbose", action="count", default=0, help="Print more output. You can specify this option multiple times.") parser.add_option("--skip-js", dest="skipjs", action="store_true", help="Don't output marker.js or regions.js") + parser.add_option("--no-signs", dest="nosigns", action="store_true", help="Don't output signs to markers.js") parser.add_option("--display-config", dest="display_config", action="store_true", help="Display the configuration parameters, but don't render the map. Requires all required options to be specified", commandLineOnly=True) #parser.add_option("--write-config", dest="write_config", action="store_true", help="Writes out a sample config file", commandLineOnly=True) From 454c1537a6099d5dc2168c11b1cf0a5db2507891 Mon Sep 17 00:00:00 2001 From: Aaron Griffith Date: Wed, 8 Jun 2011 14:57:21 -0400 Subject: [PATCH 3/6] sign drop-down now only shows rules that actually match something --- web_assets/overviewer.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/web_assets/overviewer.js b/web_assets/overviewer.js index 467affb..615e78a 100644 --- a/web_assets/overviewer.js +++ b/web_assets/overviewer.js @@ -598,6 +598,11 @@ var overviewer = { var items = []; for (i in overviewerConfig.objectGroups.signs) { var signGroup = overviewerConfig.objectGroups.signs[i]; + // don't create an option for this group if empty + if (overviewer.collections.markers[signGroup.label].length == 0) { + continue; + } + var iconURL = signGroup.icon; if(!iconURL) { iconURL = overviewerConfig.CONST.image.defaultMarker; @@ -616,7 +621,11 @@ var overviewer = { } }); } - overviewer.util.createDropDown('Signposts', items); + + // only create drop down if there's used options + if (items.length > 0) { + overviewer.util.createDropDown('Signposts', items); + } } // if there are any regions data, lets show the option to hide/show them. From e519aaa8a06ab59e8ae11427ac81bc863fe11039 Mon Sep 17 00:00:00 2001 From: untergrundbiber Date: Wed, 8 Jun 2011 15:28:04 -0400 Subject: [PATCH 4/6] Local time in timestamp --- googlemap.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/googlemap.py b/googlemap.py index 0e99639..48fede1 100644 --- a/googlemap.py +++ b/googlemap.py @@ -19,7 +19,7 @@ import stat import cPickle import Image import shutil -from time import strftime, gmtime +from time import strftime, localtime import json import util @@ -132,7 +132,7 @@ class MapGen(object): index = open(indexpath, 'r').read() index = index.replace( - "{time}", str(strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime()))) + "{time}", str(strftime("%a, %d %b %Y %H:%M:%S %Z", localtime()))) index = index.replace("{version}", util.findGitVersion()) with open(os.path.join(self.destdir, "index.html"), 'w') as output: From 6bb39a87ca96c5efb2ab7951492ee9a5c41832f5 Mon Sep 17 00:00:00 2001 From: Aaron Griffith Date: Wed, 8 Jun 2011 16:48:29 -0400 Subject: [PATCH 5/6] basic styling for custom control buttons --- web_assets/overviewer.css | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/web_assets/overviewer.css b/web_assets/overviewer.css index 14585e6..4bce661 100644 --- a/web_assets/overviewer.css +++ b/web_assets/overviewer.css @@ -32,16 +32,21 @@ body { .customControl { padding: 5px; height: 15px; + color: black; font-family: Arial, sans-serif; } .customControl > div.top { - background-color: #fff; - border: 2px solid #000; - text-align: center; - width: 70px; font-size: 12px; - width: 70px; + line-height: 160%; + text-align: center; + padding: 0px 6px; + + background-color: white; + + border: 1px solid #A9BBDF; + border-radius: 2px 2px; + box-shadow: rgba(0, 0, 0, 0.347656) 2px 2px 3px; cursor: pointer; } From 512b2032b27aae41c867cad12c0f9e48579f2182 Mon Sep 17 00:00:00 2001 From: Aaron Griffith Date: Wed, 8 Jun 2011 19:58:18 -0400 Subject: [PATCH 6/6] finished styling controls --- web_assets/control-bg-active.png | Bin 0 -> 2802 bytes web_assets/control-bg.png | Bin 0 -> 2785 bytes web_assets/overviewer.css | 23 ++++++++++++++++++++--- web_assets/overviewer.js | 1 + 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 web_assets/control-bg-active.png create mode 100644 web_assets/control-bg.png diff --git a/web_assets/control-bg-active.png b/web_assets/control-bg-active.png new file mode 100644 index 0000000000000000000000000000000000000000..67fb91521947a6ae70adf908e50327307ab1a885 GIT binary patch literal 2802 zcmeAS@N?(olHy`uVBq!ia0y~yU|?imU=ZeDV_;wiWnsJJyZxIAL=cQL#B-&6U+oNj#BI6bG4K}mTH#|eSRMFNu;5?cg>9FDejaD|D8 z3eNEeJ<@cQ%VTcGqXil}(jB`xqPjz4EZ)iAS-!Ql>iyfdzpww^^L)3=ud_n6D4@QOq zr>CBs?tRHvWXIGCQstjMJb0w|=upl^r$lj0fi%u1N^_>qRu=Yn&g^rJhk-%r=f#8n zEbJ#dfA-|zv$W?q@4p;f^e_8EzLK5d$NT^G^f0k72>6|Ue=Gj!(`(EH#~C-2?$2Hs z&2TG>A>;nfSmWEA3!=C#RQ>F(wD{v7H*aCU2^(1%E^h9(s!0p?8a(c{`)~X(|3P=% zw?7VY|87@(U?`mBFmvsJ#m#>U6Z6W}1@%2Y&EjO3_x-u@zvHd-fBQ5qJ~G)Dqa)h& zF`{!vfRgX=%AG+IT@+7FeI)d<-sq$Jw7;B_%Xt~rwD}+K+s3~2bk2dgcZ^Kkd=Zz* z7#!+8>-I=-Ph=2CH!-UG&cHBv|IdC0ZAON()0aGEVA%6QB4))Dai3!x3=A#{8nre! zvhy4iS#yAI&OzBd2gI2Y*<2iWR1Vk(II%rxkl|V=G0jmjwJ%f4_-6y+4>sm7`E3CB4_hgqUr=APj1g_ zkJ}!)OM;i!T@uKgR^Lhi|XPdGL;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||gtcvIJM%A6^476iZMrpT(bVi{`ZY zTwJ^*Xk7rGn2-Jn?TToL=!zX4dp)AA7~fC(_v)uIcavDn-U%B5c5K*uV@E~g#|KLL zU3ZHqcL$4?>lwxd?MkW0{BWuEbjImT)BXlLiUQ(sW?rKL-qwVT3CrmmcF z@^s$1FHt*_MH8o{guc(3elD%Zt z+t%Fvw9stvx2n1Iv8TiSu3f!--%Yh!*Y@8nul~%}EGue#@BNfFd$wv0Q&^eyJqsUHhNa-QD3{?tgS%fA!L8_HVB5UuTu%=iFJpfBz=V+#s`FIS;FXr?VUK zZ_R!?t9)xglosD1$EOF??=P#VejM;(;kmjgxiXxBY+Jd&9@crN>SC!{;rSt6}@`=aZ(%kC&$`pEuXf-uBAOJC)yk z{>;pd4UFBJ?tFfpy?DtxpY8GAPkz4lyg&BCo`Nq*-;-{uZueemyUy0VuHf%OkM+^{ zuT#IDej9GHuH=jFYwL^eFW3LdI&ii4`j6{+vGXhUzCZRxdV8MQU6~!KyT1M?`}S76 zoa>#>o!F}WiuHf?-TM2A{TKhM`Yr!9rXI+B@FU?s!ui9I{O|cV+vok8^8a%C!%OaG z+^;ITDfjlzm6w<1mD>9$<=o_l%Qr0-K7Xn%?0@C!;?>XZ|9$k^`+UTo8y~oTcAwwB zu5#t)qW7y;uD3d_d|ZCdxk}rQ%l@oAcf0oej`zFnAKxoKQ{#`rzktsde5{ z-Se7%fAqh%eE!{FsVd08z`&N|?e4r@?v1<$3FVdQ&MBb@034=OtN;K2 literal 0 HcmV?d00001 diff --git a/web_assets/control-bg.png b/web_assets/control-bg.png new file mode 100644 index 0000000000000000000000000000000000000000..b6387179b576930eb563c10e5ca33848ff62bbe5 GIT binary patch literal 2785 zcmeAS@N?(olHy`uVBq!ia0y~yU|?imU=ZeDV_;wiWnsJJyZxIAL=cQL#B-&6U+oNj#BI6bG4K}mTH#|eSRMFNu;5?cg>9FDejaD|D8 z3eNEeJ<@cQ%VTcGqXil}(jB`xqPjz4EZ)iAS-!Ql>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ii4`j6{+vGXhUzCZRxdV8MQU6~!KyT1M?`}S76 zoa>#>o!F}WiuHf?-TM2A{TKhM`Yr!9rXI+B@FU?s!ui9I{O|cV+vok8^8a%C!%OaG z+^;ITDfjlzm6w<1mD>9$<=o_l%Qr0-K7Xn%?0@C!;?>XZ|9$k^`+UTo8y~oTcAwwB zu5#t)qW7y;uD3d_d|ZCdxk}rQ%l@oAcf0oej`zFnAKxoKQ{#`rzktsde5{ z-Se7%fAqh%eE!{FsVd08z`&N|?e4 div.top:hover { + border: 1px solid #678AC7; +} + +.customControl > div.top-active { + color: white; + font-weight: bold; + padding: 0px 5px; + border: 1px solid #678AC7; + background-image: url('control-bg-active.png'); +} + .customControl > div.dropDown { - border: 1px solid #000; font-size: 12px; - background-color: #fff; + background-color: white; + + border: 1px solid #A9BBDF; + border-radius: 2px 2px; + box-shadow: rgba(0, 0, 0, 0.347656) 2px 2px 3px; + display: none; } diff --git a/web_assets/overviewer.js b/web_assets/overviewer.js index 615e78a..ceeb7dc 100644 --- a/web_assets/overviewer.js +++ b/web_assets/overviewer.js @@ -706,6 +706,7 @@ var overviewer = { // add the functionality to toggle visibility of the items $(controlText).click(function() { + $(controlBorder).toggleClass('top-active'); $(dropdownDiv).toggle(); });