Commit 3bfac2eb authored by Max Bebök's avatar Max Bebök

chg: added crc32 to actor view

parent 78bd7d99
......@@ -109,6 +109,10 @@
<td>SRTHash</td>
<td><input class="form-control data-actor-params-SRTHash" type="text" /></td>
</tr>
<tr>
<td>CRC (MainField)</td>
<td class="data-actor-params-FieldCRC32">0</td>
</tr>
</tbody>
</table>
......
......@@ -5,6 +5,7 @@
*/
const BYAML = require("byaml-lib");
const crc32 = require("crc-32");
module.exports = class Actor
{
......@@ -42,6 +43,12 @@ module.exports = class Actor
return (this.params.SRTHash && this.params.SRTHash.value) ? this.params.SRTHash.value : 0;
}
getCRC32(prefix)
{
const idPadded = this.getHashId().toString().padStart(10, '0');
return crc32.str(prefix + "_" + this.getName() + "_" + idPadded);
}
setHandler(handler)
{
this.handler = handler;
......
......@@ -50,6 +50,8 @@ module.exports = class Actor_GUI
this.nodeCache.get(".data-actor-params-HashId").value = this.actor.params.HashId.value;
this.nodeCache.get(".data-actor-params-SRTHash").value = this.actor.params.SRTHash.value;
this.nodeCache.get(".data-actor-params-FieldCRC32").innerHTML = this.actor.getCRC32("MainField");
const modelTypeImg = this.actor.isInvisible() ? "with-model.png" : "no-model.png";
this.nodeCache.get("img.actor-model-type").setAttribute("src", "assets/img/icons/actor/" + modelTypeImg);
......
{
"name": "ice-spear-editor",
"version": "2.2.0",
"version": "2.2.1",
"license": "GPL-3.0",
"author": "Max Bebök",
"main": "main.js",
......@@ -49,6 +49,7 @@
"binary-file": "gitlab:ice-spear-tools/binary-file",
"byaml-lib": "gitlab:ice-spear-tools/byaml-lib",
"crc32": "^0.2.2",
"crc-32": "^1.2.0",
"cytoscape": "^3.2.15",
"cytoscape-cose-bilkent": "^4.0.0",
"dateformat": "^3.0.3",
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment