Fix style menu
This commit is contained in:
parent
ad56aafd15
commit
ed8232b0f5
3
front/dist/resources/html/gameMenuIcon.html
vendored
3
front/dist/resources/html/gameMenuIcon.html
vendored
@ -10,9 +10,12 @@
|
|||||||
background-color: black;
|
background-color: black;
|
||||||
color: white;
|
color: white;
|
||||||
border-radius: 7px;
|
border-radius: 7px;
|
||||||
|
height: 28px;
|
||||||
|
width: 28px;
|
||||||
}
|
}
|
||||||
#menuIcon button img{
|
#menuIcon button img{
|
||||||
width: 14px;
|
width: 14px;
|
||||||
|
padding-top: 4px;
|
||||||
}
|
}
|
||||||
#menuIcon section {
|
#menuIcon section {
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
|
12
front/dist/resources/html/gameQualityMenu.html
vendored
12
front/dist/resources/html/gameQualityMenu.html
vendored
@ -45,12 +45,20 @@
|
|||||||
#gameQuality section {
|
#gameQuality section {
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
}
|
}
|
||||||
|
#gameQuality section.action{
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
#gameQuality button {
|
#gameQuality button {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
background-color: black;
|
background-color: black;
|
||||||
color: white;
|
color: white;
|
||||||
border-radius: 7px;
|
border-radius: 7px;
|
||||||
padding-bottom: 4px;
|
padding-bottom: 4px;
|
||||||
|
width: 60px;
|
||||||
|
}
|
||||||
|
#gameQuality button#gameQualityFormCancel {
|
||||||
|
background-color: #c7c7c700;
|
||||||
|
color: #292929;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
@ -74,8 +82,8 @@
|
|||||||
<option value="5">Small video quality (5 fps)</option>
|
<option value="5">Small video quality (5 fps)</option>
|
||||||
</select>
|
</select>
|
||||||
</section>
|
</section>
|
||||||
<section>
|
<section class="action">
|
||||||
<button type="submit" id="gameQualityFormSubmit">Save</button>
|
<button type="submit" id="gameQualityFormSubmit">Save</button>
|
||||||
<button type="reset" id="gameQualityFormCancel">Cancel</button>
|
<button type="reset" class="close" id="gameQualityFormCancel">Cancel</button>
|
||||||
</section>
|
</section>
|
||||||
</form>
|
</form>
|
||||||
|
@ -3,6 +3,7 @@ import {SelectCharacterScene, SelectCharacterSceneName} from "../Login/SelectCha
|
|||||||
import {gameManager} from "../Game/GameManager";
|
import {gameManager} from "../Game/GameManager";
|
||||||
import {localUserStore} from "../../Connexion/LocalUserStore";
|
import {localUserStore} from "../../Connexion/LocalUserStore";
|
||||||
import {mediaManager} from "../../WebRtc/MediaManager";
|
import {mediaManager} from "../../WebRtc/MediaManager";
|
||||||
|
import {coWebsiteManager} from "../../WebRtc/CoWebsiteManager";
|
||||||
|
|
||||||
export const MenuSceneName = 'MenuScene';
|
export const MenuSceneName = 'MenuScene';
|
||||||
const gameMenuKey = 'gameMenu';
|
const gameMenuKey = 'gameMenu';
|
||||||
@ -42,7 +43,8 @@ export class MenuScene extends Phaser.Scene {
|
|||||||
this.menuElement.setOrigin(0);
|
this.menuElement.setOrigin(0);
|
||||||
this.revealMenusAfterInit(this.menuElement, 'gameMenu');
|
this.revealMenusAfterInit(this.menuElement, 'gameMenu');
|
||||||
|
|
||||||
this.gameQualityMenuElement = this.add.dom(300, -400).createFromCache(gameSettingsMenuKey);
|
let middleX = (window.innerWidth / 3) - 298;
|
||||||
|
this.gameQualityMenuElement = this.add.dom(middleX, -400).createFromCache(gameSettingsMenuKey);
|
||||||
this.revealMenusAfterInit(this.gameQualityMenuElement, 'gameQuality');
|
this.revealMenusAfterInit(this.gameQualityMenuElement, 'gameQuality');
|
||||||
|
|
||||||
this.input.keyboard.on('keyup-TAB', () => {
|
this.input.keyboard.on('keyup-TAB', () => {
|
||||||
@ -74,7 +76,7 @@ export class MenuScene extends Phaser.Scene {
|
|||||||
if (this.sideMenuOpened) return;
|
if (this.sideMenuOpened) return;
|
||||||
this.sideMenuOpened = true;
|
this.sideMenuOpened = true;
|
||||||
this.menuButton.getChildByID('openMenuButton').innerHTML = 'X';
|
this.menuButton.getChildByID('openMenuButton').innerHTML = 'X';
|
||||||
if (gameManager.getCurrentGameScene(this).connection.isAdmin()) {
|
if (gameManager.getCurrentGameScene(this).connection && gameManager.getCurrentGameScene(this).connection.isAdmin()) {
|
||||||
const adminSection = this.menuElement.getChildByID('adminConsoleSection') as HTMLElement;
|
const adminSection = this.menuElement.getChildByID('adminConsoleSection') as HTMLElement;
|
||||||
adminSection.hidden = false;
|
adminSection.hidden = false;
|
||||||
}
|
}
|
||||||
@ -103,7 +105,10 @@ export class MenuScene extends Phaser.Scene {
|
|||||||
|
|
||||||
|
|
||||||
private openGameSettingsMenu(): void {
|
private openGameSettingsMenu(): void {
|
||||||
if (this.settingsMenuOpened) return;
|
if (this.settingsMenuOpened) {
|
||||||
|
this.closeGameQualityMenu();
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.settingsMenuOpened = true;
|
this.settingsMenuOpened = true;
|
||||||
|
|
||||||
const gameQualitySelect = this.gameQualityMenuElement.getChildByID('select-game-quality') as HTMLInputElement;
|
const gameQualitySelect = this.gameQualityMenuElement.getChildByID('select-game-quality') as HTMLInputElement;
|
||||||
@ -123,9 +128,18 @@ export class MenuScene extends Phaser.Scene {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let middleY = (window.innerHeight / 3) - (257);
|
||||||
|
if(middleY < 0){
|
||||||
|
middleY = 0;
|
||||||
|
}
|
||||||
|
let middleX = (window.innerWidth / 3) - 298;
|
||||||
|
if(middleX < 0){
|
||||||
|
middleX = 0;
|
||||||
|
}
|
||||||
this.tweens.add({
|
this.tweens.add({
|
||||||
targets: this.gameQualityMenuElement,
|
targets: this.gameQualityMenuElement,
|
||||||
y: 100,
|
y: middleY,
|
||||||
|
x: middleX,
|
||||||
duration: 1000,
|
duration: 1000,
|
||||||
ease: 'Power3'
|
ease: 'Power3'
|
||||||
});
|
});
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user