Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
6c88705
feat: button in top bar
0xhank Oct 3, 2022
e919b23
feat: extract silver button
0xhank Oct 3, 2022
72907c7
feat: minor dummy tweaks
0xhank Oct 4, 2022
c4d0ece
test file
cha0sg0d Sep 20, 2022
c081680
feat: load SolidStateERC1155
Sep 23, 2022
c0dabba
temp: noodling around
Sep 23, 2022
45d985e
test: working mint and uri tests
Sep 24, 2022
7ab7ddd
chore: comment
Sep 24, 2022
6e30e94
feat: sample bit pack
Sep 25, 2022
5984695
feat: not working artifact refactor
Sep 27, 2022
3fa771e
temp: working artifact activate and deactivate
Sep 27, 2022
d8a6ca7
test: some test starting to work:
Sep 27, 2022
b343572
feat: all artifact tests passing (no photoid or planetary shield)
Sep 28, 2022
0f75db8
move tests work almost but need to totally redo spaceships
Sep 28, 2022
8523cc1
feat: spaceships work
Sep 28, 2022
8af4bce
feat: all tests pass + photoid. Need crescent and planetary shield th…
Sep 28, 2022
1927409
failing test :(
Sep 28, 2022
d0b6fe7
feat: crescent test
Sep 29, 2022
44db267
feat: shield test passes
Sep 29, 2022
1023e7f
fix: clean up tests a bit
Sep 29, 2022
15b3041
feat: prevent spaceship transfer
Sep 29, 2022
a2b4bef
feat: bye bye DFToken
Sep 29, 2022
ce284d8
feat: Readme
Sep 29, 2022
4db8a7f
clean
Sep 29, 2022
cf20e4c
the nice nice cleanup
Sep 29, 2022
86592f0
clean
Sep 29, 2022
9731bfb
clean
Sep 29, 2022
8cb3590
remove more data structures
Sep 29, 2022
a8acca5
feat: give artifacts unique ids for getter purposes
Sep 29, 2022
aca886e
feat: encode / decode works, need to thread through
Sep 29, 2022
8e96b87
rename collection type
Sep 30, 2022
9545d21
feat: tests pass with spaceships as separate entities
Sep 30, 2022
af64dce
spaceship type
Sep 30, 2022
cbf87ab
fix: photoid test
Sep 30, 2022
76fec8d
update types and readme
Oct 1, 2022
51c8d78
chore: move functions that can be internal into LibArtifact and LibSp…
Oct 1, 2022
c35263e
Apply tweaks from code reivew
cha0sg0d Oct 3, 2022
3354102
More tweaks
cha0sg0d Oct 3, 2022
b8eb16d
fix: return when found in getter
Oct 3, 2022
43c53ac
README tweaks
cha0sg0d Oct 3, 2022
289c9e5
feat: explain chunk properties in README
Oct 3, 2022
c47180c
fix: ordering of args for artifact events
Oct 3, 2022
b682fef
fix: split up getActiveArtifact into two checks
Oct 3, 2022
84f35a6
fix: remove @solidstate/spec
Oct 3, 2022
6ddc29a
feat: create for Spaceship and Artifact
Oct 3, 2022
fefef35
feat: simply business logic bc of asserts in token create
Oct 3, 2022
ec15fd5
Store artifact information on contract planets (#28)
phated Oct 3, 2022
4692d40
More 1155 changes (#33)
phated Oct 4, 2022
2beac0f
Cha0s/erc1155 ctd (#34)
cha0sg0d Oct 4, 2022
20d8834
fix: bye bye spaceship zero moves (#35)
cha0sg0d Oct 4, 2022
72c355d
feat: ERC1155 clientside changes (#27)
phated Oct 5, 2022
e505c7f
feat: extract all button withdraws silver
0xhank Oct 5, 2022
23f3e3e
rebase: removed breaking peripheral client changes
0xhank Oct 5, 2022
f045857
merge devcon
Oct 5, 2022
e0aea07
merge conflict clean
Oct 5, 2022
f50b0b3
remove conflict
Oct 5, 2022
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: 0 additions & 3 deletions client/src/Backend/GameLogic/GameManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2442,9 +2442,6 @@ class GameManager extends EventEmitter {
if (!planet) {
throw new Error('tried to withdraw silver from an unknown planet');
}
if (planet.planetType !== PlanetType.TRADING_POST) {
throw new Error('can only withdraw silver from spacetime rips');
}
if (planet.owner !== this.account) {
throw new Error('can only withdraw silver from a planet you own');
}
Expand Down
10 changes: 0 additions & 10 deletions client/src/Backend/GameLogic/GameUIManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,16 +398,6 @@ class GameUIManager extends EventEmitter {
}

public withdrawSilver(locationId: LocationId, amount: number) {
const dontShowWarningStorageKey = `${this.getAccount()?.toLowerCase()}-withdrawnWarningAcked`;

if (localStorage.getItem(dontShowWarningStorageKey) !== 'true') {
localStorage.setItem(dontShowWarningStorageKey, 'true');
const confirmationText =
`Are you sure you want withdraw this silver? Once you withdraw it, you ` +
`cannot deposit it again. Your withdrawn silver amount will be added to your score. You'll only see this warning once!`;
if (!confirm(confirmationText)) return;
}

this.gameManager.withdrawSilver(locationId, amount);
}

Expand Down
119 changes: 59 additions & 60 deletions client/src/Frontend/Components/CapturePlanetButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,68 +117,67 @@ export function CapturePlanetButton({
gameManager.capturePlanet(planetWrapper.value.locationId);
}, [gameManager, planetWrapper]);

if (!shouldShow) return <></>;
return (
<StyledRow>
{shouldShow && (
<>
{shouldShowInvade && (
<MaybeShortcutButton
className='button'
size='stretch'
active={invading}
disabled={!invadable || invading}
onClick={invade}
onShortcutPressed={invade}
shortcutKey={INVADE}
shortcutText={INVADE}
shouldShow && (
<StyledRow>
{shouldShowInvade && (
<MaybeShortcutButton
className='button'
size='stretch'
active={invading}
disabled={!invadable || invading}
onClick={invade}
onShortcutPressed={invade}
shortcutKey={INVADE}
shortcutText={INVADE}
>
<TooltipTrigger
style={{ width: '100%', textAlign: 'center' }}
name={TooltipName.Empty}
extraContent={<>Invade this planet. </>}
>
<TooltipTrigger
style={{ width: '100%', textAlign: 'center' }}
name={TooltipName.Empty}
extraContent={<>Invade this planet. </>}
>
{invading ? <LoadingSpinner initialText={'Invading...'} /> : 'Invade'}
</TooltipTrigger>
</MaybeShortcutButton>
)}

{shouldShowCapture && (
<ShortcutBtn
className='button'
size='stretch'
active={capturing}
disabled={!capturable || capturing}
onClick={capture}
onShortcutPressed={capture}
shortcutKey={INVADE}
shortcutText={INVADE}
{invading ? <LoadingSpinner initialText={'Invading...'} /> : 'Invade'}
</TooltipTrigger>
</MaybeShortcutButton>
)}

{shouldShowCapture && (
<ShortcutBtn
className='button'
size='stretch'
active={capturing}
disabled={!capturable || capturing}
onClick={capture}
onShortcutPressed={capture}
shortcutKey={INVADE}
shortcutText={INVADE}
>
<TooltipTrigger
style={{ width: '100%', textAlign: 'center' }}
name={TooltipName.Empty}
extraContent={
<>
<Green>
Capture this planet for score!{' '}
{!!blocksLeft && blocksLeft >= 0 && (
<>
You must wait <White>{blocksLeft}</White> blocks until you can capture this
planet.
</>
)}
{!planetHasEnoughEnergy && (
<Red>The planet requires above 80% energy before you can capture it.</Red>
)}
</Green>
</>
}
>
<TooltipTrigger
style={{ width: '100%', textAlign: 'center' }}
name={TooltipName.Empty}
extraContent={
<>
<Green>
Capture this planet for score!{' '}
{!!blocksLeft && blocksLeft >= 0 && (
<>
You must wait <White>{blocksLeft}</White> blocks until you can capture
this planet.
</>
)}
{!planetHasEnoughEnergy && (
<Red>The planet requires above 80% energy before you can capture it.</Red>
)}
</Green>
</>
}
>
{capturing ? <LoadingSpinner initialText={'Capturing...'} /> : 'Capture!'}
</TooltipTrigger>
</ShortcutBtn>
)}
</>
)}
</StyledRow>
{capturing ? <LoadingSpinner initialText={'Capturing...'} /> : 'Capture!'}
</TooltipTrigger>
</ShortcutBtn>
)}
</StyledRow>
)
);
}
2 changes: 1 addition & 1 deletion client/src/Frontend/Components/OpenPaneButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export function OpenPlanetInfoButton({
return (
<OpenPaneButton
modal={modal}
title='Info'
title='More Info'
shortcut={TOGGLE_PLANET_INFO_PANE}
element={() => <PlanetInfoPane initialPlanetId={planetId} />}
helpContent={PlanetInfoHelpContent()}
Expand Down
11 changes: 1 addition & 10 deletions client/src/Frontend/Panes/PlanetContextPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import { CapturePlanetButton } from '../Components/CapturePlanetButton';
import { VerticalSplit } from '../Components/CoreUI';
import { MineArtifactButton } from '../Components/MineArtifactButton';
import {
OpenBroadcastPaneButton,
OpenHatPaneButton,
OpenManagePlanetInventoryButton,
OpenPlanetInfoButton,
OpenUpgradeDetailsPaneButton,
Expand Down Expand Up @@ -53,15 +51,10 @@ function PlanetContextPaneContent({
}

let upgradeRow = null;
if (!p?.destroyed && owned) {
if (!p?.destroyed && owned && p?.planetType == PlanetType.PLANET) {
upgradeRow = <OpenUpgradeDetailsPaneButton modal={modal} planetId={p?.locationId} />;
}

let hatRow = null;
if (!p?.destroyed && owned) {
hatRow = <OpenHatPaneButton modal={modal} planetId={p?.locationId} />;
}

let withdrawRow = null;
if (!p?.destroyed && owned && p?.planetType === PlanetType.TRADING_POST) {
withdrawRow = <WithdrawSilver wrapper={planet} />;
Expand All @@ -86,12 +79,10 @@ function PlanetContextPaneContent({
<VerticalSplit>
<>
{upgradeRow}
<OpenBroadcastPaneButton modal={modal} planetId={p?.locationId} />
<OpenPlanetInfoButton modal={modal} planetId={p?.locationId} />
</>
<>
<OpenManagePlanetInventoryButton modal={modal} planetId={p?.locationId} />
{hatRow}
</>
</VerticalSplit>
{withdrawRow}
Expand Down
1 change: 1 addition & 0 deletions client/src/Frontend/Utils/ShortcutConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const TOGGLE_TRANSACTIONS_PANE = "'";
export const TOGGLE_PLANET_INVENTORY_PANE = 's';
export const TOGGLE_HAT_PANE = 'x';
export const TOGGLE_ABANDON = 'r';
export const TOGGLE_WITHDRAW = ']';
export const INVADE = 'y';
export const MINE_ARTIFACT = 'f';
export const TOGGLE_BROADCAST_PANE = 'z';
Expand Down
33 changes: 20 additions & 13 deletions client/src/Frontend/Views/ArtifactRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,25 @@ export function SelectArtifactRow({
artifacts: Artifact[];
}) {
return (
<RowWrapper>
{artifacts.length > 0 &&
artifacts.map((a) => (
<span key={a.id}>
<ArtifactThumb
artifact={a}
selectedArtifact={selectedArtifact}
onArtifactChange={onArtifactChange}
/>
<Spacer width={4} />
</span>
))}
</RowWrapper>
<div
style={{
display: 'flex',
justifyContent: 'space-between',
}}
>
<RowWrapper>
{artifacts.length > 0 &&
artifacts.map((a) => (
<span key={a.id}>
<ArtifactThumb
artifact={a}
selectedArtifact={selectedArtifact}
onArtifactChange={onArtifactChange}
/>
<Spacer width={4} />
</span>
))}
</RowWrapper>
</div>
);
}
Loading