Skip to content

Commit

Permalink
feat: Zariman Cycle (#1173)
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiTenno authored Feb 20, 2024
1 parent 2a76b0e commit 78e0063
Show file tree
Hide file tree
Showing 20 changed files with 148 additions and 65 deletions.
103 changes: 64 additions & 39 deletions components/panels/AggregatedTimePanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,29 @@ import { cdn, wfcdn, optimize } from '@/services/utilities.js';

dayjs.extend(utc);

const corpus = cdn('svg/factions/corpus.svg');
const corrupted = cdn('svg/factions/corrupted.svg');
const grineer = cdn('svg/factions/grineer.svg');
const infested = cdn('svg/factions/infested.svg');
const sentient = cdn('svg/factions/sentient.svg');
const steelPath = cdn('svg/sp-logo.svg');
const steelEssence = optimize(wfcdn('steel-essence.png'), '250x250', 'fill', 'center');

const fImg = {
corpus,
grineer,
infested,
infestation: infested,
corrupted,
orokin: corrupted,
sentient,
};

const cycleDefault = {
activation: '0',
expiry: '0',
isWarm: true,
active: 'Fass',
active: 'Loading...',
isDay: true,
state: 'Loading...',
};

const textStyle = {
'text-transform': 'capitalize',
};

const fontStyle = {
...textStyle,
position: 'relative',
top: '2.5px',
left: '5px',
};

const EarthTimer = {
props: ['earthCycle'],
computed: {
Expand Down Expand Up @@ -203,18 +196,21 @@ const ResetTimer = {
};
const AnomalyTimer = {
props: ['sentientOutposts'],
computed: {},
computed: {
label() {
return this.$t('factions.sentient') + ' | ' + this.$t('sentientoutpost.warn');
},
},
render() {
return (
<div class="col-sm-3 my-3 text-center">
<span style={textStyle}>{this.$t('sentientoutpost.header')}</span>
<HubImg
id="para_tooltip"
src={sentient}
name={this.$t('factions.sentient') + ' | ' + this.$t('sentientoutpost.warn')}
width="20px"
height="20px"
class="invert pl-1"
<i
class={'icon-factions-sentient fa-lg'}
style={{ ...fontStyle }}
aria-label={this.label}
name={this.label}
alt={this.label}
/>
<br />
<b>{this.sentientOutposts.mission.node}</b>
Expand All @@ -234,8 +230,12 @@ const SteelPathTimer = {
src={steelPath}
name={this.$t('steelPath.header')}
class="li-mission-decorator li-mission-decorator-lg invert mx-1"
height="20px"
width="20px"
height="12.5px"
width="12.5px"
style={{
position: 'relative',
top: '-1.5px',
}}
/>
<br />
<span style="font-size: 0.85em">
Expand All @@ -244,6 +244,7 @@ const SteelPathTimer = {
<br />
{this.steelPath?.currentReward?.cost}
<HubImg src={steelEssence} name={this.$t('currency.steelEssense')} />
<br />
<TimeBadge
starttime={this.steelPath?.activation || '0'}
endtime={this.steelPath?.expiry || '0'}
Expand All @@ -257,24 +258,15 @@ const SteelPathTimer = {
const ArbitrationTimer = {
props: ['arbitration'],
computed: {
factionImg() {
if (this.arbitration?.enemy) {
return fImg[this.arbitration?.enemy?.toLowerCase()] || corrupted;
}
return corrupted;
enemy() {
return this.arbitration?.enemy?.toLowerCase() || 'corrupted';
},
},
render() {
return (
<div class="col-sm-3 my-3">
<span style={textStyle}>{this.$t('arbitration.header')}</span>
<HubImg
src={this.factionImg}
name={this.arbitration.enemy}
class="li-mission-decorator li-mission-decorator-lg"
height="20px"
width="20px"
/>
<i class={`icon-factions-${this.enemy}`} style={{ ...fontStyle }} />
<br />
<b>{this.arbitration.node}</b>
<br />
Expand All @@ -289,7 +281,38 @@ const ArbitrationTimer = {
);
},
};

const ZarimanTimer = {
props: ['zarimanCycle'],
computed: {
isZarimanCorpus() {
return this.zarimanCycle.state === 'corpus';
},
isZarimanGrineer() {
return this.zarimanCycle.state === 'grineer';
},
},
render() {
return (
<div class="col-sm-3 my-3">
<span style={textStyle}>
{this.$t(`location.zariman`)}
<br />
{this.isZarimanCorpus && <i class="fa-2x icon-factions-corpus" style={{ ...fontStyle, left: '0' }}></i>}
{this.isZarimanGrineer && <i class="fa-2x icon-factions-grineer" style={{ ...fontStyle, left: '0' }}></i>}
<br />
{this.$t(`time.${this.zarimanCycle.state.toLowerCase()}`)}
</span>
<br />
<TimeBadge
starttime={this.zarimanCycle.activation || this.now}
endtime={this.zarimanCycle.expiry}
interval={1000}
pullright={false}
/>
</div>
);
},
};
export default {
name: 'AggregatedTimePanel',
props: {
Expand All @@ -299,6 +322,7 @@ export default {
cetusCycle: cycleDefault,
earthCycle: cycleDefault,
cambionCycle: cycleDefault,
zarimanCycle: cycleDefault,
sentientOutposts: {},
steelPath: {
activation: 0,
Expand Down Expand Up @@ -350,6 +374,7 @@ export default {
{this.isArbitrationActive && this.componentState.arbitration.display && (
<ArbitrationTimer arbitration={this.worldstate.arbitration} />
)}
{this.componentState.zariman?.display && <ZarimanTimer zarimanCycle={this.worldstate.zarimanCycle} />}
</div>
</div>
</b-list-group-item>
Expand Down
1 change: 1 addition & 0 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default {
'@fortawesome/fontawesome-free/css/regular.min.css',
'@fortawesome/fontawesome-free/css/solid.min.css',
'@fortawesome/fontawesome-free/css/brands.min.css',
'@/static/less/Warframe-symbols.less',
'@/static/less/common.less',
'@/static/less/tables.less',
'@/static/less/night.less',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"test:debug": "cypress open --config-file=cypress.config.js"
},
"lint-staged": {
"*.{js,vue}": "eslint --cache",
"*.{js,vue,jsx}": "eslint --cache",
"*.**": "prettier --check --ignore-unknown"
},
"dependencies": {
Expand Down
11 changes: 11 additions & 0 deletions static/json/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@
"location": "Cambion"
}
},
"zariman": {
"display": true,
"displayable": true,
"displayName": "Zariman Ten Zero Cycle",
"key": "zariman",
"component": "TimePanel",
"props": {
"time": "@worldstate.zarimanCycle",
"location": "Zariman"
}
},
"bounties": {
"display": true,
"displayable": true,
Expand Down
11 changes: 10 additions & 1 deletion static/json/initialWorldstate.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,16 @@
"active": false,
"id": "12345"
},
"twitter": []
"twitter": [],
"zarimanCycle": {
"id": "zarimanCycle0000000080000",
"expiry": "2000-01-01T01:00:00.000Z",
"activation": "2000-01-01T01:00:00.000Z",
"state": "Loading...",
"timeLeft": "1h 1m 1s",
"shortString": "1h 1m 1s",
"isCorpus": false
}
},
"ps4": {
"timestamp": "2000-01-01T01:00:00.000Z",
Expand Down
7 changes: 5 additions & 2 deletions static/lang/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@
"cetus": "Cetus",
"vallis": "Vallis",
"earth": "Země",
"cambion": "Cambion"
"cambion": "Cambion",
"zariman": "Zariman Ten Zero"
},
"news": {
"header": "Novinky",
Expand Down Expand Up @@ -178,7 +179,9 @@
"ongoingL": "Probíhá:",
"expiredL": "Expirováno",
"depart": "Ocestovat",
"arrive": "Objeví za"
"arrive": "Objeví za",
"grineer": "Grineer",
"corpus": "Corpus"
},
"timer": {
"ostron": "Ostron",
Expand Down
3 changes: 2 additions & 1 deletion static/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@
"cetus": "Cetus",
"vallis": "Tal",
"earth": "Erde",
"cambion": "Cambion"
"cambion": "Cambion",
"zariman": "Zariman Ten Zero"
},
"news": {
"header": "Neuigkeiten",
Expand Down
7 changes: 5 additions & 2 deletions static/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@
"cetus": "Cetus",
"vallis": "Vallis",
"earth": "Earth",
"cambion": "Cambion"
"cambion": "Cambion",
"zariman": "Zariman Ten Zero"
},
"news": {
"header": "News",
Expand Down Expand Up @@ -178,7 +179,9 @@
"ongoingL": "Ongoing for:",
"expiredL": "Expired",
"depart": "Departs",
"arrive": "Arrives at"
"arrive": "Arrives at",
"grineer": "Grineer",
"corpus": "Corpus"
},
"timer": {
"ostron": "Ostron",
Expand Down
3 changes: 2 additions & 1 deletion static/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@
"cetus": "Cetus",
"vallis": "Valles",
"earth": "La Tierra",
"cambion": "Cambion"
"cambion": "Cambion",
"zariman": "Zariman Ten Zero"
},
"news": {
"header": "Noticias",
Expand Down
7 changes: 5 additions & 2 deletions static/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@
"cetus": "Cetus",
"vallis": "Vallée d'Orbis",
"earth": "Terre",
"cambion": "Puy de Cambion"
"cambion": "Puy de Cambion",
"zariman": "Zariman Ten Zero"
},
"news": {
"header": "Actualités",
Expand Down Expand Up @@ -178,7 +179,9 @@
"ongoingL": "En cours pour :",
"expiredL": "Expiré",
"depart": "Départs",
"arrive": "Arrivée prévue à"
"arrive": "Arrivée prévue à",
"grineer": "Grineer",
"corpus": "Corpus"
},
"timer": {
"ostron": "Ostron",
Expand Down
7 changes: 5 additions & 2 deletions static/lang/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@
"cetus": "Cetus",
"vallis": "Vallis",
"earth": "Terra",
"cambion": "Cambion"
"cambion": "Cambion",
"zariman": "Zariman Ten Zero"
},
"news": {
"header": "Novità",
Expand Down Expand Up @@ -178,7 +179,9 @@
"ongoingL": "In corso per:",
"expiredL": "Scaduto",
"depart": "Partenza",
"arrive": "Arriva a"
"arrive": "Arriva a",
"grineer": "Grineer",
"corpus": "Corpus"
},
"timer": {
"ostron": "Ostron",
Expand Down
7 changes: 5 additions & 2 deletions static/lang/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@
"cetus": "시터스",
"vallis": "협곡",
"earth": "지구",
"cambion": "캠비온"
"cambion": "캠비온",
"zariman": "Zariman Ten Zero"
},
"news": {
"header": "새 소식",
Expand Down Expand Up @@ -178,7 +179,9 @@
"ongoingL": "진행:",
"expiredL": "만료",
"depart": "출발",
"arrive": "도착까지"
"arrive": "도착까지",
"grineer": "Grineer",
"corpus": "Corpus"
},
"timer": {
"ostron": "오스트론",
Expand Down
7 changes: 5 additions & 2 deletions static/lang/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@
"cetus": "Cetus",
"vallis": "Vallis",
"earth": "Earth",
"cambion": "Cambion"
"cambion": "Cambion",
"zariman": "Zariman Ten Zero"
},
"news": {
"header": "News",
Expand Down Expand Up @@ -178,7 +179,9 @@
"ongoingL": "Ongoing for:",
"expiredL": "Expired",
"depart": "Departs",
"arrive": "Arrives at"
"arrive": "Arrives at",
"grineer": "Grineer",
"corpus": "Corpus"
},
"timer": {
"ostron": "Ostron",
Expand Down
Loading

0 comments on commit 78e0063

Please sign in to comment.