else
This commit is contained in:
parent
6f6c8fb5b1
commit
bd4c62af18
8 changed files with 252 additions and 36 deletions
140
.GitImages/Steam_logo.svg
Normal file
140
.GitImages/Steam_logo.svg
Normal file
|
@ -0,0 +1,140 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="210mm"
|
||||
height="297mm"
|
||||
viewBox="0 0 744.09448819 1052.3622047"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="Steam_logo.svg">
|
||||
<defs
|
||||
id="defs4">
|
||||
<linearGradient
|
||||
id="linearGradient4321"
|
||||
inkscape:collect="always">
|
||||
<stop
|
||||
id="stop4307"
|
||||
offset="0"
|
||||
style="stop-color:#1384b5;stop-opacity:1" />
|
||||
<stop
|
||||
style="stop-color:#061839;stop-opacity:1"
|
||||
offset="0.62431401"
|
||||
id="stop4311" />
|
||||
<stop
|
||||
id="stop4309"
|
||||
offset="1"
|
||||
style="stop-color:#121d2f;stop-opacity:1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4321"
|
||||
id="linearGradient4235-7"
|
||||
x1="-194.39487"
|
||||
y1="712.3446"
|
||||
x2="525.20538"
|
||||
y2="296.88318"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.33581664,0,0,0.33581664,-243.5941,154.00635)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4321"
|
||||
id="linearGradient4235-4"
|
||||
x1="-194.39487"
|
||||
y1="712.3446"
|
||||
x2="525.20538"
|
||||
y2="296.88318"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.27039694,-0.46834124,0.46834124,0.27039694,104.81683,684.74842)" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.70710678"
|
||||
inkscape:cx="466.2503"
|
||||
inkscape:cy="319.78112"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1360"
|
||||
inkscape:window-height="706"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
style="display:inline">
|
||||
<path
|
||||
style="opacity:1;fill:#a41c23;fill-opacity:1;stroke:none;stroke-width:16.09499931;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 108.03727,30.722827 c -2.59475,-0.035 -5.16948,0.0992 -7.67303,0.41311 -14.890203,1.86708 -24.604713,8.36798 -30.021343,20.09025 -1.72321,3.72915 -2.12934,5.80423 -2.37808,12.16846 -0.45631,11.67533 1.99644,18.54197 8.82212,24.70856 5.94163,5.36792 11.55583,7.33081 27.721813,9.69124 16.867,2.462783 20.17204,4.824343 20.17757,14.420613 0,3.98808 -0.35199,5.46475 -1.84049,7.65526 -3.57379,5.25934 -13.781,7.68688 -25.118793,5.97317 -7.46925,-1.129 -12.13489,-2.86498 -16.90226,-6.29004 l -3.69433,-2.65492 -7.11483,7.15182 -7.11331,7.15182 3.03249,2.60457 c 3.35674,2.8838 12.73858,8.00073 17.42499,9.50318 9.45636,3.03173 26.175463,3.55476 35.643573,1.11497 14.45603,-3.72503 24.3443,-13.08893 27.02585,-25.59255 1.1688,-5.45 0.37709,-15.88397 -1.60805,-21.187453 -2.95903,-7.90548 -10.92788,-14.70864 -20.1302,-17.18657 -1.65771,-0.44637 -7.72868,-1.50461 -13.49071,-2.35136 -15.958093,-2.3451 -20.719103,-5.10866 -21.553193,-12.50902 -0.50961,-4.52131 0.90118,-8.17815 4.3592,-11.30225 3.89895,-3.52245 7.902823,-4.51978 16.299633,-4.06158 7.39753,0.40367 13.18891,2.19596 17.35092,5.37054 l 2.47876,1.89086 6.95335,-6.44553 c 3.82434,-3.54475 6.95342,-6.74104 6.95342,-7.10295 0,-0.36191 -2.24571,-2.26071 -4.99148,-4.22001 -7.7568,-5.53519 -19.3698,-8.85286 -30.61359,-9.00419 z m 527.62645,1.07647 -11.1172,0.21027 -11.1171,0.21025 -14.4029,30.10428 c -7.9211,16.55745 -14.609,29.97566 -14.8633,29.81849 -0.2544,-0.15718 -6.9381,-13.78506 -14.8515,-30.28492 l -14.388,-29.99914 -11.1823,-0.009 -11.1823,-0.009 0,56.35426 c 0,30.994573 0.2367,56.589503 0.5256,56.878423 0.289,0.28892 5.321,0.43203 11.1823,0.31688 l 10.6567,-0.21027 0.379,-32.59926 0.3791,-32.599263 10.6137,21.031973 10.6137,21.03346 7.5916,0.005 7.5931,0.006 10.6018,-21.25112 10.6034,-21.249633 0.3791,32.811003 0.379,32.81248 10.8033,0.21027 10.8032,0.21025 0,-56.900633 z m -459.42212,0.0415 0,9.85559 0,9.85559 14.78338,0 14.78339,0 0,46.49867 c 0,25.574003 0.2269,46.725583 0.50491,47.003583 0.27793,0.27801 5.22467,0.50492 10.99277,0.50492 l 10.48787,0 0,-46.987293 0,-46.9873 14.97291,-0.20582 14.97292,-0.20582 0.21174,-9.66606 0.21319,-9.66606 -40.96226,0 z m 116.75084,0 0,56.35426 c 0,30.994573 0.2269,56.581173 0.50491,56.859173 0.27792,0.27801 17.16511,0.50492 37.52706,0.50492 l 37.02214,0 0,-10.23465 0,-10.23465 -26.53428,0 -26.53428,0 0,-13.64621 0,-13.646203 22.74367,0 22.74367,0 0,-9.85559 0,-9.85559 -22.74367,0 -22.74367,0 0,-13.26714 0,-13.26714 26.53428,0 26.53428,0 0,-9.85559 0,-9.85559 -37.52705,0 z m 149.61808,0 -20.4945,56.29058 c -11.2716,30.959823 -20.3472,56.556193 -20.1672,56.879913 0.18,0.32364 5.3344,0.49422 11.4533,0.37906 l 11.1245,-0.21026 3.4071,-10.04512 3.4057,-10.04512 20.222,0 20.222,0 3.3479,10.04512 3.3464,10.04512 11.588,0.21026 c 9.1372,0.16543 11.5185,0.008 11.2578,-0.75812 -0.1817,-0.53228 -9.5031,-26.12857 -20.7151,-56.879913 l -20.3863,-55.91152 -8.8058,0 z m 208.9738,0 0,2.27437 c 0,2.22382 0.084,2.27436 3.7906,2.27436 l 3.7906,0 0,12.12996 0,12.12996 3.0325,0 3.0325,0 0,-12.12996 0,-12.12996 3.7906,0 c 3.7064,0 3.7906,-0.0506 3.7906,-2.27436 l 0,-2.27437 -10.6137,0 z m 25.018,0 0,14.40432 0,14.40433 3.0325,0 3.0325,0 0.022,-7.77076 0.022,-7.77075 2.7289,5.11733 c 3.7965,7.11779 5.2998,7.05561 9.1582,-0.37906 l 2.8518,-5.49639 0.2147,8.14981 0.2162,8.14982 2.6268,0 2.6282,0 0,-14.40433 0,-14.40432 -2.9184,0 -2.917,0 -3.5671,7.58122 c -1.9613,4.16968 -3.7002,7.58123 -3.8646,7.58123 -0.1644,0 -1.9034,-3.41155 -3.8647,-7.58123 l -3.5655,-7.58122 -2.9185,0 z m -224.4175,34.64559 c 0.015,-0.006 0.026,-0.005 0.036,0.006 0.2991,0.33099 3.4603,9.38591 7.0245,20.12281 l 6.4811,19.521653 -14.0475,0 c -10.9257,0 -13.9658,-0.21056 -13.6833,-0.94765 0.1997,-0.52121 3.3602,-9.576123 7.023,-20.122823 3.5483,-10.2171 6.7012,-18.3806 7.1666,-18.57991 z"
|
||||
id="rect4149"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="sssssscsscccccssssssssscccssscccccscccsccccccccccccccccccccccscsccccccccccscsccccccccccccccccccccccsccccccccccccccccsscccccccssccccccccccccccccccccccsccccscscscsss" />
|
||||
<rect
|
||||
style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:16.09499931;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="rect4395"
|
||||
width="590"
|
||||
height="513.65686"
|
||||
x="97.89949"
|
||||
y="514.70526" />
|
||||
</g>
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer2"
|
||||
inkscape:label="Layer 2">
|
||||
<g
|
||||
style="display:inline"
|
||||
id="g4391"
|
||||
transform="matrix(0.98305933,0,0,0.98216858,2.452725,29.907117)"
|
||||
inkscape:export-xdpi="776.08423"
|
||||
inkscape:export-ydpi="776.08423">
|
||||
<ellipse
|
||||
ry="241.64737"
|
||||
rx="241.757"
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:16.09499931;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="circle4387"
|
||||
cx="-466.81732"
|
||||
cy="715.64471"
|
||||
transform="matrix(0.49965991,-0.86622167,0.86582892,0.50034017,0,0)" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path4227-8"
|
||||
d="M 374.74823,520.89049 A 241.81211,241.81211 0 0 0 176.74231,641.5263 241.81211,241.81211 0 0 0 144.7832,748.694 l 2.95289,1.12062 129.05746,48.54105 5.74041,-2.89825 c 8.3742,-4.22704 16.64068,-6.36609 27.60951,-7.14451 l 9.13328,-0.64817 27.31127,-41.0289 27.30978,-41.02891 0.34549,-5.87034 c 2.49398,-42.52266 32.62346,-77.27674 74.07763,-85.44477 4.2899,-0.84527 9.90746,-1.34854 15.513,-1.4794 0.70071,-0.0163 1.4003,-0.0265 2.09803,-0.031 4.88391,-0.0323 9.63169,0.22421 13.34262,0.78989 39.66263,6.04608 70.9759,37.3234 77.02019,76.93308 1.13794,7.45716 0.95823,22.87133 -0.34697,29.64552 -2.27339,11.79915 -6.90551,23.50807 -13.28948,33.59501 -4.70604,7.43563 -16.90375,20.02159 -24.34508,25.11875 -13.80393,9.45546 -28.64769,14.8748 -44.32876,16.18773 l -6.30294,0.52857 -42.58212,32.54673 c -23.41999,17.90054 -42.80957,32.76565 -43.08855,33.03396 -0.27898,0.26826 -0.76508,2.35362 -1.08075,4.63456 -1.51612,10.95497 -6.70034,23.17265 -13.73832,32.3799 -9.71028,12.70324 -24.83979,22.06955 -40.69818,25.19847 -5.9439,1.17272 -16.99465,1.57775 -22.21015,0.81351 -15.26903,-2.2376 -28.40704,-8.88689 -39.41072,-19.9497 -8.30938,-8.35407 -13.47285,-16.86693 -16.83294,-27.74831 l -1.22545,-3.96868 -17.74834,-6.73997 c -6.36687,-2.41791 -36.73693,-13.63689 -72.08443,-26.92001 A 241.81211,241.81211 0 0 0 265.25071,971.84819 241.81211,241.81211 0 0 0 595.5726,883.33832 241.81211,241.81211 0 0 0 507.06272,553.01791 241.81211,241.81211 0 0 0 374.74823,520.89049 Z m 90.53998,122.09897 c -0.80686,0.002 -1.6117,0.0158 -2.40807,0.0398 -3.8227,0.11551 -7.45816,0.48696 -10.27753,1.12358 -30.94342,6.98687 -51.77878,36.51539 -47.72753,67.64328 3.51997,27.04568 24.11295,48.22856 51.44078,52.91576 2.99351,0.51318 7.55603,0.64077 12.66199,0.35435 16.01074,-0.89806 28.90762,-6.63714 40.13861,-17.8635 17.36462,-17.35749 22.61524,-42.67355 13.62758,-65.70324 -7.05277,-18.07155 -22.70839,-31.80764 -42.11705,-36.95392 -3.92562,-1.04089 -9.69072,-1.56948 -15.33878,-1.55617 z m 4.97414,12.21758 c 4.31511,0.0281 5.95487,0.39843 9.63676,1.58569 16.13209,5.20198 28.26206,17.42228 33.12845,33.3765 2.22207,7.28471 2.46437,17.80999 0.58025,25.13203 -4.73228,18.3903 -18.55306,31.99726 -36.74575,36.17731 -25.7367,5.91336 -51.52093,-9.74847 -58.36974,-35.45532 -1.68537,-6.32604 -1.7699,-17.03217 -0.18604,-23.56257 3.91625,-16.14692 15.54928,-29.01697 31.63726,-35.00354 4.83427,-1.7989 6.10715,-1.98507 14.93718,-2.18071 2.20746,-0.0489 3.94323,-0.0788 5.38163,-0.0694 z m -156.15463,151.0107 c -0.73571,-0.007 -1.49956,0.002 -2.26929,0.0236 -4.61829,0.13368 -9.432,0.75461 -9.41824,1.37753 0.006,0.27125 4.4683,2.13709 9.9158,4.14733 13.87756,5.1212 18.29632,7.43231 23.24661,12.15409 9.4142,8.9796 13.74431,20.51761 12.45529,33.19046 -2.01309,19.79154 -18.7647,35.20774 -38.73599,35.65022 -6.7206,0.1489 -11.41538,-1.05178 -26.24527,-6.72225 -7.25509,-2.77412 -13.29636,-4.93471 -13.42531,-4.79992 -0.64576,0.67506 5.95917,8.76779 10.37497,12.71219 6.9528,6.21061 14.97662,10.11119 24.59165,11.95624 5.34043,1.02473 17.36994,0.40008 22.69295,-1.1782 21.94913,-6.50791 36.60993,-26.5847 36.10349,-49.44316 -0.58537,-26.42027 -20.74333,-47.35082 -47.18863,-48.99728 -0.65521,-0.0408 -1.36231,-0.0626 -2.09803,-0.0694 l 0,-0.002 z"
|
||||
style="opacity:1;fill:url(#linearGradient4235-4);fill-opacity:1;stroke:none;stroke-width:16.09499931;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
</g>
|
||||
<circle
|
||||
style="display:inline;opacity:1;fill:url(#linearGradient4235-7);fill-opacity:1;stroke:none;stroke-width:16.09499931;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path4227-1"
|
||||
cx="-198.01898"
|
||||
cy="329.42429"
|
||||
r="150.15802"
|
||||
transform="matrix(0.5,-0.8660254,0.8660254,0.5,0,0)" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 12 KiB |
|
@ -226,11 +226,6 @@ class Editor:
|
|||
self.savefile('list', fetch, permissions=True)
|
||||
self.has_filenames_changed = False
|
||||
|
||||
def strip_to_filename(self, s):
|
||||
for bad in self.WINDOWS_BADCHARS:
|
||||
s = s.replace(bad, '')
|
||||
return s
|
||||
|
||||
def sha(self, data):
|
||||
sha = hashlib.sha256()
|
||||
data = data.encode('utf-8')
|
||||
|
|
BIN
Logogame/images/steam.png
Normal file
BIN
Logogame/images/steam.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 70 KiB |
Binary file not shown.
|
@ -18,7 +18,6 @@ class LogoGame:
|
|||
self.WINDOWS_BADCHARS = '\\/?:*"><|'
|
||||
self.t = tkinter.Tk()
|
||||
self.t.title('Logogame')
|
||||
self.tkinter_elements = []
|
||||
if not os.path.exists('logos.db'):
|
||||
print('You\'re missing the game\'s logo database!')
|
||||
print('Cannot proceed!')
|
||||
|
@ -30,11 +29,21 @@ class LogoGame:
|
|||
self.color_green = '#31f13a'
|
||||
self.color_red = '#e23939'
|
||||
|
||||
self.dbindex_id = 0
|
||||
self.dbindex_images = 1
|
||||
self.dbindex_name = 2
|
||||
self.dbindex_solutions = 3
|
||||
self.dbindex_tag = 4
|
||||
self.dbindex_solved = 5
|
||||
|
||||
self.sql = sqlite3.connect('logos.db')
|
||||
self.cur = self.sql.cursor()
|
||||
self.stats_main = self.stats_load('stats')
|
||||
self.playerstats_load(self.stats_main.playername)
|
||||
|
||||
self.tkinter_elements = []
|
||||
self.active_tags = set()
|
||||
|
||||
self.w = 1062
|
||||
self.h = 600
|
||||
self.screenwidth = self.t.winfo_screenwidth()
|
||||
|
@ -46,10 +55,10 @@ class LogoGame:
|
|||
self.geometrystring = '%dx%d+%d+%d' % (self.windowwidth, self.windowheight, self.windowx, self.windowy)
|
||||
self.t.geometry(self.geometrystring)
|
||||
|
||||
self.uirefresher = self.buildui_main
|
||||
self.buildui_main()
|
||||
self.uirefresher = self.gui_build_main
|
||||
self.gui_build_main()
|
||||
|
||||
self.t.bind('<Configure>', self.update_wh)
|
||||
#self.t.bind('<Configure>', self.update_wh)
|
||||
|
||||
self.t.mainloop()
|
||||
|
||||
|
@ -67,35 +76,43 @@ class LogoGame:
|
|||
self.tkinter_elements[0].destroy()
|
||||
del self.tkinter_elements[0]
|
||||
|
||||
def buildui_main(self, *b):
|
||||
def gui_build_main(self, *b):
|
||||
self.destroy_all_elements()
|
||||
x = self.w
|
||||
y = self.h
|
||||
|
||||
###
|
||||
self.frame_mainmenu = tkinter.Frame(self.t)
|
||||
self.frame_mainmenu.pack(expand=True, anchor='center')
|
||||
self.tkinter_elements.append(self.frame_mainmenu)
|
||||
#
|
||||
self.button_playgame = tkinter.Button(
|
||||
self.t,
|
||||
self.frame_mainmenu,
|
||||
text='Play',
|
||||
#relief='flat',
|
||||
font=self.font_main,
|
||||
bg=self.color_green,
|
||||
activebackground=self.color_green,
|
||||
command=self.buildui_game)
|
||||
command=self.gui_build_game)
|
||||
self.button_playgame.grid(row=10, column=5)
|
||||
|
||||
self.label_playername = tkinter.Label(self.t, text='Player name: ', font=self.font_main)
|
||||
self.tkinter_elements.append(self.button_playgame)
|
||||
#
|
||||
self.label_playername = tkinter.Label(
|
||||
self.frame_mainmenu,
|
||||
text='Player name: ',
|
||||
font=self.font_main)
|
||||
self.label_playername.grid(row=30, column=4)
|
||||
|
||||
self.tkinter_elements.append(self.label_playername)
|
||||
#
|
||||
self.entry_playername = tkinter.Entry(
|
||||
self.t,
|
||||
self.frame_mainmenu,
|
||||
font=self.font_main,
|
||||
relief='solid',
|
||||
width=30)
|
||||
self.entry_playername.bind('<Return>', lambda x: self.playername_set(self.entry_playername.get()))
|
||||
self.entry_playername.insert(0, self.stats_main.playername)
|
||||
self.entry_playername.grid(row=30, column=5)
|
||||
|
||||
self.tkinter_elements.append(self.entry_playername)
|
||||
#
|
||||
self.button_playername = tkinter.Button(
|
||||
self.t,
|
||||
self.frame_mainmenu,
|
||||
text='Set',
|
||||
font=self.font_small,
|
||||
#relief='flat',
|
||||
|
@ -103,30 +120,54 @@ class LogoGame:
|
|||
activebackground=self.color_blue,
|
||||
command=lambda: self.playername_set(self.entry_playername.get()))
|
||||
self.button_playername.grid(row=30, column=6)
|
||||
|
||||
self.label_playerhash = tkinter.Label(self.t, text=self.sha8(self.stats_main.playername),
|
||||
self.tkinter_elements.append(self.button_playername)
|
||||
#
|
||||
self.label_playerhash = tkinter.Label(
|
||||
self.frame_mainmenu,
|
||||
text=self.sha8(self.stats_main.playername),
|
||||
font=self.font_main)
|
||||
self.label_playerhash.grid(row=30, column=7)
|
||||
|
||||
self.tkinter_elements.append(self.button_playgame)
|
||||
self.tkinter_elements.append(self.label_playername)
|
||||
self.tkinter_elements.append(self.entry_playername)
|
||||
self.tkinter_elements.append(self.button_playername)
|
||||
self.tkinter_elements.append(self.label_playerhash)
|
||||
###
|
||||
|
||||
def buildui_game(self, *b):
|
||||
def gui_build_game(self, *b):
|
||||
self.destroy_all_elements()
|
||||
|
||||
###
|
||||
self.frame_gametoolbar = tkinter.Frame(self.t)
|
||||
self.frame_gametoolbar.pack(fill='x', anchor='n')
|
||||
self.tkinter_elements.append(self.frame_gametoolbar)
|
||||
#
|
||||
self.button_back = tkinter.Button(
|
||||
self.t,
|
||||
self.frame_gametoolbar,
|
||||
text='X',
|
||||
font=self.font_main,
|
||||
bg=self.color_red,
|
||||
activebackground=self.color_red,
|
||||
command=self.buildui_main)
|
||||
command=self.gui_build_main)
|
||||
self.button_back.grid(row=0, column=0)
|
||||
|
||||
self.tkinter_elements.append(self.button_back)
|
||||
#
|
||||
self.frame_gametaglist = tkinter.Frame(self.t)
|
||||
self.frame_gametaglist.pack(expand=True, fill='y', anchor='e')
|
||||
self.tkinter_elements.append(self.frame_gametaglist)
|
||||
#
|
||||
alltags = self.get_all_tags()
|
||||
for tag in alltags:
|
||||
intvar = tkinter.IntVar()
|
||||
intvar.title=tag
|
||||
checkbox = tkinter.Checkbutton(self.frame_gametaglist, text=tag, variable=intvar)
|
||||
checkbox.intvar = intvar
|
||||
checkbox.grid(row=alltags.index(tag), column=0, sticky='w')
|
||||
intvar.set(1)
|
||||
self.tkinter_elements.append(checkbox)
|
||||
self.active_tags.add(tag)
|
||||
###
|
||||
|
||||
def gui_build_logo(self, *b):
|
||||
self.destroy_all_elements()
|
||||
###
|
||||
|
||||
|
||||
|
||||
def playername_set(self, newname):
|
||||
if newname != self.stats_main.playername:
|
||||
|
@ -145,9 +186,6 @@ class LogoGame:
|
|||
sha = sha.hexdigest()
|
||||
return sha[:8]
|
||||
|
||||
def getnext(self):
|
||||
pass
|
||||
|
||||
def png_load(self, filename, resize=None):
|
||||
if filename[-4:] != '.png':
|
||||
filename = filename + '.png'
|
||||
|
@ -206,4 +244,16 @@ class LogoGame:
|
|||
s = s.replace(badchar, '')
|
||||
return s
|
||||
|
||||
def get_all_tags(self):
|
||||
self.cur.execute('SELECT * FROM logos')
|
||||
fetch = self.cur.fetchall()
|
||||
alltags = []
|
||||
for item in fetch:
|
||||
itemtags = item[self.dbindex_tag]
|
||||
itemtags = itemtags.replace(', ', ',')
|
||||
itemtags = itemtags.split(',')
|
||||
alltags += itemtags
|
||||
alltags.sort()
|
||||
return alltags
|
||||
|
||||
logogame = LogoGame()
|
BIN
Logogame/playerdata/Person_6007db63.db
Normal file
BIN
Logogame/playerdata/Person_6007db63.db
Normal file
Binary file not shown.
1
ascii/PNGCREATOR.bat
Normal file
1
ascii/PNGCREATOR.bat
Normal file
|
@ -0,0 +1 @@
|
|||
for %%i in (*.ps) do C:\bit\ghostscript\bin\gswin64 -r180 -sDEVICE=png16m -dBATCH -dNOPAUSE -dSAFER -dEPSCrop -Ic:C:\Windows\Fonts -sOutputFile=%%~ni.png %%i
|
30
ascii/text_to_ps.py
Normal file
30
ascii/text_to_ps.py
Normal file
|
@ -0,0 +1,30 @@
|
|||
import os
|
||||
from PIL import Image
|
||||
import subprocess
|
||||
import tkinter
|
||||
|
||||
filename_noext = input(']>> ')
|
||||
filename_text = filename_text.replace('.txt', '')
|
||||
filename_text = filename_noext + '.txt'
|
||||
filename_ghost = filename_noext + '_render.ps'
|
||||
|
||||
|
||||
|
||||
filea = open(filename_text, 'r')
|
||||
lines = filea.read()
|
||||
lines_split = lines.split('\n')
|
||||
lines_height = len(lines_split)
|
||||
lines_width = len(lines_split[0])
|
||||
print('%d x %d' % (lines_width, lines_height))
|
||||
lines_height *= 17
|
||||
lines_width *= 7
|
||||
filea.close()
|
||||
t = tkinter.Tk()
|
||||
c = tkinter.Canvas(t, width=lines_width, height=lines_height)
|
||||
c.pack()
|
||||
c.create_text(0, 0, text=lines, anchor="nw", font=("Courier New", 12))
|
||||
print('Writing Postscript')
|
||||
c.postscript(file=filename_ghost, width=lines_width, height=lines_height)
|
||||
t.destroy()
|
||||
print('Writing PNG')
|
||||
subprocess.Popen('PNGCREATOR.bat', shell=True, cwd='D:/!/o/asscii')
|
Loading…
Reference in a new issue