workadventure/front/src/Components/Menu/ProfileSubMenu.svelte

78 lines
2.6 KiB
Svelte
Raw Normal View History

2021-07-12 17:39:16 +02:00
<script lang="typescript">
import {gameManager} from "../../Phaser/Game/GameManager";
import {SelectCompanionScene, SelectCompanionSceneName} from "../../Phaser/Login/SelectCompanionScene";
2021-08-09 14:49:17 +02:00
import {menuIconVisiblilityStore, menuVisiblilityStore} from "../../Stores/MenuStore";
2021-07-12 17:39:16 +02:00
import {selectCompanionSceneVisibleStore} from "../../Stores/SelectCompanionStore";
import {LoginScene, LoginSceneName} from "../../Phaser/Login/LoginScene";
import {loginSceneVisibleStore} from "../../Stores/LoginSceneStore";
import {selectCharacterSceneVisibleStore} from "../../Stores/SelectCharacterStore";
import {SelectCharacterScene, SelectCharacterSceneName} from "../../Phaser/Login/SelectCharacterScene";
2021-08-18 11:15:46 +02:00
//import {connectionManager} from "../../Connexion/ConnectionManager";
2021-07-12 17:39:16 +02:00
function disableMenuStores(){
2021-08-09 14:49:17 +02:00
menuVisiblilityStore.set(false);
menuIconVisiblilityStore.set(false);
2021-07-12 17:39:16 +02:00
}
2021-08-09 14:49:17 +02:00
2021-07-12 17:39:16 +02:00
function openEditCompanionScene(){
disableMenuStores();
selectCompanionSceneVisibleStore.set(true);
gameManager.leaveGame(SelectCompanionSceneName,new SelectCompanionScene());
}
function openEditNameScene(){
disableMenuStores();
loginSceneVisibleStore.set(true);
gameManager.leaveGame(LoginSceneName,new LoginScene());
}
function openEditSkinScene(){
disableMenuStores();
selectCharacterSceneVisibleStore.set(true);
gameManager.leaveGame(SelectCharacterSceneName,new SelectCharacterScene());
}
2021-08-18 11:15:46 +02:00
//TODO: Uncomment when login will be completely developed
/*function clickLogin() {
2021-08-09 14:49:17 +02:00
connectionManager.loadOpenIDScreen();
2021-08-18 11:15:46 +02:00
}*/
2021-08-09 14:49:17 +02:00
2021-07-12 17:39:16 +02:00
</script>
2021-08-09 14:49:17 +02:00
<div class="customize-main">
2021-07-12 17:39:16 +02:00
<section>
2021-08-09 14:49:17 +02:00
<button type="button" class="nes-btn" on:click|preventDefault={openEditNameScene}>Edit Name</button>
2021-07-12 17:39:16 +02:00
</section>
<section>
2021-08-09 14:49:17 +02:00
<button type="button" class="nes-btn is-rounded" on:click|preventDefault={openEditSkinScene}>Edit Skin</button>
2021-07-12 17:39:16 +02:00
</section>
2021-08-09 14:49:17 +02:00
<section>
<button type="button" class="nes-btn" on:click|preventDefault={openEditCompanionScene}>Edit Companion</button>
2021-07-12 17:39:16 +02:00
</section>
2021-08-18 11:15:46 +02:00
<!-- <section>
2021-08-09 14:49:17 +02:00
<button type="button" class="nes-btn is-primary" on:click|preventDefault={clickLogin}>Login</button>
2021-08-18 11:15:46 +02:00
</section>-->
2021-08-09 14:49:17 +02:00
</div>
2021-07-12 17:39:16 +02:00
<style lang="scss">
2021-08-09 14:49:17 +02:00
div.customize-main{
section {
display: flex;
justify-content: center;
align-items: center;
2021-08-18 11:15:46 +02:00
margin-bottom: 20px;
2021-07-12 17:39:16 +02:00
2021-08-09 14:49:17 +02:00
button {
2021-08-17 14:44:43 +02:00
height: 50px;
width: 250px;
2021-08-09 14:49:17 +02:00
}
}
}
2021-08-17 14:44:43 +02:00
2021-08-18 15:34:26 +02:00
@media only screen and (max-width: 800px) {
2021-08-17 14:44:43 +02:00
div.customize-main section button {
width: 130px;
}
}
2021-07-12 17:39:16 +02:00
</style>