Skip to content

Commit

Permalink
Pushed half the update to include Gauntlets
Browse files Browse the repository at this point in the history
  • Loading branch information
PapaSmurf-ML64 committed May 6, 2020
1 parent d885fd1 commit fc4c153
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/CustomTunicRedux/CustomTunicRedux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ interface CustomTunicRedux_Config{
kokiri: string;
goron: string;
zora: string;
gauntlets: string;
}

class CustomTunicRedux implements IPlugin {
Expand All @@ -86,6 +87,7 @@ class CustomTunicRedux implements IPlugin {
this.ModLoader.config.setData("CustomTunicRedux", "kokiri", "#1e691b");
this.ModLoader.config.setData("CustomTunicRedux", "goron", "#641400");
this.ModLoader.config.setData("CustomTunicRedux", "zora", "#003c64");
this.ModLoader.config.setData("CustomTunicRedux", "gauntlets", "#ffffff");
}
postinit(): void {
this.ModLoader.gui.openWindow(300, 300, path.resolve(__dirname, "gui", "index.html"));
Expand Down Expand Up @@ -134,6 +136,7 @@ class CustomTunicRedux implements IPlugin {
this.ModLoader.config.setData("CustomTunicRedux", "kokiri", packet.colors.kokiri, true);
this.ModLoader.config.setData("CustomTunicRedux", "goron", packet.colors.goron, true);
this.ModLoader.config.setData("CustomTunicRedux", "zora", packet.colors.zora, true);
this.ModLoader.config.setData("CustomTunicRedux", "gauntlets", packet.colors.gauntlets, true);
this.ModLoader.config.save();
}

Expand Down Expand Up @@ -208,6 +211,7 @@ class CustomTunicRedux implements IPlugin {
this.ModLoader.gui.tunnel.send("CustomTunicRedux:ColorUpdate", {tunic: "kokiri", value: this.config.kokiri});
this.ModLoader.gui.tunnel.send("CustomTunicRedux:ColorUpdate", {tunic: "goron", value: this.config.goron});
this.ModLoader.gui.tunnel.send("CustomTunicRedux:ColorUpdate", {tunic: "zora", value: this.config.zora});
this.ModLoader.gui.tunnel.send("CustomTunicRedux:ColorUpdate", {gauntlets: "gauntlets", value: this.config.gauntlets});
}

}
Expand Down
4 changes: 4 additions & 0 deletions src/CustomTunicRedux/gui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
<td><label for="zora" style="font-size: 24px;"><b>Zora Tunic:</label></td>
<td><input type="color" id="zora" name="zora" value="#003c64"></td>
</tr>
<tr>
<td><label for="gauntlet" style="font-size: 24px;"><b>Gauntlets:</b></label></td>
<td><input type="color" id="gauntlets" name="gauntlets" value="#FFFFFF"></td>
</tr>
</table>
<script>
kTunic = document.getElementsById("kokiri").value;
Expand Down
9 changes: 9 additions & 0 deletions src/CustomTunicRedux/gui/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ if (zora !== null) {
tunicValues["zora"] = zora.value;
}

let gauntlets: HTMLInputElement = document.getElementById("gauntlets") as HTMLInputElement;
if (gauntlets !== null) {
gauntletValues["gauntlets"] = gauntlets.value;
}

kokiri.onchange = () => {
tunicValues["kokiri"] = kokiri.value;
handlers.tunnel.send("forwardToML", { id: "CustomTunicRedux:DataUpdate", colors: tunicValues });
Expand All @@ -77,5 +82,9 @@ zora.onchange = () => {
tunicValues["zora"] = zora.value;
handlers.tunnel.send("forwardToML", { id: "CustomTunicRedux:DataUpdate", colors: tunicValues });
}
gauntlets.onchange = () => {
gauntletValues["gauntlets"] = gauntlets.value;
handlers.tunnel.send("forwardToML", { id: "CustomTunicRedux:DataUpdate", colors: gauntletValues });
}

module.exports = hooks;

0 comments on commit fc4c153

Please sign in to comment.