From ccdd986967d1b234d1bb3f86cb3807b7b8435fd9 Mon Sep 17 00:00:00 2001 From: muhammadeko Date: Sun, 15 May 2022 10:21:01 +0700 Subject: [PATCH] use koko-boya's resources --- src/components/pages/Artifacts.tsx | 14 +++++------ .../providers/ReliquaryDataProvider.ts | 24 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/components/pages/Artifacts.tsx b/src/components/pages/Artifacts.tsx index da6c2b1..83b3668 100644 --- a/src/components/pages/Artifacts.tsx +++ b/src/components/pages/Artifacts.tsx @@ -89,10 +89,10 @@ export default function Artifacts() { }; const getPercent = (affix:IReliquaryAffix)=>{ - if (affix.propType.indexOf("PERCENT") !== -1 || affix.propType.indexOf("CRITICAL") !== -1 || affix.propType.indexOf("EFFICIENCY") !== -1 || affix.propType.indexOf("HURT") !== -1 || affix.propType.indexOf("RATIO") !== -1 || affix.propType.indexOf("ADD") !== -1) { - return parseFloat(String(affix.propValue*100)).toPrecision(3) + "%"; + if (affix.PropType.indexOf("PERCENT") !== -1 || affix.PropType.indexOf("CRITICAL") !== -1 || affix.PropType.indexOf("EFFICIENCY") !== -1 || affix.PropType.indexOf("HURT") !== -1 || affix.PropType.indexOf("RATIO") !== -1 || affix.PropType.indexOf("ADD") !== -1) { + return parseFloat(String(affix.PropValue*100)).toPrecision(3) + "%"; } - return parseInt(String(affix.propValue)); + return parseInt(String(affix.PropValue)); }; const handleGeneratedArtifact = () => { @@ -156,7 +156,7 @@ export default function Artifacts() { aria-label="Artifact Main Stats" id="ArtifactMainStats" className="block w-full shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm border-gray-300 rounded-md" options={reliquaryMains} - getOptionLabel={(option) => t(option.propType)} + getOptionLabel={(option) => t(option.PropType)} onChange={handleMainStatChange} renderInput={(params) => } /> @@ -173,9 +173,9 @@ export default function Artifacts() { {reliquaryAffixes.map((affix, index) => { return (
- handleAffixSelected(e,false,0)}/> - - handleAffixSelected(e,true, affix.id)}/> + handleAffixSelected(e,false,0)}/> + + handleAffixSelected(e,true, affix.Id)}/>
); })} diff --git a/src/components/providers/ReliquaryDataProvider.ts b/src/components/providers/ReliquaryDataProvider.ts index 6a0399e..63d5282 100644 --- a/src/components/providers/ReliquaryDataProvider.ts +++ b/src/components/providers/ReliquaryDataProvider.ts @@ -1,15 +1,15 @@ export interface IReliquaryMain { - id: number; - propDepotId: number; - propType:string; - affixName:string; + Id: number; + PropDepotId: number; + PropType:string; + AffixName:string; } export interface IReliquaryAffix { - id: number; - depotId: number; - groupId: number; - propType:string; - propValue:number; + Id: number; + DepotId: number; + GroupId: number; + PropType:string; + PropValue:number; } export default class ReliquaryDataProvider { private static reliquaryMains:IReliquaryMain[] = []; @@ -21,17 +21,17 @@ export default class ReliquaryDataProvider { } private static async loadReliquaryMain(){ - let data = await fetch("https://raw.githubusercontent.com/Dimbreath/GenshinData/master/ExcelBinOutput/ReliquaryMainPropExcelConfigData.json"); + let data = await fetch("https://raw.githubusercontent.com/Koko-boya/Grasscutter_Resources/main/Resources/ExcelBinOutput/ReliquaryMainPropExcelConfigData.json"); let json:IReliquaryMain[] = await data.json(); this.reliquaryMains = []; json.forEach(element => { - if (this.reliquaryMains.filter(x => x.propType === element.propType).length === 0) + if (this.reliquaryMains.filter(x => x.PropType === element.PropType).length === 0) this.reliquaryMains.push(element) }); } private static async loadReliquaryAffixes(){ - let data = await fetch("https://raw.githubusercontent.com/Dimbreath/GenshinData/master/ExcelBinOutput/ReliquaryAffixExcelConfigData.json"); + let data = await fetch("https://raw.githubusercontent.com/Koko-boya/Grasscutter_Resources/main/Resources/ExcelBinOutput/ReliquaryAffixExcelConfigData.json"); let json = await data.json(); this.reliquaryAffixes = json; }