Skip to content

Commit

Permalink
Merge pull request #32 from workadventure/master
Browse files Browse the repository at this point in the history
MAJ avec depot central
  • Loading branch information
DollyRamella authored Dec 14, 2024
2 parents 83e38ab + ef180ce commit 6ce859a
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 15 deletions.
14 changes: 7 additions & 7 deletions maps/9-3-4.tmj
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Expand Down Expand Up @@ -2239,40 +2239,39 @@
"name":"floorLayer",
"objects":[
{
"class":"area",
"height":23.3484848484852,
"id":20,
"name":"hallDoor",
"rotation":0,
"type":"area",
"visible":true,
"width":351.5,
"x":1792,
"y":1344
},
{
"class":"area",
"height":137.515166666667,
"id":21,
"name":"libraryDoor",
"rotation":0,
"type":"area",
"visible":true,
"width":21.0833333333333,
"x":923.666666666667,
"y":1855.32575
},
{
"class":"area",
"height":273.515166666667,
"id":22,
"name":"bankDoor",
"rotation":0,
"type":"area",
"visible":true,
"width":31.5,
"x":3264.25,
"y":1278.90908333333
},
{
"class":"variable",
"height":0,
"id":23,
"name":"isRoofVisible",
Expand All @@ -2284,6 +2283,7 @@
"value":true
}],
"rotation":0,
"type":"variable",
"visible":true,
"width":0,
"x":1964,
Expand Down Expand Up @@ -3362,7 +3362,7 @@
"value":"..\/src\/hp.ts"
}],
"renderorder":"right-down",
"tiledversion":"1.9.1",
"tiledversion":"1.11.0",
"tileheight":32,
"tilesets":[
{
Expand Down Expand Up @@ -8668,6 +8668,6 @@
}],
"tilewidth":32,
"type":"map",
"version":"1.9",
"version":"1.10",
"width":128
}
2 changes: 1 addition & 1 deletion maps/serpentard.tmj
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"height":25,
Expand Down
2 changes: 1 addition & 1 deletion public/EGFeminisme/E1.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
if (code.value && code.value === "192") {
console.log("Code is: ", code.value);
// WA.ui.modal.closeModal();
WA.player.state.saveVariable("Enigme1", 1, {public: true, persist: true, ttl: 60 * 30, scope: "room"});
WA.player.state.Enigme1 = 1;
document.getElementById("Response").style.display = "block";
document.getElementById("text").style.display = "none";
code.style.display = "none";
Expand Down
2 changes: 1 addition & 1 deletion public/EGFeminisme/E2.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
code.addEventListener("input", () => {
if (code.value && code.value === "749") {
console.log("Code is: ", code.value);
WA.player.state.saveVariable("Enigme2", 1, {public: true, persist: true, ttl: 60 * 30, scope: "room"});
WA.player.state.Enigme2 = 1;
document.getElementById("Response").style.display = "block";
document.getElementById("text").style.display = "none";
code.style.display = "none";
Expand Down
2 changes: 1 addition & 1 deletion public/EGFeminisme/E3.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
if (code.value && code.value === "493") {
console.log("Code is: ", code.value);
// WA.ui.modal.closeModal();
WA.player.state.saveVariable("Enigme3", 1, {public: true, persist: true, ttl: 60 * 30, scope: "room"});
WA.player.state.Enigme3 = 1;
document.getElementById("Response").style.display = "block";
document.getElementById("text").style.display = "none";
code.style.display = "none";
Expand Down
2 changes: 1 addition & 1 deletion public/EGFeminisme/E4B.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
code.addEventListener("input", () => {
if (code.value && code.value === "437") {
console.log("Code is: ", code.value);
WA.player.state.saveVariable("Enigme4", 1, {public: true, persist: true, ttl: 60 * 30, scope: "room"});
WA.player.state.Enigme4 = 1;
document.getElementById("Response").style.display = "block";
document.getElementById("text").style.display = "none";
code.style.display = "none";
Expand Down
2 changes: 1 addition & 1 deletion public/EGFeminisme/E5.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
code.addEventListener("input", () => {
if (code.value && (code.value === "femme" || code.value === "FEMME")) {
console.log("Code is: ", code.value);
WA.player.state.saveVariable("Enigme5", 1, {public: true, persist: true, ttl: 60 * 30, scope: "room"});
WA.player.state.Enigme5 = 1;
document.getElementById("Response").style.display = "block";
document.getElementById("text").style.display = "none";
code.style.display = "none";
Expand Down
16 changes: 14 additions & 2 deletions src/EGFeminisme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,31 @@ console.info('Script started successfully');
WA.onInit().then(async() => {
// Disable tutotial
WA.player.state.tutorialDone = true;
WA.controls.restorePlayerProximityMeeting();
const url = new URL(WA.room.mapURL);

WA.room.onEnterLayer('to-hall').subscribe(() => {
WA.ui.actionBar.removeButton("Tableau");
WA.ui.actionBar.removeButton("Briefing");
});

for (let i = 1; i < 6; i++) {
console.log(`Saving variable Enigme${i}`);
WA.player.state.saveVariable(`Enigme${i}`, 0, {public: true, persist: true, ttl: 60 * 35, scope: "room"});
console.log(`Saved variable Enigme${i} as`, WA.player.state.loadVariable(`Enigme${i}`));
}

WA.players.onVariableChange("Enigme1").subscribe((event) => {WA.player.state.Enigme1 = event.value});
WA.players.onVariableChange("Enigme2").subscribe((event) => {WA.player.state.Enigme2 = event.value});
WA.players.onVariableChange("Enigme3").subscribe((event) => {WA.player.state.Enigme3 = event.value});
WA.players.onVariableChange("Enigme4").subscribe((event) => {WA.player.state.Enigme4 = event.value});
WA.players.onVariableChange("Enigme5").subscribe((event) => {WA.player.state.Enigme5 = event.value});

function enigmaCheck(zoneName :string) {
WA.room.area.onEnter(zoneName).subscribe(() => {
WA.ui.modal.openModal({
title: zoneName,
src: `${url.protocol}//${url.host}${url.protocol === 'https:' ? "/serpentard/" : '/'}EGFeminisme/${zoneName}.html`, // ligne vaudou pour ouvrir le fichier html
src: `${url.protocol}//${url.host}${url.protocol === 'https:' ? "/uni-rennes/" : '/'}EGFeminisme/${zoneName}.html`, // ligne vaudou pour ouvrir le fichier html
allowApi: true,
allow: "microphone; camera",
position: "center",
Expand Down Expand Up @@ -79,7 +91,7 @@ WA.onInit().then(async() => {
}

let tableau: CreateUIWebsiteEvent = { // tableau de bord
url: `${url.protocol}//${url.host}${url.protocol === 'https:' ? "/serpentard/" : '/'}EGFeminisme/Tableau_de_bord.html`,
url: `${url.protocol}//${url.host}${url.protocol === 'https:' ? "/uni-rennes/" : '/'}EGFeminisme/Tableau_de_bord.html`,
visible: false,
allowApi: true,
allowPolicy: "",
Expand Down

0 comments on commit 6ce859a

Please sign in to comment.