Skip to content

Commit 298a8e4

Browse files
committed
start on ui
1 parent 3654c31 commit 298a8e4

3 files changed

Lines changed: 45 additions & 4 deletions

File tree

QuestAppVersionSwitcher/Assets/html/diff/diff.html

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,47 @@
77
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,400italic,700,700italic' rel='stylesheet' type='text/css'>
88
</head>
99
<body>
10-
10+
<h1>Diff creation</h1>
11+
<h3>A interface for creating diff patches of your games. Make sure you have made backups in QAVS of the 2 versions you want to diff. Change app in the <a href="/">main ui</a></h3>
12+
Create a diff from
13+
<select id="fromList">
14+
<option value="test">1.36</option>
15+
</select>
16+
to
17+
<select id="toList">
18+
<option value="test">1.28</option>
19+
</select>
20+
<br>
21+
<button onclick="CreateDiff()">Create diff</button>
22+
<script>
23+
function CreateDiff() {
24+
var from = document.getElementById("fromList").value;
25+
var to = document.getElementById("toList").value;
26+
27+
}
28+
29+
var config = {};
30+
var backups = {}
31+
32+
PopulateBackups()
33+
function PopulateBackups() {
34+
fetch(`/api/questappversionswitcher/config`).then(res => res.json().then(c => {
35+
config = c
36+
fetch(`/api/backups?package=${config.currentApp}`).then(res => res.json().then(b => {
37+
backups = b
38+
let names = backups.backups.map(b => b.backupName)
39+
let fromList = document.getElementById("fromList")
40+
let toList = document.getElementById("toList")
41+
fromList.innerHTML = ""
42+
toList.innerHTML = ""
43+
names.forEach(n => {
44+
let option = `<option value=${n}>${n}</option>`
45+
fromList.innerHTML += option
46+
toList.innerHTML += option
47+
})
48+
}))
49+
}))
50+
}
51+
</script>
1152
</body>
1253
</html>

QuestAppVersionSwitcher/DiffDowngrading/DiffCreator.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public static DiffDowngradeEntry CreateDiff(string appId, string sourceBackup, s
3434
}
3535

3636
// The diff file is now created
37+
File.WriteAllText(outputDir + "version.json", JsonSerializer.Serialize(baseEntry));
3738
return baseEntry;
3839
}
3940

QuestAppVersionSwitcher/DiffDowngrading/DiffDowngradeEntry.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System.Collections.Generic;
2-
using Android.Graphics;
3-
using Path = System.IO.Path;
2+
using System.IO;
43

54
namespace QuestAppVersionSwitcher.DiffDowngrading
65
{
@@ -34,7 +33,7 @@ public string diffFilename
3433
{
3534
_diffFilename = value;
3635
}
37-
};
36+
}
3837

3938
public string outputFilename { get; set; } = "";
4039
public FileDiffDowngradeEntryType type = FileDiffDowngradeEntryType.Apk;

0 commit comments

Comments
 (0)