mirror of
https://github.com/billsonnn/nitro-react.git
synced 2025-01-19 05:46:27 +01:00
fix achievement icons
This commit is contained in:
parent
0888710d36
commit
46d848c579
@ -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') }`;
|
||||||
|
|
||||||
|
@ -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 &&
|
||||||
|
Loading…
Reference in New Issue
Block a user