import os
import sys
import subprocess
import tkinter as tk
from pathlib import Path

cwd = __file__.rsplit("\\", 1)[0]
if Path(f"{cwd}/requirements.txt").exists():
    subprocess.check_call([sys.executable] + "-m pip install -r".split(' ') + [f"{cwd}/requirements.txt"])
os.system("cls")

from globals import *

__author__ = "Jochem van Dolder"
__license__ = "MIT"
__all__ = ["app"]

ASSET_FOLDER = Path(cwd) / "Assets"

class app():
    def __init__(self, ui:tk.Canvas):
        self.ui = ui
    def build_ui(self):
        def on_scale_change(val,destroy=True):
            if destroy:
                self.ui.delete(self.uwu_text)
            self.uwu_text = self.ui.create_text(200,200,text=
                """
                RAWR X3 Nuzzles, pounces on you
                UwU, you're so warm
                Couldn't help but notice your bulge from across the floor
                Nuzzles your necky wecky ~ murr ~ (he-he)
                Unzips your baggy ass pants, oh, baby, you so musky
                Take me home, pet me and make me yours
                And don't forget to stuff me
                See me wag my wittle baby tail, all for your bulgy-wulgy
                Kissies and lickies your neck, I hope daddy likies
                Nuzzle and wuzzles your chest, I be getting thirsty
                Hey, I got a little itch, you think you can help me?
                Only seven inches long, UwU
                PLEASE ADOPT ME!
                Paws on your bulge as I lick my lips
                (OwO, punish me please)
                Gotta hit 'em with this furry shit (he don't see it coming)
                """, anchor='center', fill=L_GREY, angle=val)
        on_scale_change(0,False)
        self.ui.create_window(500,40,window=tk.Scale(from_=0, to= 360, command=on_scale_change), anchor='nw')