图像
EVE Online的图标,作为WebP.
每个已出版的类型,市场组,元组,派系,教条属性和教条效应都在这里有其图标,同时还有客户端的UI纹理EVEShipFit的用法. 图标不复合:一个类型有图标,帧和标记,因此技术级别或派别标记可以被忽略.
为什么?
大多数图像也可以在 https://images.evetech.net (英语)但这些图像不是 总是质量最好的:有时他们的标记是错的等. 见 这里 概览 问题.
此外,游戏中图标在服务器上无法使用. 意思是我们必须去取 他们来自客户资源.
两者共同创建了这个存储库:它通过获取所有 直接来自客户数据的信息。 此外,它还将其输出为WebP,用于 a 质量为 0.9,这使得文件的大小大约为5倍.
先决条件
- 走1.27号或以后
- 平板电脑,用来改变方案
- Npm 软件包的节点
- libwebp, 可选; 转换速度比它快数倍
使用量
go run ./cmd/images download # fetch the latest SDE into sde/, and the client's resource index into cache/
go run ./cmd/images build # convert the images, and write them with images.dat to dist/
go run ./cmd/images compare old/ # tell whether dist/ differs from old/
build 下载尚未下载的 SDE,另用磁盘上的.
使用 --build <number> ;客户端与 SDE 共享其构建编号.
使用 --server singularity 从 Singularity 取取 SDE 和客户端.
转换后图像保存在 cache/因此,下一个建筑只获取 EVE 中的变化.
产出
build 写到 dist/数字 :
images/,每个图像一个WebP。 文件以其来源的散列来命名,因此在不更改的情况下保留其名称.images.dat一个平缓起伏器,被描述在 规格/,它告诉每个类型,市场组,元组,派系,教条属性和教条效应使用的是哪一种图像.
图标被64像素缩放为64,质量为90. 图标小于此,标记,帧和UI纹理保持了自己的大小,并且是无损失的.
哪个类型的图像会跟随客户端所画的, 由 EVE- Turtle 工具系统夜生师.
无
npm install @eveshipfit/images
货船 dist/images.dat,则 dist/images/ 文件夹和装入器.
将文件夹装入您的网站并装入 images.dat 像SDE一样.
与维特和 静态复制数字 :
// vite.config.js
viteStaticCopy({
targets: [{ src: "node_modules/@eveshipfit/images/dist/images/*", dest: "images", rename: { stripBase: true } }],
});
import imagesUrl from "@eveshipfit/images/dist/images.dat?url";
import { loadImages } from "@eveshipfit/images";
const images = await loadImages({ url: imagesUrl }, { baseUrl: `${import.meta.env.BASE_URL}images/` });
images.typeIcon(2048); // Damage Control II: [{ src }, { src }], the icon and its Tech II marker
images.typeIcon(2048, { marker: false }); // without the Tech II marker
images.typeIcon(691, { copy: true }); // Rifter Blueprint, as a copy
images.marketGroupIcon(4); // Ships
images.metaGroupIcon(2); // Tech II
images.factionIcon(500001); // Caldari State
images.attributeIcon(263); // Shield Capacity
images.effectIcon(12); // High Power Slot
images.uiTexture("classes/fitting/statsicons/armorhp");
一个类型的地层被从64像素的图标的左上角画出自己的大小;一个标记比下面的图标要小.
缩放整个图标而不是层.
一个 additive 层被添加到下面的地层上; 在自己的堆栈上下文中绘制堆栈, 所以不添加到页面上 :
function TypeIcon({ typeId, size = 64 }: { typeId: number; size?: number }) {
const layers = images.typeIcon(typeId);
if (layers === undefined) return null;
return (
<span style={{ position: "relative", display: "inline-block", width: 64, height: 64, zoom: size / 64, isolation: "isolate" }}>
{layers.map((layer) => (
<img
key={layer.src}
src={layer.src}
alt=""
style={{ position: "absolute", top: 0, left: 0, mixBlendMode: layer.additive ? "plus-lighter" : undefined }}
/>
))}
</span>
);
}
释放
每天协调世界时中午12点, main 以最新的 SDE 和客户端为条件构建.
何时 images.dat 与最新版本不同,新版本在npm上制作并发布.
许可证
全部 EVE 数据 在线数据属于中共党组织,且受以下条件制约: 他们的许可协议。 。 。 . EVESIP.fit的特异性是麻省理工学院.