diff --git a/app.py b/app.py index 04b61a1..df788b4 100644 --- a/app.py +++ b/app.py @@ -15,6 +15,8 @@ modspath = Path.cwd()/"mods" logging.basicConfig(filename='fDDMEPlayer.log', filemode='w', level=logging.INFO, format="[%(levelname)s|%(levelno)s] (%(funcName)s) %(message)s") +addmodgui = None + def findParent(names, path): for root, dirs, files in os.walk(path): for name in names: @@ -52,7 +54,7 @@ def moveTree(src, dst): if os.path.isdir(s): isRecursive = not isAFlatDir(s) if isRecursive: - copyTree(s, d) + moveTree(s, d) else: forceMergeFlatDir(s, d) @@ -69,10 +71,17 @@ def modlist(): @app.route('/addmod') def addmod(): + global addmodgui + addmodgui = gui("Add Mod") + addmodgui.addLabel("title", "Add a Mod") + addmodgui.addLabelEntry("Mod Name") + addmodgui.addFileEntry("f1") + addmodgui.addButtons(["Add", "Cancel"], addmodPress) addmodgui.go() return "Please wait..." def addmodPress(button): + global addmodgui modname = addmodgui.getEntry("Mod Name") modfile = addmodgui.getEntry("f1") if button == "Add": @@ -91,8 +100,8 @@ def addmodPress(button): with shelve.open('mods.db',writeback=True) as mods: mods[slugify(modname)]=modname - addmodgui.clearAllEntries() addmodgui.stop() + del addmodgui @app.route('/launchmod/') def launchmod(slug): @@ -112,10 +121,5 @@ def quitprogram(): print("Press enter to continue...") input() raise SystemExit - addmodgui = gui("Add Mod") - addmodgui.addLabel("title", "Add a Mod") - addmodgui.addLabelEntry("Mod Name") - addmodgui.addFileEntry("f1") - addmodgui.addButtons(["Add", "Cancel"], addmodPress) print("Open your web brower to localhost:5000") app.run(threaded=False) diff --git a/static/bg.png b/static/bg.png new file mode 100644 index 0000000..58683ad Binary files /dev/null and b/static/bg.png differ diff --git a/static/style.css b/static/style.css new file mode 100644 index 0000000..f6684bf --- /dev/null +++ b/static/style.css @@ -0,0 +1,72 @@ +@import url('https://fonts.googleapis.com/css?family=McLaren|Noto+Sans|Ubuntu'); + +body { + background-image: url("bg.png"); + background-size: cover; + line-height: 1.5; + color: black; + margin: 0; + padding: 0; +} + +a { + text-decoration: none; +} + +a:hover { + background-color: #B259A6; +} + +#allthemcontents { + border: 3px solid black; + margin: 10px; + padding: 10px; + display: inline-block; + background-color: rgba(0, 0, 0, 0.3); +} + +#headerdiv { + font-size: 14px; + margin-top: 0; +} + +#titletext { + font-size: 50px; + margin-top: 0; + font-family: "McLaren", sans-serif; + color: white; +} + +#mainlist { + color: white; + font-size: 18px; + font-family: "Ubuntu", sans-serif; + list-style-type: none; + line-height: 2; +} + +.button { + color: black; + background-color: #FF7FED; + border: 2px solid black; + font-family: "Noto Sans", sans-serif; + font-size: 20px; + padding: 3px; +} + +#addmod_button { + margin-right: 30px; +} + +#launchbutton { + color: black; + background-color: cyan; + border: 2px solid black; + font-family: "Noto Sans", sans-serif; + font-size: 16px; + padding: 3px; +} + +#launchbutton:hover { + background-color: #00B2B2; +} diff --git a/templates/modlist.html b/templates/modlist.html index 28d4762..7dd8200 100644 --- a/templates/modlist.html +++ b/templates/modlist.html @@ -3,14 +3,20 @@ fDDME Player + - - Add Mod - Quit Launcher +
+
+

fDDMEPlayer

+
+ + Add Mod + Quit Launcher +
- + \ No newline at end of file diff --git a/templates/static/bg.png b/templates/static/bg.png new file mode 100644 index 0000000..58683ad Binary files /dev/null and b/templates/static/bg.png differ diff --git a/templates/static/style.css b/templates/static/style.css new file mode 100644 index 0000000..f6684bf --- /dev/null +++ b/templates/static/style.css @@ -0,0 +1,72 @@ +@import url('https://fonts.googleapis.com/css?family=McLaren|Noto+Sans|Ubuntu'); + +body { + background-image: url("bg.png"); + background-size: cover; + line-height: 1.5; + color: black; + margin: 0; + padding: 0; +} + +a { + text-decoration: none; +} + +a:hover { + background-color: #B259A6; +} + +#allthemcontents { + border: 3px solid black; + margin: 10px; + padding: 10px; + display: inline-block; + background-color: rgba(0, 0, 0, 0.3); +} + +#headerdiv { + font-size: 14px; + margin-top: 0; +} + +#titletext { + font-size: 50px; + margin-top: 0; + font-family: "McLaren", sans-serif; + color: white; +} + +#mainlist { + color: white; + font-size: 18px; + font-family: "Ubuntu", sans-serif; + list-style-type: none; + line-height: 2; +} + +.button { + color: black; + background-color: #FF7FED; + border: 2px solid black; + font-family: "Noto Sans", sans-serif; + font-size: 20px; + padding: 3px; +} + +#addmod_button { + margin-right: 30px; +} + +#launchbutton { + color: black; + background-color: cyan; + border: 2px solid black; + font-family: "Noto Sans", sans-serif; + font-size: 16px; + padding: 3px; +} + +#launchbutton:hover { + background-color: #00B2B2; +}