Skip to content

Commit

Permalink
Merge pull request #8 from EMERALD0874/1.1.0
Browse files Browse the repository at this point in the history
Version 1.1.0
  • Loading branch information
EMERALD0874 authored Aug 27, 2022
2 parents 45010ee + e8af9d4 commit 513363b
Show file tree
Hide file tree
Showing 9 changed files with 334 additions and 136 deletions.
15 changes: 6 additions & 9 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
from logging import getLogger

starter_config_data = {
"music_enabled": False,
"music_library_only": False,
"selected_pack": "Default"
"selected_pack": "Default",
"selected_music": "None"
}
starter_config_string = json.dumps(starter_config_data)

Expand Down Expand Up @@ -220,9 +219,8 @@ async def parse_packs(self, packsDir : str):
packData = Pack(packPath, pack)

if (packData.name not in [p.name for p in self.soundPacks]):
if (packData.music == False):
self.soundPacks.append(packData)
Log("Audio Loader - Sound pack {} added".format(packData.name))
self.soundPacks.append(packData)
Log("Audio Loader - Sound pack {} added".format(packData.name))
except Exception as e:
Log("Audio Loader - Error parsing sound pack: {}".format(e))

Expand Down Expand Up @@ -254,9 +252,8 @@ async def _load(self):
async def _main(self):
self.soundPacks = []
self.config = {
"music_enabled": False,
"music_library_only": False,
"selected_pack": "Default"
"selected_pack": "Default",
"selected_music": "None"
}

self.remote = RemoteInstall(self)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SDH-AudioLoader",
"version": "1.0.1",
"version": "1.1.0",
"description": "Replaces and adds Steam Deck game UI sounds",
"scripts": {
"build": "shx rm -rf dist && rollup -c",
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"flags": ["debug", "_root"],
"publish": {
"tags": ["style", "media", "music"],
"description": "Replaces Steam UI sound effects with custom sounds.",
"description": "Replaces Steam UI sound effects with custom sounds and adds music to menus.",
"image": "https://i.imgur.com/0Xuc1pr.png"
}
}
135 changes: 135 additions & 0 deletions src/SteamClient.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
// Lovingly borrowed from https://github.com/hulkrelax/deckfaqs under the MIT License

// Non-exhaustive definition of the SteamClient that is available in the SP tab
// This object has a lot more properties/methods than are listed here
declare namespace SteamClient {
const Apps: {
GetAllShortcuts(): Promise<Shortcut[]>;
RegisterForGameActionStart(
callback: (
actionType: number,
strAppId: string,
actionName: string
) => any
): RegisteredEvent;
};
const InstallFolder: {
GetInstallFolders(): Promise<InstallFolder[]>;
};
const GameSessions: {
RegisterForAppLifetimeNotifications(
callback: (appState: AppState) => any
): RegisteredEvent;
};
const BrowserView: {
Create(): any;
CreatePopup(): any;
Destroy(e: any): void;
};

const Storage: {
GetJSON(key: string): Promise<string>;
SetObject(key: string, value: {}): Promise<void>;
};
}

declare const enum DisplayStatus {
Invalid = 0,
Launching = 1,
Uninstalling = 2,
Installing = 3,
Running = 4,
Validating = 5,
Updating = 6,
Downloading = 7,
Synchronizing = 8,
ReadyToInstall = 9,
ReadyToPreload = 10,
ReadyToLaunch = 11,
RegionRestricted = 12,
PresaleOnly = 13,
InvalidPlatform = 14,
PreloadComplete = 16,
BorrowerLocked = 17,
UpdatePaused = 18,
UpdateQueued = 19,
UpdateRequired = 20,
UpdateDisabled = 21,
DownloadPaused = 22,
DownloadQueued = 23,
DownloadRequired = 24,
DownloadDisabled = 25,
LicensePending = 26,
LicenseExpired = 27,
AvailForFree = 28,
AvailToBorrow = 29,
AvailGuestPass = 30,
Purchase = 31,
Unavailable = 32,
NotLaunchable = 33,
CloudError = 34,
CloudOutOfDate = 35,
Terminating = 36,
}

type AppState = {
unAppID: number;
nInstanceID: number;
bRunning: boolean;
};

declare namespace appStore {
function GetAppOverviewByGameID(appId: number): AppOverview;
}

type RegisteredEvent = {
unregister(): void;
};

type Shortcut = {
appid: number;
data: {
bIsApplication: true;
strAppName: string;
strSortAs: string;
strExePath: string;
strShortcutPath: string;
strArguments: string;
strIconPath: string;
};
};

type AppOverview = {
appid: string;
display_name: string;
display_status: DisplayStatus;
sort_as: string;
};

type App = {
nAppID: number;
strAppName: string;
strSortAs: string;
rtLastPlayed: number;
strUsedSize: string;
strDLCSize: string;
strWorkshopSize: string;
strStagedSize: string;
};

type InstallFolder = {
nFolderIndex: number;
strFolderPath: string;
strUserLabel: string;
strDriveName: string;
strCapacity: string;
strFreeSpace: string;
strUsedSize: string;
strDLCSize: string;
strWorkshopSize: string;
strStagedSize: string;
bIsDefaultFolder: boolean;
bIsMounted: boolean;
bIsFixed: boolean;
vecApps: App[];
};
Loading

0 comments on commit 513363b

Please sign in to comment.