mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2026-04-04 22:47:23 +02:00
remove getBurgLabel from labels.ts
This commit is contained in:
parent
baeab354b6
commit
5d90b663c4
2 changed files with 8 additions and 14 deletions
|
|
@ -119,7 +119,7 @@ function editBurg(id) {
|
|||
pack.burgs[id].name = burgName.value;
|
||||
elSelected.text(burgName.value);
|
||||
// Sync to Labels data model
|
||||
const labelData = Labels.getBurgLabel(id);
|
||||
const labelData = Labels.get(id);
|
||||
if (labelData) Labels.updateLabel(labelData.i, { text: burgName.value });
|
||||
}
|
||||
|
||||
|
|
@ -386,7 +386,7 @@ function editBurg(id) {
|
|||
if (burg.capital) pack.states[newState].center = burg.cell;
|
||||
|
||||
// Sync position to Labels data model
|
||||
const labelData = Labels.getBurgLabel(id);
|
||||
const labelData = Labels.get(id);
|
||||
if (labelData) Labels.updateLabel(labelData.i, { x, y });
|
||||
|
||||
if (d3.event.shiftKey === false) toggleRelocateBurg();
|
||||
|
|
|
|||
|
|
@ -66,12 +66,6 @@ class LabelsModule {
|
|||
);
|
||||
}
|
||||
|
||||
getBurgLabel(burgId: number): BurgLabelData | undefined {
|
||||
return pack.labels.find((l) => l.type === "burg" && l.burgId === burgId) as
|
||||
| BurgLabelData
|
||||
| undefined;
|
||||
}
|
||||
|
||||
addStateLabel(data: Omit<StateLabelData, "i" | "type">): StateLabelData {
|
||||
const label: StateLabelData = {
|
||||
i: this.getNextId(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue