Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions apps/oneclient/frontend/src/bindings.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ gallery: string[] }

export type SettingProfileModel = { name: string; java_id: number | null; res: Resolution | null; force_fullscreen: boolean | null; mem_max: number | null; launch_args: string | null; launch_env: string | null; hook_pre: string | null; hook_wrapper: string | null; hook_post: string | null; os_extra: SettingsOsExtra | null }

export type Settings = { global_game_settings: SettingProfileModel; allow_parallel_running_clusters: boolean; enable_gamemode: boolean; discord_enabled: boolean; seen_onboarding: boolean; mod_list_use_grid: boolean; max_concurrent_requests: number; settings_version: number; native_window_frame: boolean; show_tanstack_dev_tools: boolean }
export type Settings = { global_game_settings: SettingProfileModel; allow_parallel_running_clusters: boolean; enable_gamemode: boolean; discord_enabled: boolean; seen_onboarding: boolean; mod_list_use_grid: boolean; slow_mod_bulk_downloading: boolean; max_concurrent_requests: number; settings_version: number; native_window_frame: boolean; show_tanstack_dev_tools: boolean }

export type SettingsOsExtra = Record<string, never>

Expand Down Expand Up @@ -301,17 +301,8 @@ export type VersionType =
*/
"old_beta"

const ARGS_MAP = { 'oneclient':'{"openDevTools":[],"getVersions":[],"getBundlesFor":["cluster_id"],"getClustersGroupedByMajor":[]}', 'core':'{"open":["input"],"getPackageVersions":["provider","slug","mc_version","loader","offset","limit"],"changeSkin":["access_token","skin_url","skin_variant"],"writeSettings":["setting"],"launchCluster":["id","uuid"],"installModpack":["modpack","cluster_id"],"getUsersFromAuthor":["provider","author"],"downloadPackage":["provider","package_id","version_id","cluster_id","skip_compatibility"],"removeCape":["access_token"],"getUser":["uuid"],"getLogs":["id"],"readSettings":[],"removeCluster":["id"],"getClusterById":["id"],"getLogByName":["id","name"],"openMsaLogin":[],"isClusterRunning":["cluster_id"],"getUsers":[],"createSettingsProfile":["name"],"getRunningProcessesByClusterId":["cluster_id"],"createCluster":["options"],"getMultiplePackages":["provider","slugs"],"downloadExternalPackage":["package","cluster_id","force","skip_compatibility"],"getDefaultUser":["fallback"],"convertUsernameUUID":["username_uuid"],"getScreenshots":["id"],"getClusters":[],"updateClusterProfile":["name","profile"],"getLoadersForVersion":["mc_version"],"fetchLoggedInProfile":["access_token"],"fetchMinecraftProfile":["uuid"],"getProfileOrDefault":["name"],"updateClusterById":["id","request"],"getGameVersions":[],"setDefaultUser":["uuid"],"getGlobalProfile":[],"getWorlds":["id"],"getRunningProcesses":[],"removeUser":["uuid"],"killProcess":["pid"],"searchPackages":["provider","query"],"getPackage":["provider","slug"],"uploadSkinBytes":["access_token","skin_data","image_format","skin_variant"],"getPackageBody":["provider","body"],"changeCape":["access_token","cape_uuid"]}', 'folders':'{"fromCluster":["folder_name"],"openCluster":["folder_name"]}', 'events':'{"message":["event"],"ingress":["event"],"process":["event"]}' }
export type Router = { 'events': { ingress: (event: IngressPayload) => Promise<void>,
message: (event: MessagePayload) => Promise<void>,
process: (event: ProcessPayload) => Promise<void> },
'folders': { fromCluster: (folderName: string) => Promise<string>,
openCluster: (folderName: string) => Promise<null> },
'oneclient': { openDevTools: () => Promise<void>,
getClustersGroupedByMajor: () => Promise<Partial<{ [key in number]: ClusterModel[] }>>,
getBundlesFor: (clusterId: number) => Promise<ModpackArchive[]>,
getVersions: () => Promise<OnlineClusterManifest> },
'core': { getClusters: () => Promise<ClusterModel[]>,
const ARGS_MAP = { 'folders':'{"fromCluster":["folder_name"],"openCluster":["folder_name"]}', 'events':'{"process":["event"],"message":["event"],"ingress":["event"]}', 'core':'{"getWorlds":["id"],"getDefaultUser":["fallback"],"updateClusterProfile":["name","profile"],"searchPackages":["provider","query"],"fetchMinecraftProfile":["uuid"],"fetchLoggedInProfile":["access_token"],"removeCluster":["id"],"getPackageBody":["provider","body"],"updateClusterById":["id","request"],"getLoadersForVersion":["mc_version"],"getUsers":[],"killProcess":["pid"],"setDefaultUser":["uuid"],"downloadExternalPackage":["package","cluster_id","force","skip_compatibility"],"getPackageVersions":["provider","slug","mc_version","loader","offset","limit"],"getRunningProcessesByClusterId":["cluster_id"],"getUsersFromAuthor":["provider","author"],"changeSkin":["access_token","skin_url","skin_variant"],"removeCape":["access_token"],"convertUsernameUUID":["username_uuid"],"open":["input"],"getLogs":["id"],"getClusterById":["id"],"removeUser":["uuid"],"getClusters":[],"createSettingsProfile":["name"],"getUser":["uuid"],"downloadPackage":["provider","package_id","version_id","cluster_id","skip_compatibility"],"readSettings":[],"openMsaLogin":[],"launchCluster":["id","uuid"],"getLogByName":["id","name"],"uploadSkinBytes":["access_token","skin_data","image_format","skin_variant"],"createCluster":["options"],"installModpack":["modpack","cluster_id"],"getGlobalProfile":[],"getScreenshots":["id"],"getPackage":["provider","slug"],"isClusterRunning":["cluster_id"],"getMultiplePackages":["provider","slugs"],"changeCape":["access_token","cape_uuid"],"getProfileOrDefault":["name"],"getGameVersions":[],"writeSettings":["setting"],"getRunningProcesses":[]}', 'oneclient':'{"getVersions":[],"openDevTools":[],"getBundlesFor":["cluster_id"],"getClustersGroupedByMajor":[]}' }
export type Router = { 'core': { getClusters: () => Promise<ClusterModel[]>,
getClusterById: (id: number) => Promise<ClusterModel | null>,
removeCluster: (id: number) => Promise<null>,
createCluster: (options: CreateCluster) => Promise<ClusterModel>,
Expand Down Expand Up @@ -355,7 +346,16 @@ changeSkin: (accessToken: string, skinUrl: string, skinVariant: SkinVariant) =>
changeCape: (accessToken: string, capeUuid: string) => Promise<MojangFullPlayerProfile>,
removeCape: (accessToken: string) => Promise<MojangFullPlayerProfile>,
convertUsernameUUID: (usernameUuid: string) => Promise<MowojangProfile>,
open: (input: string) => Promise<null> } };
open: (input: string) => Promise<null> },
'oneclient': { openDevTools: () => Promise<void>,
getClustersGroupedByMajor: () => Promise<Partial<{ [key in number]: ClusterModel[] }>>,
getBundlesFor: (clusterId: number) => Promise<ModpackArchive[]>,
getVersions: () => Promise<OnlineClusterManifest> },
'events': { ingress: (event: IngressPayload) => Promise<void>,
message: (event: MessagePayload) => Promise<void>,
process: (event: ProcessPayload) => Promise<void> },
'folders': { fromCluster: (folderName: string) => Promise<string>,
openCluster: (folderName: string) => Promise<null> } };


export type { InferCommandOutput }
Expand Down
2 changes: 1 addition & 1 deletion apps/oneclient/frontend/src/components/Bundle/ModCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export function useModCardContext() {
export function ModCard({ file, cluster }: ModCardProps) {
const { showModDownloadButton, onClickOnMod, useVerticalGridLayout, mods } = useModCardContext();

const [modMetadata, setModMetadata] = useState<ModInfo>({ name: 'LOADING', description: null, author: null, iconURL: null, url: null, managed: false, packageSlug: null });
const [modMetadata, setModMetadata] = useState<ModInfo>({ name: 'Loading...', description: null, author: null, iconURL: null, url: null, managed: false, packageSlug: null });
useEffect(() => {
(async () => setModMetadata(await getModMetaData(file, useVerticalGridLayout)))();
}, [file, useVerticalGridLayout]);
Expand Down
2 changes: 1 addition & 1 deletion apps/oneclient/frontend/src/components/Bundle/ModList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Button, Tab, TabContent, TabList, TabPanel, Tabs } from '@onelauncher/c
import { Bundle, useModCardContext } from '.';

function getBundleName(name: string): string {
return (name.match(/\[(.*?)\]/)?.[1]) ?? 'LOADING';
return (name.match(/\[(.*?)\]/)?.[1]) ?? 'Loading...';
}

interface ModListProps {
Expand Down
37 changes: 27 additions & 10 deletions apps/oneclient/frontend/src/components/DownloadMods.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import { DialogTrigger } from 'react-aria-components';
import { getModMetaDataName } from './Bundle';
import { Overlay } from './overlay';
import { useSettings } from '@/hooks/useSettings';

Check failure on line 10 in apps/oneclient/frontend/src/components/DownloadMods.tsx

View workflow job for this annotation

GitHub Actions / ES Checks

Expected "@/hooks/useSettings" (external) to come before "./overlay" (sibling)

export interface DownloadModsRef {
openDownloadDialog: (nextPath?: string) => void;
Expand Down Expand Up @@ -119,28 +120,44 @@
continue;
const slug = dependency.project_id ?? '';
const versions = await bindings.core.getPackageVersions(mod.provider, slug, cluster.mc_version, cluster.mc_loader, 0, 1);
await bindings.core.downloadPackage(mod.provider, slug, versions.items[0].version_id, cluster.id, null);
if (versions.items.length !== 0)
await bindings.core.downloadPackage(mod.provider, slug, versions.items[0].version_id, cluster.id, null);
}
await bindings.core.downloadPackage(mod.provider, mod.id, mod.versionId, mod.clusterId, true);
}
else { await bindings.core.downloadExternalPackage(mod.package, mod.clusterId, null, null); }
});

const { setting } = useSettings();
let useSlowDownloading = setting('slow_mod_bulk_downloading');


Check failure on line 134 in apps/oneclient/frontend/src/components/DownloadMods.tsx

View workflow job for this annotation

GitHub Actions / ES Checks

More than 1 blank line not allowed
useEffect(() => {
const downloadAll = async () => {
await downloadModsParallel(mods, 25, async (mod) => {
setModName(mod.name);
try {
await download.mutateAsync(mod);
}
finally {
setDownloadedMods(prev => prev + 1);
}
});
if (useSlowDownloading)
for (const mod of mods) {
setModName(mod.name);
try {
await download.mutateAsync(mod);
}
finally {
setDownloadedMods(prev => prev + 1);
}
} else
await downloadModsParallel(mods, 25, async (mod) => {
setModName(mod.name);
try {
await download.mutateAsync(mod);
}
finally {
setDownloadedMods(prev => prev + 1);
}
});

Check failure on line 155 in apps/oneclient/frontend/src/components/DownloadMods.tsx

View workflow job for this annotation

GitHub Actions / ES Checks

Block must not be padded by blank lines

};

downloadAll();
}, [mods]);

Check warning on line 160 in apps/oneclient/frontend/src/components/DownloadMods.tsx

View workflow job for this annotation

GitHub Actions / ES Checks

React Hook useEffect has missing dependencies: 'download' and 'useSlowDownloading'. Either include them or remove the dependency array

useEffect(() => {
if (downloadedMods >= mods.length) {
Expand Down
12 changes: 11 additions & 1 deletion apps/oneclient/frontend/src/routes/app/settings/developer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { bindings } from '@/main';
import { Button } from '@onelauncher/common/components';
import { createFileRoute, Link } from '@tanstack/react-router';
import { BatteryFullIcon, Code02Icon, Truck01Icon } from '@untitled-theme/icons-react';
import { BatteryEmptyIcon, BatteryFullIcon, Code02Icon, Truck01Icon } from '@untitled-theme/icons-react';
import Sidebar from './route';

export const Route = createFileRoute('/app/settings/developer')({
Expand Down Expand Up @@ -60,6 +60,16 @@
<SettingsSwitch setting={createSetting('mod_list_use_grid')} />
</SettingsRow>


Check failure on line 63 in apps/oneclient/frontend/src/routes/app/settings/developer.tsx

View workflow job for this annotation

GitHub Actions / ES Checks

More than 1 blank line not allowed
<SettingsRow.Header>Mod Downloading</SettingsRow.Header>
<SettingsRow
description="Slow is sometimes better. This is more consistent but takes longer then someone having a god dam CHILD???"
icon={<BatteryEmptyIcon />}
title="Use Slow Mod Bulk Downloading"
>
<SettingsSwitch setting={createSetting('slow_mod_bulk_downloading')} />
</SettingsRow>

</div>
</Sidebar.Page>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
art={bundleData.art}
bundle={bundle}
clusterId={bundleData.clusterId}
fullVersionName={bundle.manifest.name.match(/\[(.*?)\]/)?.[1] ?? 'LOADING'}
fullVersionName={bundle.manifest.name.match(/\[(.*?)\]/)?.[1] ?? 'Loading...'}
key={bundle.manifest.name}
mods={modsPerCluster[bundleData.clusterId]}
setMods={newMods => setModsPerCluster(prev => ({ ...prev, [bundleData.clusterId]: typeof newMods === 'function' ? newMods(prev[bundleData.clusterId]) : newMods }))}
Expand Down Expand Up @@ -137,7 +137,7 @@
onClickOnMod,
useVerticalGridLayout: true,
mods,
}), [mods]);

Check warning on line 140 in apps/oneclient/frontend/src/routes/onboarding/preferences/versionCategory.tsx

View workflow job for this annotation

GitHub Actions / ES Checks

React Hook useMemo has a missing dependency: 'onClickOnMod'. Either include it or remove the dependency array

return (
<AriaButton className={twMerge('group cursor-pointer w-full rounded-xl transition-[outline] outline-2 hover:outline-brand', isSelected ? 'outline-brand' : 'outline-ghost-overlay')} onPress={handleDownload}>
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/store/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pub struct Settings {
pub discord_enabled: bool,
pub seen_onboarding: bool,
pub mod_list_use_grid: bool,
pub slow_mod_bulk_downloading: bool,
pub max_concurrent_requests: usize,
pub settings_version: u32,
pub native_window_frame: bool,
Expand All @@ -32,6 +33,7 @@ impl Default for Settings {
discord_enabled: false,
seen_onboarding: false,
mod_list_use_grid: true,
slow_mod_bulk_downloading: false,
enable_gamemode: false,
max_concurrent_requests: 25,
settings_version: 1,
Expand Down
Loading