mirror of
https://github.com/lexogrine/dota2-react-hud.git
synced 2026-05-04 12:33:11 +02:00
removed assets
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import React from 'react';
|
||||
import './abilities.scss';
|
||||
import { getAssetURL } from '../../api/api';
|
||||
|
||||
const Ability = ({ name, cooldown, available, level } : { name: string, cooldown: number, available: boolean, level: number | string }) => {
|
||||
if(name.startsWith("plus_")) return null;
|
||||
return (
|
||||
<div className={`skill-container ${cooldown ? 'cooldown':''} ${!available ? 'unavailable':''}`} style={{backgroundImage: `url('./abilities/${name}.png')`}}>
|
||||
<div className={`skill-container ${cooldown ? 'cooldown':''} ${!available ? 'unavailable':''}`} style={{backgroundImage: `url('${getAssetURL(name, 'abilities')}')`}}>
|
||||
{ cooldown ? <div className="cooldown-container">{cooldown}</div> : null}
|
||||
<div className="level-container">{level}</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { Draft, Team, Faction, Player, TeamDraft } from 'dotagsi';
|
||||
import { apiUrl } from '../../api/api';
|
||||
import { apiUrl, getAssetURL } from '../../api/api';
|
||||
import CameraContainer from '../Camera/Container';
|
||||
|
||||
const ObservedPlayer = ({ players, player, team, show}: { show: boolean, player: Player | null, players: Player[], team: Team | null }) => {
|
||||
@@ -23,7 +23,7 @@ const ObservedPlayer = ({ players, player, team, show}: { show: boolean, player:
|
||||
if(!victim || !victim.hero || !victim.hero.name) return null;
|
||||
|
||||
return (
|
||||
<div className="player_kill" style={{ backgroundImage: `url('./heroes/icons/${victim.hero.name.replace('npc_dota_hero_', '')}.png')` }}>X{killEntry.amount}</div>
|
||||
<div className="player_kill" style={{ backgroundImage: `url('${getAssetURL(victim.hero.name, 'heroes_icons')}')` }}>X{killEntry.amount}</div>
|
||||
);
|
||||
})
|
||||
}</div> : null}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import { Draft, DraftEntry, Faction, TeamDraft } from 'dotagsi';
|
||||
import Snow from "./snowflake.png";
|
||||
import { getAssetURL } from '../../api/api';
|
||||
const PlayerPick = ({ entry, type, active }: { entry: DraftEntry, type: Faction, active: boolean }) => {
|
||||
const order = entry.order + 1;
|
||||
let lastPart = 'th';
|
||||
@@ -24,7 +25,7 @@ const PlayerPick = ({ entry, type, active }: { entry: DraftEntry, type: Faction,
|
||||
</div>
|
||||
{entry.class ? <video muted={true} autoPlay={true} loop={true} width="123">
|
||||
|
||||
<source src={`./heroes/animated/npc_dota_hero_${entry.class}.webm`}
|
||||
<source src={getAssetURL(entry.class, "heroes_animated")}
|
||||
type="video/webm" />
|
||||
|
||||
|
||||
@@ -50,7 +51,7 @@ export const PlayerBan = ({ entry, type, active }: { entry: DraftEntry, type: Fa
|
||||
|
||||
return <div className={`player_ban ${entry.order} ${type} ${active ? 'active' : ''}`}>
|
||||
<div className="player_preview">
|
||||
<img src={`./heroes/${entry.class}.png`} />
|
||||
<img src={getAssetURL(entry.class, "heroes")} />
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import React from "react";
|
||||
import Ability from "../Ability";
|
||||
import CameraContainer from "../Camera/Container";
|
||||
import "./observed.scss";
|
||||
import { getAssetURL } from "../../api/api";
|
||||
|
||||
|
||||
export default class Observed extends React.Component<{ player: Player | null }> {
|
||||
@@ -15,7 +16,7 @@ export default class Observed extends React.Component<{ player: Player | null }>
|
||||
player.hero.name ? <div className="main_row">
|
||||
|
||||
<div className={`avatar`}>
|
||||
<img src={`./heroes/${player.hero.name.replace('npc_dota_hero_', '')}.png`} width={140} alt={'Avatar'} />
|
||||
<img src={getAssetURL(player.hero.name, "heroes")} width={140} alt={'Avatar'} />
|
||||
|
||||
|
||||
</div>
|
||||
@@ -35,7 +36,7 @@ export default class Observed extends React.Component<{ player: Player | null }>
|
||||
</div>
|
||||
<div className="statistics">
|
||||
{
|
||||
player.items.filter(item => item.type === "slot").map(item => item.name !== "empty" ? <img src={`./items/${item.name.replace('item_', '')}.png`} height={43} /> : null)
|
||||
player.items.filter(item => item.type === "slot").map(item => item.name !== "empty" ? <img src={getAssetURL(item.name, 'items')} height={43} /> : null)
|
||||
}
|
||||
</div>
|
||||
<div className="bar-container">
|
||||
|
||||
@@ -4,7 +4,7 @@ import RadiantBorder from './radiantBorder.png';
|
||||
import DireBorder from './direBorder.png';
|
||||
import "./scoreboard.scss";
|
||||
import { Match } from '../../api/interfaces';
|
||||
import { apiUrl } from '../../api/api';
|
||||
import { apiUrl, getAssetURL } from '../../api/api';
|
||||
export function stringToClock(time: string | number, pad = true) {
|
||||
if (typeof time === "string") {
|
||||
time = parseFloat(time);
|
||||
@@ -28,7 +28,7 @@ const ScoreboardPlayer = ({ player }: { player: Player }) => {
|
||||
|
||||
{ player.hero && player.hero.name ? <video muted={true} autoPlay={true} loop={true} width="145">
|
||||
|
||||
<source src={`./heroes/animated/${player.hero.name}.webm`}
|
||||
<source src={getAssetURL(player.hero.name, 'heroes_animated')}
|
||||
type="video/webm" />
|
||||
|
||||
|
||||
@@ -55,11 +55,11 @@ const ScoreboardPlayer = ({ player }: { player: Player }) => {
|
||||
</div>
|
||||
<div className="skills">
|
||||
{
|
||||
player.items.filter(item => item.type === "slot" && item.id < 6).map(item => <div className="item-slot">{item.name !== "empty" ? <img src={`./items/${item.name.replace('item_', '')}.png`} height={57} /> : null}</div>)
|
||||
player.items.filter(item => item.type === "slot" && item.id < 6).map(item => <div className="item-slot">{item.name !== "empty" ? <img src={getAssetURL(item.name, 'items')} height={57} /> : null}</div>)
|
||||
}
|
||||
</div>
|
||||
{ neutralItem ? <div className="neutral-item">
|
||||
{neutralItem.name !== "empty" ? <img src={`./items/${neutralItem.name.replace('item_', '')}.png`} height={57} /> : null}
|
||||
{neutralItem.name !== "empty" ? <img src={getAssetURL(neutralItem.name, 'items')} height={57} /> : null}
|
||||
</div> : null}
|
||||
</div>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user