-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: switched to all custom dialogs
- Loading branch information
1 parent
60e9fcd
commit a783ee4
Showing
10 changed files
with
175 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { dialogModalCancel, dialogModalCancelText, dialogModalConfirm, dialogModalConfirmText, dialogModalMessage, dialogModalTitle, dialogModalType, showDialogModal } from "../../Stores"; | ||
|
||
/** | ||
* Controller class for handling dialog modals. | ||
*/ | ||
export class DialogController { | ||
|
||
/** | ||
* Displays a message with a single button. | ||
* @param title The title of the dialog modal. | ||
* @param type The type of the dialog modal. | ||
* @param message The message to display. | ||
* @param confirmText The text displayed in the button. | ||
*/ | ||
static async message(title: string, type: DialogModalType, message: string, confirmText: string): Promise<boolean> { | ||
return new Promise((resolve) => { | ||
dialogModalTitle.set(title); | ||
dialogModalType.set(type); | ||
dialogModalMessage.set(message); | ||
dialogModalConfirmText.set(confirmText); | ||
dialogModalConfirm.set(async () => resolve(true)); | ||
dialogModalCancelText.set(""); | ||
dialogModalCancel.set(async () => {}); | ||
|
||
showDialogModal.set(true); | ||
}); | ||
} | ||
|
||
/** | ||
* Asks the user for input on a decision. | ||
* @param title The title of the dialog modal. | ||
* @param type The type of the dialog modal. | ||
* @param message The message of the dialog modal. | ||
* @param confirmText The text displayed for the confirm action. | ||
* @param cancelText The text displayed for the cancel action. | ||
*/ | ||
static async ask(title: string, type: DialogModalType, message: string, confirmText: string, cancelText: string): Promise<boolean> { | ||
return new Promise((resolve) => { | ||
dialogModalTitle.set(title); | ||
dialogModalType.set(type); | ||
dialogModalMessage.set(message); | ||
dialogModalConfirmText.set(confirmText); | ||
dialogModalConfirm.set(async () => resolve(true)); | ||
dialogModalCancelText.set(cancelText); | ||
dialogModalCancel.set(async () => resolve(false)); | ||
|
||
showDialogModal.set(true); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
type SteamRegistryApp = { | ||
appid: string, | ||
name: string | ||
} | ||
|
||
type SteamShortcut = { | ||
AllowDesktopConfig: number | ||
AllowOverlay: number | ||
AppName: string | ||
Devkit: number | ||
DevkitGameID: string, | ||
DevkitOverrideAppID: number | ||
Exe: string, | ||
FlatpakAppID: string, | ||
IsHidden: number, | ||
LastPlayTime: number, | ||
LaunchOptions: string, | ||
OpenVR: number, | ||
ShortcutPath: string, | ||
StartDir: string, | ||
appid: number, | ||
icon: string, | ||
tags: { | ||
[key: number]: string | ||
} | ||
} | ||
|
||
type SteamUser = { | ||
id64: string, | ||
id32: string, | ||
AccountName: string, | ||
PersonaName: string, | ||
RememberPassword: string, | ||
WantsOfflineMode: string, | ||
SkipOfflineModeWarning: string, | ||
AllowAutoLogin: string, | ||
MostRecent: string, | ||
Timestamp: string | ||
} |
Oops, something went wrong.