mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-11-19 17:05:20 +08:00
- Add a URL-driven Chinese overlay page rendering item rate tables, tech levels, current research, and Dyson sphere power for streams. - Add the offline GameIcons layer and generate_icons.py, which extracts every item and tech icon from a local DSP install into js/generated/dsp-icons.js. - Reuse the proto extraction in generate_text.py and cover the new page with test_dashboard.js.
22 lines
828 B
JavaScript
22 lines
828 B
JavaScript
function GameIcons(data) {
|
|
this.data = data || { icons: { item: {}, tech: {} } };
|
|
}
|
|
|
|
GameIcons.fromGenerated = function () {
|
|
var data = (typeof globalThis !== "undefined" && globalThis.LiveStreamAssistIconData) ||
|
|
(typeof window !== "undefined" && window.LiveStreamAssistIconData) ||
|
|
null;
|
|
if (!data) throw new Error("LiveStreamAssistIconData is not loaded. Include generated/dsp-icons.js first.");
|
|
return new GameIcons(data);
|
|
};
|
|
|
|
GameIcons.prototype.icon = function (kind, id) {
|
|
var table = this.data.icons && this.data.icons[kind];
|
|
return table ? table[String(id)] || null : null;
|
|
};
|
|
|
|
GameIcons.prototype.itemIcon = function (id) { return this.icon("item", id); };
|
|
GameIcons.prototype.techIcon = function (id) { return this.icon("tech", id); };
|
|
|
|
ns.GameIcons = GameIcons;
|