fix achievement icons

This commit is contained in:
Layne 2022-03-25 20:07:33 -04:00
parent 0888710d36
commit 46d848c579
2 changed files with 5 additions and 3 deletions

View File

@ -1,10 +1,12 @@
import { GetConfiguration, IAchievementCategory } from '..'; import { GetConfiguration, IAchievementCategory } from '..';
export const GetAchievementCategoryImageUrl = (category: IAchievementCategory, progress: number = null) => export const GetAchievementCategoryImageUrl = (category: IAchievementCategory, progress: number = null, icon: boolean = false) =>
{ {
const imageUrl = GetConfiguration<string>('achievements.images.url'); const imageUrl = GetConfiguration<string>('achievements.images.url');
let imageName = `achcategory_${ category.code }`; let imageName = icon ? 'achicon_' : 'achcategory_';
imageName += category.code;
if(progress !== null) imageName += `_${ ((progress > 0) ? 'active' : 'inactive') }`; if(progress !== null) imageName += `_${ ((progress > 0) ? 'active' : 'inactive') }`;

View File

@ -228,7 +228,7 @@ export const AchievementsView: FC<{}> = props =>
<Text fontSize={ 4 } fontWeight="bold" className="text-small">{ LocalizeText(`quests.${ getSelectedCategory.code }.name`) }</Text> <Text fontSize={ 4 } fontWeight="bold" className="text-small">{ LocalizeText(`quests.${ getSelectedCategory.code }.name`) }</Text>
<Text>{ LocalizeText('achievements.details.categoryprogress', [ 'progress', 'limit' ], [ getSelectedCategory.getProgress().toString(), getSelectedCategory.getMaxProgress().toString() ]) }</Text> <Text>{ LocalizeText('achievements.details.categoryprogress', [ 'progress', 'limit' ], [ getSelectedCategory.getProgress().toString(), getSelectedCategory.getMaxProgress().toString() ]) }</Text>
</Column> </Column>
<LayoutImage imageUrl={ GetAchievementCategoryImageUrl(getSelectedCategory) } /> <LayoutImage imageUrl={ GetAchievementCategoryImageUrl(getSelectedCategory, null,true) } />
</NitroCardSubHeaderView> } </NitroCardSubHeaderView> }
<NitroCardContentView gap={ 1 }> <NitroCardContentView gap={ 1 }>
{ !getSelectedCategory && { !getSelectedCategory &&