From 8780cc2721865975dea727d46d1b13d970ca145b Mon Sep 17 00:00:00 2001 From: firebingo Date: Wed, 13 Jun 2018 21:02:19 -0700 Subject: [PATCH] DPI is now taken into account when resizing. Added credits to mission modal. Added ability to go fullscreen. --- CHANGELOG.md | 8 ++++++ Css/main.css | 12 ++++++--- Js/Main.js | 67 +++++++++++++++++++++++++++++++++++++++++-------- Js/Player.js | 10 ++++++-- Js/Translations | 2 +- Player.html | 1 + 6 files changed, 83 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93d0555..c9ae807 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,3 +6,11 @@ Updated Pixi JS to 4.8.1. Support for custom missions. Made translations a submodule. Various fixes to xdu functions. + +## V1.2.0 (2018-06-13) + +Added title tag that updates with current mission. +Added null check for pixi sprite calculateverticies because it sometimes makes a texture invalid when it shouldn't be. This is kinda a hack and should be investigated deeper in the future. +DPI is now taken into account when resizing. +Added credits to mission modal. +Added ability to go fullscreen. \ No newline at end of file diff --git a/Css/main.css b/Css/main.css index bdef791..af07dd0 100644 --- a/Css/main.css +++ b/Css/main.css @@ -54,6 +54,8 @@ body { margin: 0; } +.flex-grow { flex-grow: 1; } + .centered { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; } .hidden { opacity: 0; } @@ -66,6 +68,8 @@ body { margin: 0; } #text-container { color: white; position: absolute; margin: auto; height: 750px; width: 1334px; font-family: 'FOT-RodinNTLGPro'; } +#text-container #fullscreen-button { position: absolute; top: 0.5rem; left: 0.5rem; font-size: 30px; line-height: 30px; opacity: 0.35; z-index: 11; } + #text-container #title { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; font-size: 20px; transition: opacity 0.3s; cursor: default; user-select: none; } #text-container #diva { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; font-size: 34px; transition: opacity 0.3s; cursor: default; user-select: none; } @@ -116,7 +120,7 @@ body { margin: 0; } #modal-container { position: fixed; z-index: 16; top: 50%; left: 50%; transform: translate(-50%, -50%); } -.modal { background-color: #393939; color: #F0F0F0; height: 400px; width: 350px; position: relative; margin: auto; display: flex; flex-direction: column; align-items: center; box-shadow: 0px 0px 20px 3px #070707; border-radius: 7px; box-sizing: border-box; padding: 10px; } +.modal { background-color: #393939; color: #F0F0F0; height: 425px; width: 350px; position: relative; margin: auto; display: flex; flex-direction: column; align-items: center; box-shadow: 0px 0px 20px 3px #070707; border-radius: 7px; box-sizing: border-box; padding: 10px; } #mission-modal { } @@ -124,15 +128,15 @@ body { margin: 0; } #mission-modal #mission-icon { display: none; margin: 10px 0 10px 0; object-fit: contain; } -#mission-modal span { max-width: 100%; word-break: break-word; max-height: 120px; overflow: auto;} +#mission-modal #mission-summary { max-width: 100%; word-break: break-word; margin-bottom: 5px; min-height: 0; overflow-y: auto; } #mission-modal .mission-title { font-weight: bold; text-align: center; } -#mission-modal #mission-ids { margin-top: auto; width: 100%; display: flex; flex-direction: column; align-items: center; } +#mission-modal #mission-ids { margin: 5px 0 5px 0; width: 100%; display: flex; flex-direction: column; align-items: center; min-height: 21px; } #mission-modal #mission-ids div { display: flex; align-items: center; } -#modal-buttons { bottom: 0; margin-top: auto; width: 100%; display: flex; justify-content: space-between; } +#modal-buttons { bottom: 0; margin-top: auto; width: 100%; display: flex; justify-content: space-between; min-height: 21px; } @media screen and (max-width: 812px) { #modal-container { top: 0; bottom: 0; left: 0; right: 0; transform: none; } diff --git a/Js/Main.js b/Js/Main.js index a3b01a1..cd18527 100644 --- a/Js/Main.js +++ b/Js/Main.js @@ -11,7 +11,7 @@ const textFunc = new TextFunctions(); let audio = undefined; //Cant create a audio context without user input. const player = new Player(pixiApp, utage, textFunc, audio, shaders); const languages = ["eng", "jpn"]; -const version = "YameteTomete XDUPlayer V1.1.0"; +const version = "YameteTomete XDUPlayer V1.2.0"; let bodyLoaded = false; let utageLoaded = false; let languagesLoaded = false; @@ -26,12 +26,17 @@ let screenh = Math.max(document.documentElement.clientHeight, window.innerHeight let screenSizeTimeout = undefined; let isMuted = false; let volume = 0.5; +let fullScreen = false; let prevMission = '{Select}'; const availableMstIds = [202070, 202013, 338001, 338002, 338003, 338004]//[202070, 202013, 338001, 338002, 338003, 338004, 338005, 338006, 338007, 338009, 338010, 338011]; function onBodyLoaded() { bodyLoaded = true; document.getElementById("title-tag").innerText = version; + document.addEventListener('webkitfullscreenchange', onFullScreenChange, false); + document.addEventListener('mozfullscreenchange', onFullScreenChange, false); + document.addEventListener('fullscreenchange', onFullScreenChange, false); + document.addEventListener('MSFullscreenChange', onFullScreenChange, false); } (function startLoad() { @@ -168,9 +173,18 @@ function missionDropDownChanged(event) { if(!mis) { console.log(`Mission ${misId} not found`); return; } let name = mis.Name; let summary = mis.SummaryText; + let credits = ""; if(utage.missionTranslations[mis.MstId]) { name = utage.missionTranslations[mis.MstId].Name || name; summary = utage.missionTranslations[mis.MstId].SummaryText || summary; + credits = utage.missionTranslations[mis.MstId].Credits || credits; + } + if(!credits) { + if(selectedLang === "eng") { + credits = "YameteTomete"; + } else { + credits = "None"; + } } let chapterSelect = '
Chapter Select: