-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
169 lines (169 loc) · 6.62 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://docs.opencv.org/4.1.1/opencv.js" type="text/javascript"></script>
<script src="https://unpkg.com/tesseract.js@2.1.5/dist/tesseract.min.js" type="text/javascript"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
<script src="items.js" type="text/javascript"></script>
<script src="main.js" type="text/javascript"></script>
<script src="ocr.js" type="text/javascript"></script>
<script src="image.js" type="text/javascript"></script>
<script src="itemcounter.js" type="text/javascript"></script>
<script src="icons.js" type="text/javascript"></script>
<style>
#imageSrc, #imageTempl {
max-width: 300px;
}
.main {
padding: 20px;
}
.card {
margin-top: 20px;
width: 50em;
}
.results {
margin-top: 20px;
width: 100%;
min-width: 50rem;
border: 1px solid rgba(0,0,0,.125);
border-radius: 0.25rem;
}
.row {
padding: 0;
}
.image-text {
display: flex;
}
.preformatted {
/* Chrome copies formatting wierdly with Ctrl+C */
font-size: 12px;
}
</style>
</head>
<body>
<div class="container">
<div class="row justify-content-md-center">
<div class="card">
<div class="card-body">
<h5 class="card-title">Foxhole-Screenparse</h5>
<div class="card-text">
<div class="image-text">
<p class="col-md-8">
Choose a screenshot of foxhole showing a stockpile. Without uploading the screenshot to the cloud,
your browser then parses the screenshot and returns a list of items in the stockpile together with
the amount of crates stored.
</p>
<img src="example-screenshot.jpg" alt="Example screenshot" class="col-md-4" />
</div>
</div>
<div class="alert alert-warning mt-3">
<b>Current state</b><br/>
The detection works well, however rarely items are falsely reported missing.
</div>
<div class="alert alert-info">
Please report detection errors at <a href="https://discord.gg/sZs5UZf">3SP#global-hq-code-talk discord</a>.
</div>
</div>
</div>
<div class="card">
<div class="card-body">
<h5 class="card-title">Analyze your screenshot</h5>
<p class="card-text">
Save a screenshot from your stockpile. Pick your screenshot below, choose your faction and hit the button "Run it".
Your Screenshot will not be uploaded. The script analyzes the image on your computer.
</p>
<div class="inputoutput">
<img id="imageSrc" alt="No Image" hidden/>
<div class="caption"><input type="file" id="fileInputSrc" name="file" /></div>
</div>
<br/>
Search only for: <br/>
<input type="checkbox" id="colonialButton" name="filter" value="colonial">
<label for="colonialButton">Colonial items</label><br/>
<input type="checkbox" id="wardenButton" name="filter" value="warden" checked="checked">
<label for="wardenButton">Warden items</label><br/>
<br/>
Iconpack: <select id="iconpack-select" class="custom-select" id="inputGroupSelect01">
<option selected value="default">default</option>
</select>
<br/>
<br/>
<button id="run" onclick="run();" type="button" class="btn btn-primary">Run it</button>
<button id="run" onclick="abort();" type="button" class="btn btn-danger">Abort</button>
</div>
</div>
</div>
<div class="row justify-content-md-center" id="resultCard" hidden>
<div class="results">
<div class="progress m-2" hidden>
<div id="progressBar" class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" style="width: 0%;" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">0%</div>
</div>
<table class="table" id="resultTable" hidden>
<tr>
<th>
itemName
</th>
<th>
crates
</th>
<th>
supply-pyramid suggestion
</th>
<th>
supply-pyramid priority
</th>
<th>
private stockpile limit
</th>
<tr>
<td>
<pre class='preformatted' id='preformattedNames'>
</pre>
</td>
<td>
<pre class='preformatted' id='preformattedCrates'>
</pre>
</td>
<td>
<pre class='preformatted' id='preformattedPyramid'>
</pre>
</td>
<td>
<pre class='preformatted' id='preformattedPyramidPriority'>
</pre>
</td>
<td>
<pre class='preformatted' id='preformattedLimit'>
</pre>
</td>
</tr>
</table>
<div class="inputoutput">
<canvas id="canvasItem" style="background-color: black;"></canvas>
<div class="caption">canvasItem</div>
</div>
<div class="inputoutput">
<canvas id="canvasImgmatch" ></canvas>
<div class="caption">canvasImgmatch</div>
</div>
<ol id="itemlist">
</ol>
<div class="inputoutput" style="display: none;">
<canvas id="canvasTmp" ></canvas>
<div class="caption">canvasTmp</div>
</div>
</p>
</div>
</div>
</div>
<footer class="footer navbar-default text-center text-muted p-3" role="contentinfo">
<a href="https://github.com/pogobanane/foxhole-screenparse" target="_blank" class="text-muted">sources</a> via git
</footer>
<script>
loaded()
</script>
</body>
</html>