Jazz2::Editor::WeaponPreview class

Preview of a custom weapon in a firing range.

Shows the paths of the shots and the shots themselves flying along them, with their sprites, again and again. The player and the target are moved by dragging them.

Constructors, destructors, conversion operators

WeaponPreview(IEditorContext& session, Function<const WeaponsDescription*()>&& getWeapons, Function<WeaponType()>&& getSlot, Function<bool()>&& isPowered)
Creates a new instance, the functions return the weapons of the level, the weapon and whether it's powered up.

Public functions

auto GetSummary() -> String
Returns what one press of fire does, in numbers, empty if there's nothing shown.
auto Measure(const Context& context, Vector2f available) -> Vector2f override
void Update(float timeMult) override
void Draw(Painter& painter) override
auto AcceptsPointer() const -> bool override
auto OnPointerDown(const PointerEvent& event) -> bool override
void OnPointerMove(const PointerEvent& event) override
void OnPointerUp(const PointerEvent& event, bool inside) override
void OnPointerCancel() override
auto GetTooltip(Vector2f pos) const -> StringView override