profectus-docs/assets/api_game_events_interfaces_GlobalEvents.md.D6zjGE6r.lean.js

1 line
11 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{_ as a,c as r,a0 as t,o}from"./chunks/framework.P9qPzDnn.js";const f=JSON.parse('{"title":"Interface: GlobalEvents","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/game/events/interfaces/GlobalEvents.md","filePath":"api/game/events/interfaces/GlobalEvents.md","lastUpdated":null}'),n={name:"api/game/events/interfaces/GlobalEvents.md"};function s(i,e,d,l,c,h){return o(),r("div",null,e[0]||(e[0]=[t('<p><a href="./../../../">Profectus</a> / <a href="./../">game/events</a> / GlobalEvents</p><h1 id="interface-globalevents" tabindex="-1">Interface: GlobalEvents <a class="header-anchor" href="#interface-globalevents" aria-label="Permalink to &quot;Interface: GlobalEvents&quot;"></a></h1><p>All types of events able to be sent or emitted from the global event bus.</p><h2 id="properties" tabindex="-1">Properties <a class="header-anchor" href="#properties" aria-label="Permalink to &quot;Properties&quot;"></a></h2><h3 id="addlayer" tabindex="-1">addLayer() <a class="header-anchor" href="#addlayer" aria-label="Permalink to &quot;addLayer()&quot;"></a></h3><blockquote><p><strong>addLayer</strong>: (<code>layer</code>, <code>saveData</code>) =&gt; <code>void</code></p></blockquote><p>Sent whenever a layer is added.</p><h4 id="parameters" tabindex="-1">Parameters <a class="header-anchor" href="#parameters" aria-label="Permalink to &quot;Parameters&quot;"></a></h4><h5 id="layer" tabindex="-1">layer <a class="header-anchor" href="#layer" aria-label="Permalink to &quot;layer&quot;"></a></h5><p><a href="./../../layers/interfaces/Layer"><code>Layer</code></a></p><p>The layer being added.</p><h5 id="savedata" tabindex="-1">saveData <a class="header-anchor" href="#savedata" aria-label="Permalink to &quot;saveData&quot;"></a></h5><p><a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type" target="_blank" rel="noreferrer"><code>Record</code></a>&lt;<code>string</code>, <code>unknown</code>&gt;</p><p>The layer&#39;s save data object within player.</p><h4 id="returns" tabindex="-1">Returns <a class="header-anchor" href="#returns" aria-label="Permalink to &quot;Returns&quot;"></a></h4><p><code>void</code></p><h4 id="defined-in" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in" aria-label="Permalink to &quot;Defined in&quot;"></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/events.ts#L14" target="_blank" rel="noreferrer">profectus/src/game/events.ts:14</a></p><hr><h3 id="fontsloaded" tabindex="-1">fontsLoaded <a class="header-anchor" href="#fontsloaded" aria-label="Permalink to &quot;fontsLoaded&quot;"></a></h3><blockquote><p><strong>fontsLoaded</strong>: <code>VoidFunction</code></p></blockquote><p>Using document.fonts.ready returns too early on firefox, so we use document.fonts.onloadingdone instead, which doesn&#39;t accept multiple listeners. This event fires when that callback is called.</p><h4 id="defined-in-1" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-1" aria-label="Permalink to &quot;Defined in&quot;"></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/events.ts#L51" target="_blank" rel="noreferrer">profectus/src/game/events.ts:51</a></p><hr><h3 id="gamewon" tabindex="-1">gameWon <a class="header-anchor" href="#gamewon" aria-label="Permalink to &quot;gameWon&quot;"></a></h3><blockquote><p><strong>gameWon</strong>: <code>VoidFunction</code></p></blockquote><p>Sent when the game has ended.</p><h4 id="defined-in-2" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-2" aria-label="Permalink to &quot;Defined in&quot;"></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/events.ts#L35" target="_blank" rel="noreferrer">profectus/src/game/events.ts:35</a></p><hr><h3 id="loadsettings" tabindex="-1">loadSettings() <a class="header-anchor" href="#loadsettings" aria-label="Permalink to &quot;loadSettings()&quot;"></a></h3><blockquote><p><strong>loadSettings</strong>: (<code>settings</code>) =&gt; <code>void</code></p></blockquote><p>Sent when constructing the <a href="./../../settings/interfaces/Settings">Settings</a> object. Use it to add default values for custom properties to the object.</p><h4 id="parameters-1" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-1" aria-label="Permalink to &quot;Parameters&quot;"></a></h4><h5 id="settings" tabindex="-1">settings <a class="header-anchor" href="#settings" aria-label="Permalink to &quot;settings&quot;"></a></h5><p><a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype" target="_blank" rel="noreferrer"><code>Partial</code></a>&lt;<a href="./../../settings/interfaces/Settings"><code>Settings</code></a>&gt;</p><p>The settings object being constructed.</p><h4 id="returns-1" tabindex="-1">Returns <a class="header-anchor" href="#returns-1" aria-label="Permalink to &quot;Returns&quot;"></a></h4><p><code>void</code></p><h4 id="defined-in-3" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-3" aria-label="Permalink to &quot;Defined in&quot;"></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/events.ts#L31" target="_blank" rel="noreferrer">profectus/src/game/events.ts:31</a></p><hr><h3 id="onload" tabindex="-1">onLoad <a class="header-anchor" href="#onload" aria-label="Permalink to &quot;onLoad&quot;"></a></h3><blockquote><p><strong>onLoad</strong>: <code>VoidFunction</code></p></blockquote><p>Sent whenever a save has finished loading. Happens when the page is opened and upon switching saves in the saves manager.</p><h4 id="defined-in-4" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-4" aria-label="Permalink to &quot;Defined in&quot;"></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/events.ts#L46" target="_blank" rel="noreferrer">profectus/src/game/events.ts:46</a></p><hr><h3 id="removelayer" tabindex="-1">removeLayer() <a class="header-anchor" href="#removelayer" aria-label="Permalink to &quot;removeLayer()&quot;"></a></h3><blockquote><p><strong>removeLayer</strong>: (<code>layer</code>) =&gt; <code>void</code></p></blockquote><p>Sent whenever a layer is removed.</p><h4 id="parameters-2" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-2" aria-label="Permalink to &quot;Parameters&quot;"></a></h4><h5 id="layer-1" tabindex="-1">layer <a class="header-anchor" href="#layer-1" aria-label="Permalink to &quot;layer&quot;"></a></h5><p><a href="./../../layers/interfaces/Layer"><code>Layer</code></a></p><p>The layer being removed.</p><h4 id="returns-2" tabindex="-1">Returns <a class="header-anchor" href="#returns-2" aria-label="Permalink to &quot;Returns&quot;"></a></h4><p><code>void</code></p><h4 id="defined-in-5" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-5" aria-label="Permalink to &quot;Defined in&quot;"></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/events.ts#L19" target="_blank" rel="noreferrer">profectus/src/game/events.ts:19</a></p><hr><h3 id="reset" tabindex="-1">reset() <a class="header-anchor" href="#reset" aria-label="Permalink to &quot;reset()&quot;"></a></h3><blockquote><p><strong>reset</strong>: (<code>reset</code>) =&gt; <code>void</code></p></blockquote><h4 id="parameters-3" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-3" aria-label="Permalink to &quot;Parameters&quot;"></a></h4><h5 id="reset-1" tabindex="-1">reset <a class="header-anchor" href="#reset-1" aria-label="Permalink to &quot;reset&quot;"></a></h5><p><a href="./../../../features/reset/interfaces/Reset"><code>Reset</code></a></p><h4 id="returns-3" tabindex="-1">Returns <a class="header-anchor" href="#returns-3" aria-label="Permalink to &quot;Returns&quot;"></a></h4><p><code>void</code></p><h4 id="defined-in-6" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-6" aria-label="Permalink to &quot;Defined in&quot;"></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/features/reset.ts#L118" target="_blank" rel="noreferrer">profectus/src/features/reset.ts:118</a></p><hr><h3 id="setupvue" tabindex="-1">setupVue() <a class="header-anchor" href="#setupvue" aria-label="Permalink to &quot;setupVue()&quot;"></a></h3><blockquote><p><strong>setupVue</strong>: (<code>vue</code>) =&gt; <code>void</code></p></blockquote><p>Sent when setting up the Vue Application instance. Use it to register global components or otherwise set up things that should affect Vue globally.</p><h4 id="parameters-4" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-4" aria-label="Permalink to &quot;Parameters&quot;"></a></h4><h5 id="vue" tabindex="-1">vue <a class="header-anchor" href="#vue" aria-label="Permalink to &quot;vue&quot;"></a></h5><p><code>App</code></p><p>The Vue App being constructed.</p><h4 id="returns-4" tabindex="-1">Returns <a class="header-anchor" href="#returns-4" aria-label="Permalink to &quot;Returns&quot;"></a></h4><p><code>void</code></p><h4 id="defined-in-7" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-7" aria-label="Permalink to &quot;Defined in&quot;"></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/events.ts#L41" target="_blank" rel="noreferrer">profectus/src/game/events.ts:41</a></p><hr><h3 id="update" tabindex="-1">update() <a class="header-anchor" href="#update" aria-label="Permalink to &quot;update()&quot;"></a></h3><blockquote><p><strong>update</strong>: (<code>diff</code>, <code>trueDiff</code>) =&gt; <code>void</code></p></blockquote><p>Sent every game tick. Runs the life cycle of the project.</p><h4 id="parameters-5" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-5" aria-label="Permalink to &quot;Parameters&quot;"></a></h4><h5 id="diff" tabindex="-1">diff <a class="header-anchor" href="#diff" aria-label="Permalink to &quot;diff&quot;"></a></h5><p><code>number</code></p><p>The delta time since last tick, in ms.</p><h5 id="truediff" tabindex="-1">trueDiff <a class="header-anchor" href="#truediff" aria-label="Permalink to &quot;trueDiff&quot;"></a></h5><p><code>number</code></p><p>The delta time since last tick, in ms. Unaffected by time modifiers like <a href="./../../player/interfaces/Player#devspeed">game/player.Player.devSpeed</a> or <a href="./../../player/interfaces/Player#offlinetime">game/player.Player.offlineTime</a>. Intended for things like updating animations.</p><h4 id="returns-5" tabindex="-1">Returns <a class="header-anchor" href="#returns-5" aria-label="Permalink to &quot;Returns&quot;"></a></h4><p><code>void</code></p><h4 id="defined-in-8" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-8" aria-label="Permalink to &quot;Defined in&quot;"></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/events.ts#L25" target="_blank" rel="noreferrer">profectus/src/game/events.ts:25</a></p>',97)]))}const p=a(n,[["render",s]]);export{f as __pageData,p as default};