feat: add Addons

This commit is contained in:
2026-06-19 04:23:59 -03:00
parent 40ae377498
commit ebc3dab8e6
4 changed files with 122 additions and 8 deletions
+18
View File
@@ -13,6 +13,13 @@ export type Offering = {
role: number;
};
export type Addon = {
id: string;
name: string;
iconFilePath: string;
role: number;
};
export type ItemType = 'all' | 'toolbox' | 'flashlight' | 'medkit' | 'key' | 'map' | 'other';
export type OfferingRole = 'all' | 'shared' | 'killer' | 'survivor';
@@ -39,3 +46,14 @@ export const getOfferingIconUrl = (iconFilePath: string) => {
const file = (iconFilePath.split('/').pop() ?? '').split('.')[0];
return `${DB_BASE_URL}/icons/offering-icons/${file}.png`;
};
export const getAddonIconUrl = (iconFilePath: string) => {
const file = (iconFilePath.split('/').pop() ?? '').split('.')[0];
return `${DB_BASE_URL}/icons/addon-icons/${file}.png`;
};
export const randInRange = (min: number, max: number) => {
const lo = Math.min(min, max);
const hi = Math.max(min, max);
return Math.floor(Math.random() * (hi - lo + 1)) + lo;
};