Skip to content

Commit

Permalink
added GalacticRegions lookup table
Browse files Browse the repository at this point in the history
  • Loading branch information
Hans Acker committed Oct 31, 2024
1 parent d66a276 commit 7e934a2
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 5 deletions.
2 changes: 1 addition & 1 deletion html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
<table class="wider">
<caption>Codex Discoveries</caption>
<thead>
<tr><th>System</th><th style="width: 10%;">Body</th><th style="width: 30%;">Codex Category</th><th style="width: 20%;">Type</th><th style="width: 10%;">Region</th></tr>
<tr><th>System</th><th style="width: 10%;">Body</th><th style="width: 25%;">Codex Category</th><th style="width: 20%;">Type</th><th style="width: 20%;">Region</th></tr>
</thead>
<tbody id="codex"></tbody>
</table>
Expand Down
4 changes: 2 additions & 2 deletions html/js/board.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ReconnectingWebSocket } from "./reconnecting-websocket.min.js";
import { PageIconActivity } from "./activity_icon.min.js";
import { StatsBox, SortedStatsBox } from "./statsbox.min.js";
import { InfoBox } from "./infobox.min.js";
import { distance3, trimPrefix, makeTd, addRow, whatGame } from "./utils.min.js";
import { distance3, trimPrefix, makeTd, addRow, whatGame, GalacticRegions } from "./utils.min.js";

// TODO: modularize
// TODO: remove/rework global config options (socketUrl, listLength, idleTimeout, resetTimeout)
Expand Down Expand Up @@ -285,7 +285,7 @@ ws.onmessage = (event) => {
makeTd(trimPrefix(message.BodyName || "", message.System)),
makeTd(`${message.Category.replace(/^\$Codex_Category_(.*);$/, "$1").replaceAll("_", " ")} / ${message.SubCategory.replace(/^\$Codex_SubCategory_(.*);$/, "$1").replaceAll("_", " ")}`),
makeTd(message.Name.replace(/^\$Codex_Ent_(.*)_Name;$/, "$1").replaceAll("_", " ")),
makeTd(message.Region.replace(/^\$Codex_RegionName_(.*);$/, "$1")));
makeTd(GalacticRegions[message.Region.replace(/^\$Codex_RegionName_(.*);$/, "$1")]));
addRow(window.codex, tr);
break;
}
Expand Down
2 changes: 1 addition & 1 deletion html/js/board.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions html/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,49 @@ export function whatGame(data) {
return "Unknown";
}
}

export const GalacticRegions = [
"Null", // 0
"Galactic Centre", // 1
"Empyrean Straits", // 2
"Ryker's Hope", // 3
"Odin's Hold", // 4
"Norma Arm", // 5
"Arcadian Stream", // 6
"Izanami", // 7
"Inner Orion-Perseus Conflux", // 8
"Inner Scutum-Centaurus Arm", // 9
"Norma Expanse", // 10
"Trojan Belt", // 11
"The Veils", // 12
"Newton's Vault", // 13
"The Conduit", // 14
"Outer Orion-Perseus Conflux", // 15
"Orion-Cygnus Arm", // 16
"Temple", // 17
"Inner Orion Spur", // 18
"Hawking's Gap", // 19
"Dryman's Point", // 20
"Sagittarius-Carina Arm", // 21
"Mare Somnia", // 22
"Acheron", // 23
"Formorian Frontier", // 24
"Hieronymus Delta", // 25
"Outer Scutum-Centaurus Arm", // 26
"Outer Arm", // 27
"Aquila's Halo", // 28
"Errant Marches", // 29
"Perseus Arm", // 30
"Formidine Rift", // 31
"Vulcan Gate", // 32
"Elysian Shore", // 33
"Sanguineous Rim", // 34
"Outer Orion Spur", // 35
"Achilles's Altar", // 36
"Xibalba", // 37
"Lyra's Song", // 38
"Tenebrae", // 39
"The Abyss", // 40
"Kepler's Crest", // 41
"The Void", // 42
];
2 changes: 1 addition & 1 deletion html/js/utils.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7e934a2

Please sign in to comment.