diff options
author | B. Stack <bgstack15@gmail.com> | 2024-05-02 15:20:54 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2024-05-02 15:20:54 -0400 |
commit | e13ec405e8a1d022a7674d18ecffb5853cb034d8 (patch) | |
tree | 71278c90212b0f9c766be39313c8ee771e724747 /srb_tk.py | |
parent | tk: add tooltip for breakables (diff) | |
download | srb_lib-e13ec405e8a1d022a7674d18ecffb5853cb034d8.tar.gz srb_lib-e13ec405e8a1d022a7674d18ecffb5853cb034d8.tar.bz2 srb_lib-e13ec405e8a1d022a7674d18ecffb5853cb034d8.zip |
tk: add background color for levelsets
Diffstat (limited to 'srb_tk.py')
-rwxr-xr-x | srb_tk.py | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -53,6 +53,15 @@ SPDX-License-Identifier: GPL-3.0-only Icon courtesy of https://icons8.com/icon/9336/aircraft """ +# muted colors for backgrounds of levels within a levelset whose balloon is this color. +colors = { + "blue": 0xccffff, + "green": 0xccff99, + "red": 0xffcccc, + "orange": 0xffcc99, + "yellow": 0xffff99, +} + def get_srb_image(filename, sizex, sizey, resample=Image.Resampling.LANCZOS, photoImage = True): """ helper function that returns an ImageTk from the named file from the configured images directory, resized for you. """ global IMAGE_FAILURES @@ -296,6 +305,7 @@ class App(tk.Frame): self.lbl_levelsets.append(tk.Label(self.frm_levels,text=tl["name"])) self.lbl_levelsets[i].grid(row=x,column=0,sticky="EW",columnspan=2) if "c" in tl and tl["c"] != "none": + tk.Label(self.frm_levels,background="#" + hex(colors[tl["c"]])[2:]).grid(row=x,column=0,rowspan=tl["l"],columnspan=17,sticky="NESW") tk.Label(self.frm_levels,image=self.img_balloons[-1]).grid(row=x,column=2,columnspan=2) self.spn_levelsets.append(stk.Spinbox(self.frm_levels,textvariable=self.levelset_status_ints[i],from_=0,to=tl["l"],width=2)) self.spn_levelsets[i].grid(row=x+1,column=0) |