Skip to content

Commit 2e793ea

Browse files
ComputerEliteComputerElite
authored andcommitted
many html fixes
1 parent 776f3b7 commit 2e793ea

6 files changed

Lines changed: 102 additions & 60 deletions

File tree

QuestAppVersionSwitcher/Assets/html/index.html

Lines changed: 48 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div class="header">
1313
<div style="width: 100%;">Welcome to Quest App Version Switcher</div>
1414
<div style="font-size: 80%; width: 100%;">
15-
Backing <div class="inline packageName">some game</div> up
15+
Managing <div class="inline packageName">some game</div>
1616
</div>
1717
</div>
1818
<div class="menuItem selected" section="backup">Backup</div>
@@ -31,55 +31,57 @@ <h3>Currently selected game: <div class="inline packageName">some game</div></h3
3131
<div id="patchStatus">Loading...</div>
3232
<div class="textbox" id="patchingTextBox"></div>
3333

34-
<h2>Patching options</h2>
35-
<label class="option">
36-
<label class="switch normal">
37-
<input id="externalstorage" type="checkbox" checked>
38-
<span class="slider round"></span>
34+
<div id="patchingOptions">
35+
<h2>Patching options</h2>
36+
<label class="option">
37+
<label class="switch normal">
38+
<input id="externalstorage" type="checkbox" checked>
39+
<span class="slider round"></span>
40+
</label>
41+
Add external storage permission
3942
</label>
40-
Add external storage permission
41-
</label>
42-
<br>
43-
<label class="option">
44-
<label class="switch normal">
45-
<input id="handtracking" type="checkbox" checked>
46-
<span class="slider round"></span>
43+
<br>
44+
<label class="option">
45+
<label class="switch normal">
46+
<input id="handtracking" type="checkbox" checked>
47+
<span class="slider round"></span>
48+
</label>
49+
Add hand tracking permission
4750
</label>
48-
Add hand tracking permission
49-
</label>
50-
<br>
51-
<label class="option">
52-
Hand tracking version
53-
<select id="handtrackingversion">
54-
<option value="3">V2</option>
55-
<option value="2">V1 high frequency</option>
56-
<option value="1">V1</option>
57-
</select>
58-
</label>
59-
<br>
60-
<br>
61-
<label class="option">
62-
<label class="switch normal">
63-
<input id="debug" type="checkbox" checked>
64-
<span class="slider round"></span>
51+
<br>
52+
<label class="option">
53+
Hand tracking version
54+
<select id="handtrackingversion">
55+
<option value="3">V2</option>
56+
<option value="2">V1 high frequency</option>
57+
<option value="1">V1</option>
58+
</select>
6559
</label>
66-
Add Debug option
67-
</label>
68-
<br>
69-
<br>
70-
<input type="text" id="otherName" placeholder="permission name">
71-
<br>
72-
<br>
73-
<div class="button" onclick="AddPermission()">Add Permission</div>
74-
<br>
75-
<div id="other">
76-
60+
<br>
61+
<br>
62+
<label class="option">
63+
<label class="switch normal">
64+
<input id="debug" type="checkbox" checked>
65+
<span class="slider round"></span>
66+
</label>
67+
Add Debug option
68+
</label>
69+
<br>
70+
<br>
71+
<input type="text" id="otherName" placeholder="permission name">
72+
<br>
73+
<br>
74+
<div class="button" onclick="AddPermission()">Add Permission</div>
75+
<br>
76+
<div id="other">
77+
</div>
7778
</div>
79+
7880
</div>
7981
<div class="contentItem hidden" id="mods">
80-
<div class="button" onclick="LaunchApp()">Launch Game</div>
8182
<b>Please note that mod installation is in early access and there may be issues. If you experience issues please report them on the OculusDB Discord Server at <code>discord.gg/zwRfHQN2UY</code></b>
82-
<div class="button" id="installModButton" onclick="UploadMod()">Install a Mod from Disk</div>
83+
<div class="button topMargin" onclick="LaunchApp()">Launch Game</div>
84+
<div class="button topButtonMargin" id="installModButton" onclick="UploadMod()">Install a Mod from Disk</div>
8385
<div id="operations">
8486
<h2 id="ongoingCount">Ongoing operations:</h2>
8587
<div class="loaderContainer" style="margin-bottom: 10px;">
@@ -113,7 +115,8 @@ <h2>Cosmetics type</h2>
113115
<select id="cosmeticsType">
114116

115117
</select>
116-
<div class="infiniteList" style="margin-top: 20px;" id="cosmeticsList">
118+
<div id="availableAfterModdingTypes" style="display: none;">Types available after modding: </div>
119+
<div class="infiniteList topMargin" id="cosmeticsList">
117120

118121
</div>
119122
</div>
@@ -135,7 +138,7 @@ <h2>You can download mods and cosmetics from the following sites. Only QMods are
135138
<div class="button" id="changeApp2">Change app</div>
136139
<div class="buttonLabel">Change the app you want to manage</div>
137140
</div>
138-
<div>Backups of <div class="inline packageName">some game</div> (<div id="size" class="inline"></div>)</div>
141+
<div class="topMargin">Backups of <div class="inline packageName">some game</div> (<div id="size" class="inline"></div>)</div>
139142
<div class="smallListContainer">
140143
<div id="backupList" class="list">
141144
</div>

QuestAppVersionSwitcher/Assets/html/script.js

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,30 @@ function UpdateCosmeticsTypes() {
7070
cosmeticsTypeSelect.innerHTML = `<option class="listItem" value="null">No types found</option>`;
7171
return;
7272
}
73+
var fvalue = cosmeticsTypeSelect.value
7374
var html = ""
75+
var htmlAvailableAfterModding = ""
7476
for(const [key, value] of Object.entries(res.fileTypes)) {
75-
html += `<option class="listItem" value="${value.fileType}">${value.name}</option>`
77+
if(value.requiresModded && !isGamePatched) {
78+
if(htmlAvailableAfterModding == "") {
79+
htmlAvailableAfterModding = `After patching the game you can add: `
80+
}
81+
htmlAvailableAfterModding += `${value.name}, `
82+
} else {
83+
if(!fvalue) {
84+
fvalue = value.fileType
85+
}
86+
html += `<option class="listItem" value="${value.fileType}">${value.name}</option>`
87+
}
7688
}
89+
document.getElementById("availableAfterModdingTypes").style.display = htmlAvailableAfterModding != "" ? "block" : "none"
90+
document.getElementById("availableAfterModdingTypes").innerHTML = htmlAvailableAfterModding.substring(0, htmlAvailableAfterModding.length - 2)
7791
cosmeticsTypeSelect.innerHTML = html;
92+
if(html == "") {
93+
cosmeticsTypeSelect.innerHTML = `<option class="listItem" value="null">No types found</option>`;
94+
}
95+
if(!fvalue) fvalue = "null"
96+
cosmeticsTypeSelect.value = fvalue
7897
UpdateShownCosmetics()
7998
}))
8099
}
@@ -121,6 +140,9 @@ function UpdateVersion(version) {
121140
currentGameVersion = version
122141
}
123142

143+
var isGamePatched = false
144+
const patchingOptions = document.getElementById("patchingOptions")
145+
124146
function UpdatePatchingStatus() {
125147
if(patchInProgress) {
126148
return;
@@ -129,21 +151,26 @@ function UpdatePatchingStatus() {
129151
fetch("/patching/getmodstatus").then(res => {
130152
res.json().then(res => {
131153
UpdateVersion(res.version)
154+
isGamePatched = res.isPatched
132155
if (res.isPatched) {
133-
document.getElementById("modsButton").style.visibility = "visible"
156+
document.getElementById("modsButton").style.display = "block"
157+
patchingOptions.style.display = "none"
134158
patchStatus.innerHTML = "<h2>Game is already patched. You can install mods</h2>"
135159
} else if(!res.isInstalled) {
136160
patchStatus.innerHTML = `<h2>Game is not installed. Please restore a backup or install the app so the game can get patched</h2>`
137-
document.getElementById("modsButton").style.visibility = "hidden"
161+
patchingOptions.style.display = "none"
162+
document.getElementById("modsButton").style.display = "none"
138163
} else if(res.canBePatched) {
139164
patchStatus.innerHTML = `<h2>Game is not patched.</h2>
140165
<div class="button" onclick="PatchGame()">Patch it now</div>`
141-
document.getElementById("modsButton").style.visibility = "hidden"
166+
patchingOptions.style.display = "block"
167+
document.getElementById("modsButton").style.display = "none"
142168
} else {
143169
patchStatus.innerHTML = "<h2>Game can not be modded</h2>"
144-
document.getElementById("modsButton").style.visibility = "hidden"
170+
patchingOptions.style.display = "none"
171+
document.getElementById("modsButton").style.display = "none"
145172
}
146-
173+
UpdateCosmeticsTypes()
147174
if(!IsOnQuest() && !res.isPatched && false) {
148175
patchStatus.innerHTML = "<h2>To mod your game open QuestAppVersionSwitcher on your Quest</h2>"
149176
return;
@@ -191,11 +218,17 @@ function UpdateModsAndLibs() {
191218
for(const mod of res.mods){
192219
mods += FormatMod(mod, !operationsOngoing)
193220
}
221+
if(mods == "") {
222+
mods = `<div class="mod" style="padding: 20px;">None installed</div>`
223+
}
194224
document.getElementById("modsList").innerHTML = mods
195225
var libs = ``
196226
for(const mod of res.libs){
197227
libs += FormatMod(mod, !operationsOngoing)
198228
}
229+
if(libs == "") {
230+
libs = `<div class="mod" style="padding: 20px;">None installed</div>`
231+
}
199232
document.getElementById("libsList").innerHTML = libs
200233
})
201234
})

QuestAppVersionSwitcher/Assets/html/style.css

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,10 @@ body {
293293
background-color: #1a83da;
294294
}
295295

296+
.topMargin {
297+
margin-top: 20px;
298+
}
299+
296300
.sidebar {
297301
background-color: #242424;
298302
width: fit-content;
@@ -311,7 +315,6 @@ body {
311315

312316
.contentItem {
313317
height: 100%;
314-
width: 100%;
315318
padding: 20px;
316319
}
317320

@@ -332,6 +335,8 @@ body {
332335

333336
.menuItem {
334337
padding: 20px;
338+
padding-top: 15px;
339+
padding-bottom: 15px;
335340
display: flex;
336341
align-items: center;
337342
color: #FFFFFF;
@@ -594,12 +599,10 @@ iframe {
594599
}
595600

596601
.smallListContainer {
597-
padding: 10px;
598602
display: flex;
599603
align-items: center;
600604
width: 90%;
601-
max-height: 300;
602-
overflow-y: scroll;
605+
max-height: 300px;
603606
}
604607

605608
.listItem {
@@ -652,12 +655,14 @@ code {
652655
display: flex;
653656
}
654657

655-
656-
657658
.buttonMargin {
658659
margin-left: 20px;
659660
}
660661

662+
.topButtonMargin {
663+
margin-top: 10px;
664+
}
665+
661666
.restoreStep {
662667
padding: 20px;
663668
background-color: #1F1F1F;

QuestAppVersionSwitcher/Cosmetics/Cosmetics.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ public class CosmeticType
120120
public string name { get; set; } = "Unknown";
121121
public string fileType { get; set; } = "Unknown";
122122
public string directory { get; set; } = "";
123+
public bool requiresModded { get; set; } = true;
123124

124125
public void InstallCosmetic(string currentPath, bool deleteOriginalFile = true)
125126
{

QuestAppVersionSwitcher/Properties/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.9.1" package="com.ComputerElite.questappversionswitcher" android:installLocation="preferExternal" android:versionCode="39">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.9.2" package="com.ComputerElite.questappversionswitcher" android:installLocation="preferExternal" android:versionCode="40">
33
<uses-sdk android:minSdkVersion="28" android:targetSdkVersion="29" />
44
<uses-permission android:name="oculus.permission.handtracking" />
55
<uses-permission android:name="com.oculus.permission.HAND_TRACKING" />

QuestAppVersionSwitcher/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@
2222
// Minor Version
2323
// Build Number
2424
// Revision
25-
[assembly: AssemblyVersion("1.9.1.0")]
26-
[assembly: AssemblyFileVersion("1.9.1.0")]
25+
[assembly: AssemblyVersion("1.9.2.0")]
26+
[assembly: AssemblyFileVersion("1.9.2.0")]

0 commit comments

Comments
 (0)