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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

### Launcher
- Added icons to the Settings tabs

## 0.14.1 (build R: Raccoon Hotfix a1)

**Update:** press **Update** in the launcher. No **Set up again** needed.
Expand Down
2 changes: 1 addition & 1 deletion CREDITS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Credits

Parent project: [pokopia-native](https://github.com/xFractals/pokopia-native) (MIT; its `ampere-lower/` is GPL-3.0-or-later), whose updates this project follows. Built on [nxrecomp](https://github.com/drakolordx7/nxrecomp). Uses code from [Ryujinx](https://github.com/Ryubing/Ryujinx), [Mesa](https://gitlab.freedesktop.org/mesa/mesa), [pokopia-native](https://github.com/xFractals/pokopia-native), smo-recomp, ScarletNX, ssbu-recomp, SuperMarioWonderRecomp, yuzu, Eden, libnx, [astc-encoder](https://github.com/ARM-software/astc-encoder), [bc7enc_rdo](https://github.com/richgel999/bc7enc_rdo), [libvpx](https://chromium.googlesource.com/webm/libvpx), AMD FidelityFX, NVIDIA Image Scaling, [SDL3](https://github.com/libsdl-org/SDL), [Tauri](https://tauri.app), [Zig](https://ziglang.org) and Python, plus [Kenney input prompts](https://kenney.nl/assets/input-prompts), DejaVu fonts, and in the launcher [Inter](https://rsms.me/inter/) (SIL OFL 1.1) and [Lucide](https://lucide.dev) icons (ISC). Mods run on [Modtopia](runtime/third_party/modtopia) by the pokopia-native team (MIT). The Pokémon cap mod (`runtime/games/pkp/core/pkp_pokemon_cap.cpp`) ports the default behaviour of the Eglantine cap, and the account id token answers (`runtime/src/services/acc.cpp`) follow Lichii / Eglantine (GPL-3.0, yuzu family). Design ideas (no code) from totk-pc-recomp (shadow storage for guest memory), ultratears (memory pool copies), pokopia-native (uniform data copied into video memory when a draw binds it; sparse pool copies bound in 2 MB granules) and [seedds/nxnative](https://github.com/seedds/nxnative) (MIT; Ampere shader layout notes, texture swizzle and NVN key findings).
Parent project: [pokopia-native](https://github.com/xFractals/pokopia-native) (MIT; its `ampere-lower/` is GPL-3.0-or-later), whose updates this project follows. Built on [nxrecomp](https://github.com/drakolordx7/nxrecomp). Uses code from [Ryujinx](https://github.com/Ryubing/Ryujinx), [Mesa](https://gitlab.freedesktop.org/mesa/mesa), [pokopia-native](https://github.com/xFractals/pokopia-native), smo-recomp, ScarletNX, ssbu-recomp, SuperMarioWonderRecomp, yuzu, Eden, libnx, [astc-encoder](https://github.com/ARM-software/astc-encoder), [bc7enc_rdo](https://github.com/richgel999/bc7enc_rdo), [libvpx](https://chromium.googlesource.com/webm/libvpx), AMD FidelityFX, NVIDIA Image Scaling, [SDL3](https://github.com/libsdl-org/SDL), [Tauri](https://tauri.app), [Zig](https://ziglang.org) and Python, plus [Kenney input prompts](https://kenney.nl/assets/input-prompts), DejaVu fonts, and in the launcher [Inter](https://rsms.me/inter/) (SIL OFL 1.1) [Lucide](https://lucide.dev) icons (ISC) and [Font Awesome Free](https://fontawesome.com) icons by Fonticons, Inc. (CC BY 4.0). Mods run on [Modtopia](runtime/third_party/modtopia) by the pokopia-native team (MIT). The Pokémon cap mod (`runtime/games/pkp/core/pkp_pokemon_cap.cpp`) ports the default behaviour of the Eglantine cap, and the account id token answers (`runtime/src/services/acc.cpp`) follow Lichii / Eglantine (GPL-3.0, yuzu family). Design ideas (no code) from totk-pc-recomp (shadow storage for guest memory), ultratears (memory pool copies), pokopia-native (uniform data copied into video memory when a draw binds it; sparse pool copies bound in 2 MB granules) and [seedds/nxnative](https://github.com/seedds/nxnative) (MIT; Ampere shader layout notes, texture swizzle and NVN key findings).

The macOS port draws on [PokoMac](https://github.com/Chaos192/PokoMac) by Chaos192 (GPL-3.0), the Apple-silicon port of this project: the native Linux and macOS environment ([#562](https://github.com/Dittobyte/Recompia/pull/562)) follows its Win32-over-POSIX layer (`runtime/src/os/`), and the macOS tuning in commit `72e2221` (ARMv8 SHA-1 for the shader cache key, LDAR/STLR ordering, `VK_KHR_portability_*`, 16 KiB write tracking, pool mirrors off, the Metal shader-cache identity, the frame limit through loading, vsync on by default) comes from it. See `docs/macos-optimisations.md`.

Expand Down
22 changes: 22 additions & 0 deletions launcher/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions launcher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
},
"dependencies": {
"@fontsource-variable/inter": "^5.3.0",
"@fortawesome/free-solid-svg-icons": "^7.3.1",
"@tauri-apps/api": "^2.12.4",
"lucide": "^1.66.0"
}
Expand Down
3 changes: 3 additions & 0 deletions launcher/src/components.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ body.pad-nav .slider input:focus::-webkit-slider-thumb { outline: 3px solid var(
stroke-linecap: round;
stroke-linejoin: round;
}
.icon.fa { fill: currentColor; stroke: none; }
.i-play { fill: currentColor; }
.spin { animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
Expand Down Expand Up @@ -403,6 +404,8 @@ button.chip:hover { background: var(--surface-3); }
transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.seg input:hover:not(:checked):not(:disabled) + span { color: var(--color-text); }
.seg span .icon { width: var(--icon-sm); height: var(--icon-sm); margin-right: 7px; }
.seg input:checked + span .icon { color: var(--color-accent); }
.seg input:checked + span { background: var(--surface-3); color: var(--color-text); box-shadow: var(--glass-highlight), var(--shadow-sm); }
.seg input:focus-visible + span { outline: 2px solid var(--color-focus); outline-offset: 1px; }
.seg input:disabled + span { color: var(--color-text-3); }
Expand Down
4 changes: 2 additions & 2 deletions launcher/src/pages/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import './settings.css';
import { api } from '../api.js';
import { setLanguage, t } from '../i18n.js';
import { errText, esc, segmented, toast } from '../ui.js';
import { errText, esc, faIcon, segmented, toast } from '../ui.js';
import { store } from '../store.js';
import { SECTIONS } from '../settings-schema.js';
import { createState, env, rememberSection } from './settings/state.js';
Expand Down Expand Up @@ -38,7 +38,7 @@ export async function render(el, ctx) {
<h1>${esc(t('Settings'))}</h1>
<span class="set-saved" id="set-saved" role="status"></span>
</div>
<div class="set-pills">${segmented('section', SECTIONS.map((s) => ({ value: s.id, label: s.label })), st.section, { label: t('Settings section') })}</div>
<div class="set-pills">${segmented('section', SECTIONS.map((s) => ({ value: s.id, label: s.label, icon: faIcon(s.icon) })), st.section, { label: t('Settings section') })}</div>
<div class="set-body" id="set-body"></div>
</div>`;

Expand Down
8 changes: 8 additions & 0 deletions launcher/src/settings-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// A source is { pkp, controls, config, controls_exists }: read_settings' `section.key` maps plus get_config.
// An edit is { file, section, key, value }. file 'pkp' and 'controls' go to write_settings, 'config' to save_config.
//
// A section: { id, icon (a Font Awesome solid name for faIcon), label, groups }.
// Field: { id, label, type, at, def, options, min, max, step, suffix, ... }
// type segmented | select | choice | size | toggle | slider | path | clock
// at where it lives: controls(), pkp() or config(); an array when it has two keys
Expand Down Expand Up @@ -362,6 +363,7 @@ export const IMPORT_FACTS = t('Your current save moves to a backup folder first,
export const SECTIONS = [
{
id: 'display',
icon: 'display',
label: t('Display'),
groups: [
{
Expand Down Expand Up @@ -417,6 +419,7 @@ export const SECTIONS = [
},
{
id: 'graphics',
icon: 'wand-magic-sparkles',
label: t('Graphics'),
groups: [
{
Expand Down Expand Up @@ -469,6 +472,7 @@ export const SECTIONS = [
},
{
id: 'audio',
icon: 'volume-high',
label: t('Audio'),
groups: [
{
Expand All @@ -485,6 +489,7 @@ export const SECTIONS = [
},
{
id: 'controls',
icon: 'gamepad',
label: t('Controls'),
groups: [
{
Expand Down Expand Up @@ -530,6 +535,7 @@ export const SECTIONS = [
},
{
id: 'saves',
icon: 'floppy-disk',
label: t('Saves'),
groups: [
{
Expand Down Expand Up @@ -609,6 +615,7 @@ export const SECTIONS = [
},
{
id: 'game',
icon: 'sliders',
label: t('Game'),
groups: [
{
Expand Down Expand Up @@ -740,6 +747,7 @@ export const SECTIONS = [
},
{
id: 'about',
icon: 'circle-info',
label: t('About'),
groups: [
{
Expand Down
21 changes: 19 additions & 2 deletions launcher/src/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import {
Folder, FolderOpen, Gamepad2, Globe, HardDrive, House, Info, Keyboard, Link, LoaderCircle, Lock, LockOpen, Minus, Mouse, Newspaper, Palette, Pause,
Pencil, Play, Plus, Puzzle, RefreshCw, RotateCcw, Save, Settings, Square, Trash2, TriangleAlert, Trophy, Upload, UserCheck, Users, Wrench, X,
} from 'lucide';
import {
faCircleInfo, faDisplay, faFloppyDisk, faGamepad, faSliders, faVolumeHigh, faWandMagicSparkles,
} from '@fortawesome/free-solid-svg-icons';

const ICONS = {
ArrowDown, ArrowLeft, ArrowUp, Check, ChevronDown, ChevronRight, CircleAlert, CircleCheck, CircleX, Clock, Copy, Download, ExternalLink, Eye, EyeOff, FileArchive, FileText,
Expand Down Expand Up @@ -38,6 +41,20 @@ export function icon(name, cls = '') {
return `<svg class="icon i-${name} ${cls}" viewBox="0 0 24 24" aria-hidden="true">${parts}</svg>`;
}

const FA_ICONS = { faCircleInfo, faDisplay, faFloppyDisk, faGamepad, faSliders, faVolumeHigh, faWandMagicSparkles };

/** Finished SVG markup for a Font Awesome solid icon by kebab name ("floppy-disk"). A new name is added to the import list above. */
export function faIcon(name, cls = '') {
const def = FA_ICONS[`fa${pascal(name)}`];
if (!def) {
if (import.meta.env?.DEV) console.warn(`Font Awesome icon "${name}" is not in ui.js`);
return '';
}
const [w, h, , , path] = def.icon;
const paths = (Array.isArray(path) ? path : [path]).map((d) => `<path d="${d}"/>`).join('');
return `<svg class="icon fa i-${name} ${cls}" viewBox="0 0 ${w} ${h}" aria-hidden="true">${paths}</svg>`;
}

const MAX_TOASTS = 3;

/** Short status message. kind: '' | 'ok' | 'error' (errors stay longer and are announced at once). */
Expand Down Expand Up @@ -157,11 +174,11 @@ export function group(title, rows) {
</section>`;
}

/** Pill radio group: read it with a `change` listener, e.target.name / e.target.value. */
/** Pill radio group: read it with a `change` listener, e.target.name / e.target.value. An option's `icon` is SVG markup (icon() / faIcon()) before its label. */
export function segmented(name, opts, value, { label = '', disabled = false } = {}) {
const items = opts.map(optionOf).map((o) => `<label>
<input type="radio" name="${esc(name)}" value="${esc(o.value)}" ${String(o.value) === String(value) ? 'checked' : ''} ${disabled || o.disabled ? 'disabled' : ''} />
<span>${esc(o.label)}</span>
<span>${o.icon ?? ''}${esc(o.label)}</span>
</label>`);
return `<div class="seg" role="radiogroup" ${named(label)}>${items.join('')}</div>`;
}
Expand Down
Loading