Skip to content

Commit 3715f0c

Browse files
committed
Update for 2.14.0-beta.dev.20240915.1
1 parent dc2e216 commit 3715f0c

9 files changed

Lines changed: 32 additions & 42 deletions

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"watch": "npx tsc --build --watch --pretty --preserveWatchOutput"
1111
},
1212
"devDependencies": {
13-
"@wayward/types": "^2.14.0-beta.dev.20240914.1",
13+
"@wayward/types": "^2.14.0-beta.dev.20240915.1",
1414
"rimraf": "3.0.2",
15-
"typescript": "^5.6.1-rc"
15+
"typescript": "^5.6.2"
1616
}
1717
}

src/overlay/SelectionOverlay.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import Stream from "@wayward/goodstream/Stream";
21
import Tile from "@wayward/game/game/tile/Tile";
32
import Mod from "@wayward/game/mod/Mod";
43
import { Tuple } from "@wayward/utilities/collection/Tuple";
@@ -9,6 +8,7 @@ import Vector3 from "@wayward/game/utilities/math/Vector3";
98
import DebugTools from "../DebugTools";
109
import { DEBUG_TOOLS_ID } from "../IDebugTools";
1110
import { IOverlayInfo } from "@wayward/game/game/tile/ITerrain";
11+
import Objects from "@wayward/utilities/object/Objects";
1212

1313
export default class SelectionOverlay {
1414

@@ -131,9 +131,8 @@ export default class SelectionOverlay {
131131
* Returns an array of neighbor positions that are painted/selected
132132
*/
133133
private static getPaintOverlayConnections(neighbors: INeighborTiles): NeighborPosition[] {
134-
return Stream.keys(neighbors)
135-
.filter(neighborPosition => this.overlays.has(neighbors[neighborPosition]))
136-
.toArray();
134+
return Objects.keys(neighbors)
135+
.filter(neighborPosition => this.overlays.has(neighbors[neighborPosition]));
137136
}
138137

139138
}

src/ui/DebugToolsDialog.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,10 @@ export default class DebugToolsDialog extends TabDialog<DebugToolsPanel> {
9494
* This will only be called once
9595
*/
9696
protected override getSubpanels(): DebugToolsPanel[] {
97-
return subpanelClasses.stream()
98-
.merge(this.DEBUG_TOOLS.modRegistryMainDialogPanels.getRegistrations()
97+
return subpanelClasses
98+
.concat(this.DEBUG_TOOLS.modRegistryMainDialogPanels.getRegistrations()
9999
.map(registration => registration.data(DebugToolsPanel)))
100-
.map(cls => new cls())
101-
.toArray();
100+
.map(cls => new cls());
102101
}
103102

104103
/**

src/ui/InspectDialog.ts

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,11 @@ export default class InspectDialog extends TabDialog<InspectInformationSection>
101101
* This will only be called once
102102
*/
103103
protected override getSubpanels(): InspectInformationSection[] {
104-
const subpanels = informationSectionClasses.stream()
105-
.merge(this.DEBUG_TOOLS.modRegistryInspectDialogPanels.getRegistrations()
104+
const subpanels = informationSectionClasses
105+
.concat(this.DEBUG_TOOLS.modRegistryInspectDialogPanels.getRegistrations()
106106
.map(registration => registration.data(InspectInformationSection)))
107107
.map(cls => new cls()
108-
.event.subscribe("update", this.update))
109-
.toArray();
108+
.event.subscribe("update", this.update));
110109

111110
// we're going to need the entity information section for some other stuff
112111
this.entityInfoSection = subpanels
@@ -126,13 +125,13 @@ export default class InspectDialog extends TabDialog<InspectInformationSection>
126125
protected override getSubpanelInformation(subpanels: InspectInformationSection[]): SubpanelInformation[] {
127126
this.entityButtons = [];
128127

129-
return this.subpanels.stream()
128+
return this.subpanels
130129
// add the tabs of the section to the tuple
131130
.map(section => Tuple(section, section.getTabs()))
132131
// if there are no tabs from the section, remove it
133132
.filter(([, tabs]) => !!tabs.length)
134133
// map each of the section/tab tuples with an array of tuples representing all the subpanels (tabs) provided by that section
135-
.map(([section, tabs]) => tabs
134+
.flatMap(([section, tabs]) => tabs
136135
// map each tab to the subpanel information for it
137136
.map(([index, getTabTranslation]) => Tuple(
138137
Text.toString(getTabTranslation),
@@ -142,11 +141,7 @@ export default class InspectDialog extends TabDialog<InspectInformationSection>
142141
.schedule(section => this.onShowSubpanel(section)(component)),
143142
// we cache all of the entity buttons
144143
(button: Button) => !(section instanceof EntityInformation) ? undefined : this.entityButtons[index] = button,
145-
)))
146-
// currently we have an array of `SubpanelInformation` arrays, because each tab provided an array of them, fix with `flat`
147-
.flatMap<SubpanelInformation>()
148-
// and now return an array
149-
.toArray();
144+
)));
150145
}
151146

152147
public override getName(): Translation {

src/ui/inspect/CorpseInformation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export default class CorpseInformation extends InspectInformationSection {
3636
}
3737

3838
public override getTabs(): TabInformation[] {
39-
return this.corpses.entries().stream()
39+
return this.corpses.entries()
4040
.map(([i, corpse]) => Tuple(i, () => translation(DebugToolsTranslation.CorpseName)
4141
.get(localIsland.corpses.getName(corpse, Article.None).inContext(TextContext.Title))))
4242
.toArray();

src/ui/inspect/EntityInformation.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,11 @@ export default class EntityInformation extends InspectInformationSection {
108108
this.DEBUG_TOOLS.creatureZoneOverlay.event.until(this, "remove")
109109
.subscribe("changeMode", () => this.highlightZone.refresh(false));
110110

111-
this.subsections = entitySubsectionClasses.stream()
112-
.merge(this.DEBUG_TOOLS.modRegistryInspectDialogEntityInformationSubsections.getRegistrations()
111+
this.subsections = entitySubsectionClasses
112+
.concat(this.DEBUG_TOOLS.modRegistryInspectDialogEntityInformationSubsections.getRegistrations()
113113
.map(registration => registration.data(InspectEntityInformationSubsection)))
114114
.map(cls => new cls()
115-
.appendTo(this))
116-
.toArray();
115+
.appendTo(this));
117116

118117
this.statWrapper = new Component()
119118
.classes.add("debug-tools-inspect-entity-sub-section")
@@ -135,7 +134,7 @@ export default class EntityInformation extends InspectInformationSection {
135134
}
136135

137136
public override getTabs(): [number, () => IStringSection[]][] {
138-
return this.entities.entries().stream()
137+
return this.entities.entries()
139138
.map(([i, entity]) => Tuple(i, () => translation(DebugToolsTranslation.EntityName)
140139
.get(EntityType[entity.entityType], entity.getName()/*.inContext(TextContext.Title)*/)))
141140
.toArray();
@@ -314,14 +313,13 @@ export default class EntityInformation extends InspectInformationSection {
314313

315314
@Bound
316315
private createTeleportToPlayerMenu(): ContextMenu<string | number | symbol> {
317-
return game.playerManager.getAll(true, true).stream()
316+
return game.playerManager.getAll(true, true)
318317
.filter(player => player !== this.entity)
319318
.map(player => Tuple(player.name, {
320319
translation: TranslationImpl.generator(player.name),
321320
onActivate: () => this.teleport(player.tile),
322321
}))
323322
.sort(([, t1], [, t2]) => Text.toString(t1.translation).localeCompare(Text.toString(t2.translation)))
324-
// create the context menu from them
325323
.collect<ContextMenu>(options => new ContextMenu(...options))
326324
.addAllDescribedOptions();
327325
}

src/ui/inspect/TileEventInformation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default class TileEventInformation extends InspectInformationSection {
3333
}
3434

3535
public override getTabs(): TabInformation[] {
36-
return this.tileEvents.entries().stream()
36+
return this.tileEvents.entries()
3737
.map(([i, tileEvent]) => Tuple(i, () => translation(DebugToolsTranslation.TileEventName)
3838
.get(Translation.nameOf(Dictionary.TileEvent, tileEvent, Article.None).inContext(TextContext.Title))))
3939
.toArray();

src/ui/panel/TemplatePanel.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ import { Bound } from "@wayward/utilities/Decorators";
2222
import { Tuple } from "@wayward/utilities/collection/Tuple";
2323
import { Priority } from "@wayward/utilities/event/EventEmitter";
2424
import { OwnEventHandler } from "@wayward/utilities/event/EventManager";
25-
2625
import Tile from "@wayward/game/game/tile/Tile";
27-
import Stream from "@wayward/goodstream/Stream";
26+
2827
import DebugTools from "../../DebugTools";
2928
import { DEBUG_TOOLS_ID, DebugToolsTranslation, translation } from "../../IDebugTools";
3029
import PlaceTemplate from "../../action/PlaceTemplate";
@@ -72,8 +71,8 @@ export default class TemplatePanel extends DebugToolsPanel {
7271
.setLabel(label => label.setText(translation(DebugToolsTranslation.LabelTemplate)))
7372
.append(this.dropdownTemplate = new Dropdown<string>()
7473
.setRefreshMethod(() => ({
75-
defaultOption: Stream.keys<string>(terrainTemplates[this.dropdownType.selectedOption]!).first()!,
76-
options: Stream.keys<string>(terrainTemplates[this.dropdownType.selectedOption]!)
74+
defaultOption: Object.keys(terrainTemplates[this.dropdownType.selectedOption]!).at(0)!,
75+
options: Object.keys(terrainTemplates[this.dropdownType.selectedOption]!)
7776
.map(name => Tuple(name, TranslationImpl.generator(name)))
7877
.sort(([, t1], [, t2]) => Text.toString(t1).localeCompare(Text.toString(t2)))
7978
.map(([id, t]) => Tuple(id, (option: Button) => option.setText(t))),

0 commit comments

Comments
 (0)