Skip to content

Commit

Permalink
Merge commit '6d0f6243bb79ddf1401d9e418d02ac9086dd4503'
Browse files Browse the repository at this point in the history
  • Loading branch information
LinLin00000000 committed Mar 16, 2024
2 parents 7fef20d + 6d0f624 commit 45dd65e
Show file tree
Hide file tree
Showing 15 changed files with 222 additions and 70 deletions.
Binary file modified public/maps/ground-zero-3d.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/maps/streets-2d.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/maps/streets-3d-caches.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/maps/streets-3d-lexos.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/maps/streets-3d.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/features/achievements/do-fetch-achievements.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ class AchievementsQuery extends APIQuery {
description
hidden
playersCompletedPercent
normalizedRarity
rarity
}
}`;

Expand Down
7 changes: 7 additions & 0 deletions src/pages/achievements/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.rare {
color: #8c6edf;
}

.legendary {
color: #ffe084;
}
51 changes: 40 additions & 11 deletions src/pages/achievements/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ import DataTable from '../../components/data-table/index.js';

import useAchievementsData from '../../features/achievements/index.js';

import './index.css';

const raritySort = {
"common": 0,
"rare": 1,
"legendary": 2
}

function Achievements() {
const { t } = useTranslation();

Expand All @@ -23,21 +31,17 @@ function Achievements() {
() => [
{
Header: () => (
<div
style={{
textAlign:'left'
}}
>{t('Name')}</div>),
<div style={{textAlign:'left', paddingLeft:'10px'}}>
{t('Name')}
</div>),
id: 'name',
accessor: 'name',
},
{
Header: () => (
<div
style={{
textAlign:'left'
}}
>{t('Description')}</div>),
<div style={{textAlign:'left', paddingLeft:'10px'}}>
{t('Description')}
</div>),
id: 'description',
accessor: 'description',
},
Expand All @@ -51,7 +55,12 @@ function Achievements() {
);
},
sortType: (rowA, rowB) => {
return (+ rowA.values.hidden) - (+ rowB.values.hidden);
let rowAhidden = rowA.original.hidden ? 1 : 0
let rowBhidden = rowB.original.hidden ? 1 : 0
if (rowAhidden === rowBhidden) {
return rowB.original.playersCompletedPercent - rowA.original.playersCompletedPercent
}
return rowAhidden - rowBhidden;
},
},
{
Expand All @@ -66,6 +75,26 @@ function Achievements() {
);
},
},
{
Header: t('Rarity'),
id: 'rarity',
accessor: 'rarity',
Cell: (props) => {
return (
<div className={`center-content ${props.row.original.normalizedRarity}`}>
{props.value}
</div>
);
},
sortType: (rowA, rowB) => {
let rowAr = raritySort[rowA.original.normalizedRarity];
let rowBr = raritySort[rowB.original.normalizedRarity];
if (rowAr === rowBr) {
return rowB.original.playersCompletedPercent - rowA.original.playersCompletedPercent
}
return rowAr - rowBr;
},
}
],
[t],
);
Expand Down
7 changes: 6 additions & 1 deletion src/pages/bitcoin-farm-calculator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import StationSkillTraderSetting from '../../components/station-skill-trader-set

import formatPrice from '../../modules/format-price.js';
import { averageWipeLength, currentWipeLength } from '../../modules/wipe-length.js';
import useHideoutData from '../../features/hideout/index.js';

import {
BitcoinItemId,
Expand All @@ -32,6 +33,9 @@ import './index.css';
const BitcoinFarmCalculator = () => {
const { t } = useTranslation();

const { data: hideout } = useHideoutData();
const solar = hideout.find(station => station.normalizedName === 'solar-power');

const [graphicCardsCount, setGraphicCardsCount] = useStateWithLocalStorage(
'num-graphic-cards',
MaxNumGraphicsCards,
Expand Down Expand Up @@ -110,8 +114,9 @@ const BitcoinFarmCalculator = () => {
type="skill"
/>
<StationSkillTraderSetting
stateKey={'solar-power'}
stateKey={solar.normalizedName}
type="station"
image={solar.imageLink}
/>
<ToggleFilter
label={t('Use fuel cost: {{price}}/day', {
Expand Down
8 changes: 8 additions & 0 deletions src/pages/player/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,11 @@ ul.favorite-item-list li {
display: inline-block;
padding-left: 2px;
}

.rare {
color: #8c6edf;
}

.legendary {
color: #ffe084;
}
Loading

0 comments on commit 45dd65e

Please sign in to comment.