forked from phenom/healer-man
Release Healer Man 0.1.37
This commit is contained in:
1 parent
03a4e3f51c
commit
361734bc41
41 files changed
+1714
-110
No files matched your search
@@ -26,6 +26,12 @@ import { abilityAtLevel, resourceProfileForClass, type AbilityTarget } from "../
|
||||
import type { DungeonId } from "../game/dungeonCatalog";
|
||||
import { useManastormStore } from "../game/manastormStore";
|
||||
import { resolveStagePresentation } from "../game/manastormStagePresentation";
|
||||
import { currentDpsMeterSnapshot } from "../game/dpsMeterStore";
|
||||
import type { DpsMeterSnapshot } from "../game/dpsMeter";
|
||||
import { activeUiLayout, useUiLayoutStore } from "../game/uiLayoutStore";
|
||||
import { normalizeHudPosition } from "../game/hudLayout";
|
||||
import { resolveDpsMeterDisplay, type HudElementLayout } from "../game/uiLayout";
|
||||
import { currentDisplayLayout } from "./displayLayout";
|
||||
|
||||
export { createDualScreenChannel } from "./dualScreenChannel";
|
||||
|
||||
@@ -89,6 +95,12 @@ export interface CompanionPartyObjectiveSnapshot {
|
||||
}
|
||||
|
||||
export interface CompanionGameSnapshot {
|
||||
dpsMeter: {
|
||||
values: DpsMeterSnapshot;
|
||||
layout: HudElementLayout;
|
||||
display: "main" | "companion";
|
||||
editing: boolean;
|
||||
};
|
||||
gameMode: GameMode;
|
||||
dungeonId: string;
|
||||
dungeonTitle: string;
|
||||
@@ -159,7 +171,8 @@ export type CompanionCommand =
|
||||
| { name: "cyclePartyMember"; direction: 1 | -1 }
|
||||
| { name: "setPartyCommand"; command: PartyCommand }
|
||||
| { name: "recallParty" }
|
||||
| { name: "resetAtEntrance" };
|
||||
| { name: "resetAtEntrance" }
|
||||
| { name: "editDpsMeter"; update: Partial<HudElementLayout> };
|
||||
|
||||
export type DualScreenMessage =
|
||||
| { type: "companion-ready" }
|
||||
@@ -180,6 +193,7 @@ export function currentCompanionSnapshot(): CompanionSnapshot {
|
||||
const combat = useCombatStore.getState();
|
||||
const party = usePartyStore.getState();
|
||||
const manastorm = useManastormStore.getState();
|
||||
const uiLayout = activeUiLayout();
|
||||
const dungeon = requireDungeonDefinition(game.activeDungeonId);
|
||||
const stagePresentation = resolveStagePresentation(game.gameMode, manastorm.currentEncounter, {
|
||||
title: dungeon.title,
|
||||
@@ -251,6 +265,12 @@ export function currentCompanionSnapshot(): CompanionSnapshot {
|
||||
draft: shell.draft,
|
||||
notice: shell.notice,
|
||||
game: {
|
||||
dpsMeter: {
|
||||
values: currentDpsMeterSnapshot(),
|
||||
layout: uiLayout.elements.dps,
|
||||
display: resolveDpsMeterDisplay(uiLayout, typeof window !== "undefined" && currentDisplayLayout() !== "single"),
|
||||
editing: game.overlay === "ui-layout",
|
||||
},
|
||||
gameMode: game.gameMode,
|
||||
dungeonId: dungeon.id,
|
||||
dungeonTitle: stagePresentation.title,
|
||||
@@ -322,6 +342,17 @@ export function executeCompanionCommand(command: CompanionCommand): void {
|
||||
const game = useGameStore.getState();
|
||||
const combat = useCombatStore.getState();
|
||||
switch (command.name) {
|
||||
case "editDpsMeter": {
|
||||
if (game.overlay !== "ui-layout" || !useUiLayoutStore.getState().draft) break;
|
||||
const update: Partial<HudElementLayout> = {};
|
||||
if (command.update.position) update.position = normalizeHudPosition(command.update.position, { x: .5, y: .5 });
|
||||
if (typeof command.update.width === "number" && Number.isFinite(command.update.width)) update.width = Math.round(Math.max(160, Math.min(600, command.update.width)));
|
||||
useUiLayoutStore.getState().updateDraft((layout) => ({ ...layout, elements: {
|
||||
...layout.elements, dps: { ...layout.elements.dps, ...update },
|
||||
} }));
|
||||
useUiLayoutStore.setState({ selectedElement: "dps" });
|
||||
break;
|
||||
}
|
||||
case "selectCharacter": shell.selectCharacter(command.characterId); break;
|
||||
case "openCreator": shell.openCreator(); break;
|
||||
case "cancelCreator": shell.cancelCreator(); break;
|
||||
|
||||
Reference in new issue
Block a user