diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 1735f73..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: "[BUG]" -labels: '' -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Desktop (please complete the following information):** - - OS: [e.g. Arch Linux, Windows] - - App Version [e.g. 22] - -**Additional context** -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index bbcbbe7..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0fc3abe..7d0ff2c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,7 +3,7 @@ stages: build-linux: stage: build - image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/rustlang/rust:nightly + image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/rust:1.81.0-bookworm script: - apt-get update -y - apt-get install yarnpkg libsoup-3.0-0 libsoup-3.0-dev libatk-adaptor libgtk-3-dev libjavascriptcoregtk-4.1-dev libwebkit2gtk-4.1-dev -y @@ -13,10 +13,9 @@ build-linux: - yarnpkg tauri build - cp src-tauri/target/release/bundle/deb/*.deb . - cp src-tauri/target/release/bundle/rpm/*.rpm . - - cp src-tauri/target/release/bundle/appimage/*.AppImage . artifacts: paths: - - "*.{deb,rpm,AppImage}" + - "*.{deb,rpm}" build-windows: stage: build diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index 4099407..0000000 --- a/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -23 diff --git a/README.md b/README.md index 903f4ca..b0df333 100644 --- a/README.md +++ b/README.md @@ -2,19 +2,6 @@ Drop app is the companion app for [Drop](https://github.com/Drop-OSS/drop). It uses a Tauri base with Nuxt 3 + TailwindCSS on top of it, so we can re-use components from the web UI. -## Running -Before setting up the drop app, be sure that you have a server set up. -The instructions for this can be found on the [Drop Wiki](https://wiki.droposs.org/guides/quickstart.html) - -## Current features -Currently supported are the following features: -- Signin (with custom server) -- Database registering & recovery -- Dynamic library fetching from server -- Installing & uninstalling games -- Download progress monitoring -- Launching / playing games - ## Development Install dependencies with `yarn` @@ -23,7 +10,7 @@ Run the app in development with `yarn tauri dev`. NVIDIA users on Linux, use she To manually specify the logging level, add the environment variable `RUST_LOG=[debug, info, warn, error]` to `yarn tauri dev`: -e.g. `RUST_LOG=debug yarn tauri dev` +e.g. `RUST_LOG=debug yarn taudi dev` ## Contributing Check the original [Drop repo](https://github.com/Drop-OSS/drop/blob/main/CONTRIBUTING.md) for contributing guidelines. \ No newline at end of file diff --git a/app.vue b/app.vue index b9011c6..9c11de6 100644 --- a/app.vue +++ b/app.vue @@ -1,12 +1,14 @@ diff --git a/components/InitiateAuthModule.vue b/components/InitiateAuthModule.vue index 1f9be6c..5f7158c 100644 --- a/components/InitiateAuthModule.vue +++ b/components/InitiateAuthModule.vue @@ -42,31 +42,6 @@ -
-

Having trouble?

-

- You can manually enter the token from your web browser. -

-
- - - Submit - -
-
-
@@ -126,10 +101,6 @@ import { invoke } from "@tauri-apps/api/core"; const loading = ref(false); const error = ref(); -const offerManual = ref(false); -const manualToken = ref(""); -const manualLoading = ref(false); - async function auth() { await invoke("auth_initiate"); } @@ -140,23 +111,5 @@ function authWrapper_wrapper() { loading.value = false; error.value = e; }); - setTimeout(() => { - offerManual.value = true; - }, 10000); -} - -async function continueManual() { - await invoke("manual_recieve_handshake", { token: manualToken.value }); -} - -function continueManual_wrapper() { - loading.value = true; - continueManual() - .catch((e) => { - error.value = e; - }) - .finally(() => { - loading.value = false; - }); } diff --git a/components/PageWidget.vue b/components/PageWidget.vue deleted file mode 100644 index ad9428b..0000000 --- a/components/PageWidget.vue +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/composables/downloads.ts b/composables/downloads.ts index d75c46f..860a8c3 100644 --- a/composables/downloads.ts +++ b/composables/downloads.ts @@ -1,14 +1,7 @@ import { listen } from "@tauri-apps/api/event"; -import type { DownloadableMetadata } from "~/types"; export type QueueState = { - queue: Array<{ - meta: DownloadableMetadata; - status: string; - progress: number | null; - current: number; - max: number; - }>; + queue: Array<{ id: string; status: string; progress: number | null }>; status: string; }; diff --git a/composables/game.ts b/composables/game.ts index 0335a7a..7f28435 100644 --- a/composables/game.ts +++ b/composables/game.ts @@ -12,8 +12,7 @@ export type SerializedGameStatus = [ OptionGameStatus | null ]; -export const parseStatus = (status: SerializedGameStatus): GameStatus => { - console.log(status); +const parseStatus = (status: SerializedGameStatus): GameStatus => { if (status[0]) { return { type: status[0].type, @@ -29,29 +28,28 @@ export const parseStatus = (status: SerializedGameStatus): GameStatus => { } }; -export const useGame = async (gameId: string) => { - if (!gameRegistry[gameId]) { +export const useGame = async (id: string) => { + if (!gameRegistry[id]) { const data: { game: Game; status: SerializedGameStatus } = await invoke( "fetch_game", { - gameId, + id, } ); - gameRegistry[gameId] = data.game; - if (!gameStatusRegistry[gameId]) { - gameStatusRegistry[gameId] = ref(parseStatus(data.status)); + gameRegistry[id] = data.game; + if (!gameStatusRegistry[id]) { + gameStatusRegistry[id] = ref(parseStatus(data.status)); - listen(`update_game/${gameId}`, (event) => { + listen(`update_game/${id}`, (event) => { const payload: { status: SerializedGameStatus; } = event.payload as any; - console.log(payload.status); - gameStatusRegistry[gameId].value = parseStatus(payload.status); + gameStatusRegistry[id].value = parseStatus(payload.status); }); } } - const game = gameRegistry[gameId]; - const status = gameStatusRegistry[gameId]; + const game = gameRegistry[id]; + const status = gameStatusRegistry[id]; return { game, status }; -}; \ No newline at end of file +}; diff --git a/composables/generateGameMeta.ts b/composables/generateGameMeta.ts deleted file mode 100644 index fdfc4b7..0000000 --- a/composables/generateGameMeta.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { type DownloadableMetadata, DownloadableType } from '~/types' - -export default function generateGameMeta(gameId: string, version: string): DownloadableMetadata { - return { - id: gameId, - version, - downloadType: DownloadableType.Game - } -} \ No newline at end of file diff --git a/composables/state-navigation.ts b/composables/state-navigation.ts index 46d9e2b..f7a9b4b 100644 --- a/composables/state-navigation.ts +++ b/composables/state-navigation.ts @@ -48,7 +48,9 @@ export function initialNavigation(state: Ref) { switch (state.value.status) { case AppStatus.NotConfigured: - router.push({ path: "/setup" }); + router.push({ path: "/setup" }).then(() => { + console.log("Pushed Setup"); + }); break; case AppStatus.SignedOut: router.push("/auth"); diff --git a/gamepad.ts b/gamepad.ts new file mode 100644 index 0000000..5218db9 --- /dev/null +++ b/gamepad.ts @@ -0,0 +1,67 @@ +import gameControl, { XBoxButton, Button, type GCGamepad } from 'esm-gamecontroller.js'; + +let mainGamepad: Ref = ref(undefined); + +let buttonIndex = 0; +const buttons = computed((): any[] => { + let as = document.getElementsByTagName('a'); + let buttons = document.getElementsByTagName('button'); + return [].concat(Array.from(as)).concat(Array.from(buttons)); +}) + +const wrap = (num: number, min: number, max: number) => ((((num - min) % (max - min)) + (max - min)) % (max - min)) + min; + +setInterval(() => { + mainGamepad.value = navigator.getGamepads().filter(g => g !== null)[0]?.axes[1]; + console.log(navigator.getGamepads().filter(g => g !== null)[0]?.axes) + }, 100); + +watch(mainGamepad, (v) => { + console.log(v) + if (!v || v == 0) return; + buttonIndex = wrap(buttonIndex + v > 0 ? 1 : -1, 0, buttons.value.length); + + console.log(`Focusing ${buttonIndex}`) + console.log(buttons.value[buttonIndex]); + + buttons.value[buttonIndex].focus() +}) + + + +/* +setInterval(() => { + console.log(gamepads[0]); + console.log(gamepads[0].checkStatus()) +}, 1000); +*/ + +/* +window.ongamepadconnected = (e) => { + console.log("ongamepadconnected", e); +} + + +function selectButton(index: number) { + buttonIndex = (buttonIndex + index) % buttons.value.length; + console.log(`Selecting button ${buttonIndex}`); + buttons.value[buttonIndex].focus() +} + +function processGamepads() { + while (true) { + console.log("Processing gamepads"); + let gamepad = navigator.getGamepads()[0]; + if (!gamepad) continue; + let direction = gamepad.axes[1]; + if (direction > 0.1) { + selectButton(1) + console.log("Selecting button 1") + } + else if (direction < -0.1) { + selectButton(-1) + console.log("Selecting button -1") + } + } +} +*/ \ No newline at end of file diff --git a/layouts/default.vue b/layouts/default.vue index 025a7cf..89dd49b 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -1,7 +1,7 @@