Get rid of buggy open state
This commit is contained in:
parent
3916d9c58e
commit
21b1313a18
@ -42,7 +42,8 @@
|
||||
import AudioManager from "./AudioManager/AudioManager.svelte";
|
||||
import { showReportScreenStore, userReportEmpty } from "../Stores/ShowReportScreenStore";
|
||||
import ReportMenu from "./ReportMenu/ReportMenu.svelte";
|
||||
import { followStateStore, followRoleStore, followStates, followRoles } from "../Stores/FollowStore";
|
||||
import { followStateStore, followStates } from "../Stores/FollowStore";
|
||||
import { peerStore } from "../Stores/PeerStore";
|
||||
import FollowMenu from "./FollowMenu/FollowMenu.svelte";
|
||||
|
||||
export let game: Game;
|
||||
@ -104,7 +105,7 @@
|
||||
<ReportMenu />
|
||||
</div>
|
||||
{/if}
|
||||
{#if $followStateStore !== followStates.off || $followRoleStore === followRoles.open}
|
||||
{#if $followStateStore !== followStates.off || $peerStore.size > 0}
|
||||
<div>
|
||||
<FollowMenu />
|
||||
</div>
|
||||
|
@ -158,7 +158,7 @@ vim: ft=typescript
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if followRole === followRoles.open}
|
||||
{#if followState === followStates.off}
|
||||
<button
|
||||
type="button"
|
||||
class="nes-btn is-primary follow-menu-button"
|
||||
@ -175,7 +175,7 @@ vim: ft=typescript
|
||||
on:click|preventDefault={reset}
|
||||
title="Stop following"><img class="background-img" src={followImg} alt="" /></button
|
||||
>
|
||||
{:else if followUsers.length > 0}
|
||||
{:else}
|
||||
<button
|
||||
type="button"
|
||||
class="nes-btn is-error follow-menu-button"
|
||||
|
@ -114,13 +114,6 @@ export class Player extends Character {
|
||||
const state = get(followStateStore);
|
||||
const role = get(followRoleStore);
|
||||
|
||||
if (state === followStates.off && this.scene.groups.size > 0) {
|
||||
followRoleStore.set(followRoles.open);
|
||||
} else if (this.scene.groups.size == 0) {
|
||||
followStateStore.set(followStates.off);
|
||||
followRoleStore.set(followRoles.leader);
|
||||
}
|
||||
|
||||
if (activeEvents.get(UserInputEvent.Follow)) {
|
||||
if (state === followStates.off && this.scene.groups.size > 0) {
|
||||
followStateStore.set(followStates.requesting);
|
||||
|
@ -8,7 +8,6 @@ export const followStates = {
|
||||
};
|
||||
|
||||
export const followRoles = {
|
||||
open: "open",
|
||||
leader: "leader",
|
||||
follower: "follower",
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user