From b442c6db089ad7f82b610922904a8b425fda011a Mon Sep 17 00:00:00 2001 From: Felix Rieseberg Date: Tue, 18 Feb 2025 22:49:52 -0800 Subject: [PATCH] Update UI --- src/renderer/app.tsx | 13 ++++- src/renderer/card-drive.tsx | 106 ------------------------------------ src/renderer/emulator.tsx | 12 ++-- src/renderer/start-menu.tsx | 4 -- static/drive.png | Bin 1899 -> 0 bytes 5 files changed, 16 insertions(+), 119 deletions(-) delete mode 100644 src/renderer/card-drive.tsx delete mode 100644 static/drive.png diff --git a/src/renderer/app.tsx b/src/renderer/app.tsx index 95bd110..5ff6b14 100644 --- a/src/renderer/app.tsx +++ b/src/renderer/app.tsx @@ -1,3 +1,12 @@ +export interface Win95Window extends Window { + emulator: any; + win95: { + app: App; + }; +} + +declare let window: Win95Window; + /** * The top-level class controlling the whole app. This is *not* a React component, * but it does eventually render all components. @@ -27,8 +36,8 @@ export class App { } } -window["win95"] = window["win95"] || { +window.win95 = window.win95 || { app: new App(), }; -window["win95"].app.setup(); +window.win95.app.setup(); diff --git a/src/renderer/card-drive.tsx b/src/renderer/card-drive.tsx deleted file mode 100644 index 8c927a7..0000000 --- a/src/renderer/card-drive.tsx +++ /dev/null @@ -1,106 +0,0 @@ -import * as React from "react"; - -interface CardDriveProps { - showDiskImage: () => void; -} - -interface CardDriveState {} - -export class CardDrive extends React.Component { - constructor(props: CardDriveProps) { - super(props); - - this.state = {}; - } - - public render() { - let advice: JSX.Element | null = null; - - if (process.platform === "win32") { - advice = this.renderAdviceWindows(); - } else if (process.platform === "darwin") { - advice = this.renderAdviceMac(); - } else { - advice = this.renderAdviceLinux(); - } - - return ( -
-
-
-

- - Modify C: Drive -

-
-
-

- windows95 (this app) uses a raw disk image. Windows 95 (the - operating system) is fragile, so adding or removing files is - risky. -

- {advice} -
-
-
- ); - } - - public renderAdviceWindows(): JSX.Element { - return ( -
- Changing the disk on Windows -

- Windows 10 cannot mount raw disk images (ironically, macOS and Linux - can). However, tools exist that let you mount this drive, like the - freeware tool{" "} - - OSFMount - - . I am not affiliated with it, so please use it at your own risk. -

- {this.renderMountButton("Windows Explorer")} -
- ); - } - - public renderAdviceMac(): JSX.Element { - return ( -
- Changing the disk on macOS -

- macOS can mount the disk image directly. Click the button below to see - the disk image in Finder. Then, double-click the image to mount it. -

- {this.renderMountButton("Finder")} -
- ); - } - - public renderAdviceLinux(): JSX.Element { - return ( -
- Changing the disk on Linux -

- There are plenty of tools that enable Linux users to mount and modify - disk images. The disk image used by windows95 is a raw "img" disk - image and can probably be mounted using the mount tool, - which is likely installed on your machine. -

- {this.renderMountButton("file viewer")} -
- ); - } - - public renderMountButton(explorer: string) { - return ( - - ); - } -} diff --git a/src/renderer/emulator.tsx b/src/renderer/emulator.tsx index 4102618..2d821fd 100644 --- a/src/renderer/emulator.tsx +++ b/src/renderer/emulator.tsx @@ -9,11 +9,13 @@ import { CardStart } from "./card-start"; import { StartMenu } from "./start-menu"; import { CardSettings } from "./card-settings"; import { EmulatorInfo } from "./emulator-info"; -import { CardDrive } from "./card-drive"; import { getStatePath } from "./utils/get-state-path"; +import { Win95Window } from "./app"; + +declare let window: Win95Window; export interface EmulatorState { - currentUiCard: string; + currentUiCard: "start" | "settings"; emulator?: any; scale: number; floppyFile?: File; @@ -200,8 +202,6 @@ export class Emulator extends React.Component<{}, EmulatorState> { cdrom={cdromFile} /> ); - } else if (currentUiCard === "drive") { - card = ; } else { card = ; } @@ -210,7 +210,7 @@ export class Emulator extends React.Component<{}, EmulatorState> { <> {card} this.setState({ currentUiCard: target })} + navigate={(target) => this.setState({ currentUiCard: target as "start" | "settings" })} /> ); @@ -308,8 +308,6 @@ export class Emulator extends React.Component<{}, EmulatorState> { } : undefined, boot_order: 0x132, - // One day, maybe! - // network_relay_url: "ws://localhost:8080/" }; console.log(`🚜 Starting emulator with options`, options); diff --git a/src/renderer/start-menu.tsx b/src/renderer/start-menu.tsx index b9b599e..b9b691c 100644 --- a/src/renderer/start-menu.tsx +++ b/src/renderer/start-menu.tsx @@ -28,10 +28,6 @@ export class StartMenu extends React.Component { Settings - - - Modify C: Drive - ); diff --git a/static/drive.png b/static/drive.png deleted file mode 100644 index 9150a0bc074574555af16b0253c10b2c667cccd4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1899 zcmY*Z2{;?r7EUN?=OLCdB4}wzh}t8lt!iIlD%#zESw`OY%B#8Ivs}}IvlwG-6WUNz!ZEu>zyr*oJuHQ;{|1fl&XX#RXMUk(mP_+ic)BQ@@vE`t(sL4wX}LIO(U;)=>hGD)Weu&? z3R2+9ih=k4sTRzl0XM2pBUga&dwGhcD?UH51D9I0&H7>SZSz4d9+Qwsx!91m8Vk>| zcu;QPS%qS>(Sc9aLi^f(Johhm2w$yTTKqk*BzmU2DQX@4xeV7Ema&a{Ts2-)hNP~e zefQ7ksC@z^nUBTssb*Q7HH2r~-8b4}yb1 zm$^iaibZfvfu8%vHqY$}$gfU|u2?ZQV>gMKrU`S=%=?vB%5hx#2MT}J;G11n{tB8+ zqem5J-yTP;+3VWYMGyh?XQQqWlrLJPVlVH?$CBh;2ok87oj#c z_l0`8OgG={Ll>?y0Cf43)FEZO%=lBjSssIJ>SXg&uR`8=is0*skMG#sd+^w#!-?hT zeo{S4Go?k}xU_q2o%|eW_N5LGnwtzPFQcHieFfJ60H8P4-HYtyU~d#ez(LW$gg^{5 z78k|&L;wIptP#h=VaRB3EG`mHGKw{Ue2p;T*hg*{1pGCG9AN_Sa&QJ)5QrGCF7zx^ z3xX5?gTV-5aEOtsrS63TglWNHaJVKXLX#AS zC!=FE@g(JMApgO!#E^oB*eEiVfCnGpq5}!hWD^MFi0DWAc26=kF>_9H~eF1nfuIkOKC7 zr@T2uuC}!_clY97^KfybYKbX$&_X_?1&^cC;w7c?O)~i@c_zi}%oA}f0ioO>R;FRi zql{8!LSkuiR^%E@YM8#@Nz-T9MHD}t`u%2WVZH+kaLKg$!i(r>L^pwSO;%U@I@pp0{VPw{a zs?HCce8Wm7)p(;MMYD52q1UbJ_#0?^3)&*tn-lSa1E8iJ!4FiC5>!ibia2dZ zrA>AmB5K>?W3JRIAC;fgYp7R9T|?eA3qa(R0vPI1%(0UdGCk>Bvhp4pwSHG@6uOBg z8aJv9qJ=ys8__P3TN`)YJ5qxiZGk<9%V7_5scEF!0_to$E%nKc4@l-w{D!c+%IgIn z4`8r-j?p9Gl&X7P1~~DmvgfELy96Bg|Is%xJj=Z&gS3V#_w=@C^rj9uHIEY-T4X5m fjhSsqaRL+otEEk2*+%Kj(et;pa