Inital commit
This commit is contained in:
commit
a4894d612a
|
|
@ -0,0 +1,7 @@
|
|||
.idea/
|
||||
.vscode/
|
||||
|
||||
__pycache__
|
||||
*.py[cod]
|
||||
|
||||
venv/
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
# Stardew Valley Mod Launcher
|
||||
|
||||
This is the attempt to create a usable mod manager for Stardew Valley, including
|
||||
downloading and installing mods, automatic updates, and syncing mods between
|
||||
multiple devices.
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import webview
|
||||
|
||||
|
||||
class Api():
|
||||
def hello(self):
|
||||
print('Received hello()!')
|
||||
print('Returning "meow"!')
|
||||
return "meow"
|
||||
|
||||
def list_mods(self):
|
||||
sdv_root_dir = "/data/Games/SteamLibrary/steamapps/common/Stardew Valley"
|
||||
mod_list = os.listdir(sdv_root_dir + "/Mods")
|
||||
return mod_list
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
api = Api()
|
||||
webview.create_window('Stardew Mod Launcher v0.0.1', '../assets/index.html', js_api=api, min_size=(600,400))
|
||||
webview.start(debug=True)
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>Stardew Mod Launcher</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1>Hallo :)</h1>
|
||||
|
||||
<button onclick="hello()">Click me!</button>
|
||||
|
||||
|
||||
<h2>Mod list</h2>
|
||||
|
||||
<ul id="mod_list">
|
||||
<li>(not loaded yet)</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<script>
|
||||
function hello() {
|
||||
pywebview.api.hello().then((result) => {
|
||||
alert(result);
|
||||
});
|
||||
}
|
||||
|
||||
function list_mods() {
|
||||
pywebview.api.list_mods().then((mod_list) => {
|
||||
const list_ul = document.getElementById('mod_list');
|
||||
list_ul.textContent = '';
|
||||
|
||||
mod_list.forEach((item) => {
|
||||
const new_li = document.createElement('li');
|
||||
new_li.textContent = item;
|
||||
list_ul.appendChild(new_li);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
window.addEventListener('pywebviewready', () => {
|
||||
list_mods();
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1 @@
|
|||
pywebview
|
||||
Loading…
Reference in New Issue