From 9327b0b086c4357148812e3acac4b159ed815b81 Mon Sep 17 00:00:00 2001
From: jams <36876904+jamsge@users.noreply.github.com>
Date: Mon, 24 Oct 2022 21:31:34 -0700
Subject: [PATCH 2/7] gui.js additions + global variable for pronouns + input
resize listeners for pronoun inputs + add pronouns to swap function + add
pronouns to clear players function + add pronouns to scoreboard json
---
Interface Source Code/src/gui.js | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/Interface Source Code/src/gui.js b/Interface Source Code/src/gui.js
index 11ed176..6bb6416 100644
--- a/Interface Source Code/src/gui.js
+++ b/Interface Source Code/src/gui.js
@@ -24,8 +24,10 @@ const viewport = document.getElementById('viewport');
const p1NameInp = document.getElementById('p1Name');
const p1TagInp = document.getElementById('p1Tag');
+const p1PronounsInp = document.getElementById('p1Pronouns');
const p2NameInp = document.getElementById('p2Name');
const p2TagInp = document.getElementById('p2Tag');
+const p2PronounsInp = document.getElementById('p2Pronouns');
const charImgP1 = document.getElementById('p1CharImg');
const charImgP2 = document.getElementById('p2CharImg');
@@ -114,6 +116,10 @@ function init() {
//resize the box whenever the user types
p1TagInp.addEventListener("input", resizeInput);
p2TagInp.addEventListener("input", resizeInput);
+
+ //resize the box whenever the user types
+ p1PronounsInp.addEventListener("input", resizeInput);
+ p2PronounsInp.addEventListener("input", resizeInput);
//set click listeners to change the "best of" status
@@ -672,18 +678,24 @@ function checkRound() {
function swap() {
let tempP1Name = p1NameInp.value;
let tempP1Team = p1TagInp.value;
+ let tempP1Pronouns = p1PronounsInp.value;
let tempP2Name = p2NameInp.value;
let tempP2Team = p2TagInp.value;
+ let tempP2Pronouns = p2PronounsInp.value;
p1NameInp.value = tempP2Name;
p1TagInp.value = tempP2Team;
+ p1PronounsInp.value = tempP2Pronouns
p2NameInp.value = tempP1Name;
p2TagInp.value = tempP1Team;
+ p2PronounsInp.value = tempP1Pronouns
changeInputWidth(p1NameInp);
changeInputWidth(p1TagInp);
+ changeInputWidth(p1PronounsInp);
changeInputWidth(p2NameInp);
changeInputWidth(p2TagInp);
+ changeInputWidth(p2PronounsInp);
let tempP1Char = charP1;
@@ -710,12 +722,16 @@ function clearPlayers() {
//clear player texts
p1TagInp.value = "";
p1NameInp.value = "";
+ p1PronounsInp.value="";
p2TagInp.value = "";
p2NameInp.value = "";
+ p2PronounsInp.value="";
changeInputWidth(p1TagInp);
changeInputWidth(p1NameInp);
+ changeInputWidth(p1PronounsInp);
changeInputWidth(p2TagInp);
changeInputWidth(p2NameInp);
+ changeInputWidth(p2PronounsInp);
//reset characters to random
document.getElementById('p1CharSelector').setAttribute('src', charPath + '/CSS/Random.png');
@@ -779,6 +795,7 @@ function writeScoreboard() {
let scoreboardJson = {
p1Name: p1NameInp.value,
p1Team: p1TagInp.value,
+ p1Pronouns: p1PronounsInp.value,
p1Character: charP1,
p1Skin: skinP1,
p1Color: colorP1,
@@ -786,6 +803,7 @@ function writeScoreboard() {
p1WL: currentP1WL,
p2Name: p2NameInp.value,
p2Team: p2TagInp.value,
+ p2Pronouns: p2PronounsInp.value,
p2Character: charP2,
p2Skin: skinP2,
p2Color: colorP2,
From 2a9e93e7debcf823e322425df5cb3ccb6a2671c4 Mon Sep 17 00:00:00 2001
From: jams <36876904+jamsge@users.noreply.github.com>
Date: Mon, 24 Oct 2022 22:40:34 -0700
Subject: [PATCH 3/7] Game Scoreboard.html addtions: + pronoun text and wrapper
element + appropriate style addtions
---
Stream Tool/Game Scoreboard.html | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/Stream Tool/Game Scoreboard.html b/Stream Tool/Game Scoreboard.html
index b070ac8..9372ed1 100644
--- a/Stream Tool/Game Scoreboard.html
+++ b/Stream Tool/Game Scoreboard.html
@@ -153,10 +153,30 @@
#p1Wrapper {
left: 5px;
}
-
+
#p2Wrapper {
right: 5px;
}
+
+ .pronouns-wrapper {
+ text-transform: none;
+ position:absolute;
+ text-align: center;
+ top:435px;
+ width: 150px;
+ height: 54px;
+ font-size:40px;
+ background-color: aqua;
+ font-family: "Deansgate";
+ }
+
+ #p1Pronouns-wrapper {
+ left: 18px;
+ }
+
+ #p2Pronouns-wrapper {
+ right: 18px;
+ }
.teams {
color: rgb(116, 116, 116);
@@ -414,6 +434,14 @@
-
- they/them
-
+
+
+
-
- it
-
+
+
+
diff --git a/Stream Tool/Resources/Scripts/Game Scoreboard.js b/Stream Tool/Resources/Scripts/Game Scoreboard.js
index 444134f..baa719c 100644
--- a/Stream Tool/Resources/Scripts/Game Scoreboard.js
+++ b/Stream Tool/Resources/Scripts/Game Scoreboard.js
@@ -12,6 +12,7 @@ let p2CharacterPrev, p2SkinPrev, p2ScorePrev, p2ColorPrev, p2wlPrev;
let bestOfPrev;
//max text sizes (used when resizing back)
+const pronounSize = '24px';
const roundSize = '32px';
const casterSize = '24px';
const twitterSize = '20px';
@@ -629,8 +630,10 @@ function updatePlayerName(wrapperID, nameID, teamID, pronounsID, pName, pTeam, p
const teamEL = document.getElementById(teamID);
teamEL.style.fontSize = '20px';
teamEL.textContent = pTeam;
- const pronounsEl = document.getElementById(pronounsID);
- pronounsEl.textContent = pPronouns;
+ const pronounsEL = document.getElementById(pronounsID);
+ pronounsEL.style.fontSize = pronounSize; // set original text size
+ pronounsEL.textContent = pPronouns; // change the actual text
+ resizeText(pronounsEL); // resize if it overflows
resizeText(document.getElementById(wrapperID)); //resize if it overflows
}
From 8f0059862ebdd9c62f81481b2303f1c201646211 Mon Sep 17 00:00:00 2001
From: jams <36876904+jamsge@users.noreply.github.com>
Date: Tue, 25 Oct 2022 14:14:48 -0700
Subject: [PATCH 7/7] fix window sizing
---
Interface Source Code/src/index.js | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/Interface Source Code/src/index.js b/Interface Source Code/src/index.js
index 772b92f..74197cc 100644
--- a/Interface Source Code/src/index.js
+++ b/Interface Source Code/src/index.js
@@ -9,13 +9,12 @@ if (require('electron-squirrel-startup')) { // eslint-disable-line global-requir
const createWindow = () => {
// Create the browser window.
const mainWindow = new BrowserWindow({
- width: 600,
- height: 300,
-
+ minHeight: 360,
minWidth: 600,
- minHeight: 300,
+ maxHeight: 360,
maxWidth: 600,
- maxHeight: 300,
+ height:360,
+ width:360,
webPreferences: {
nodeIntegration: true,