-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
84db1ce
commit 705bb39
Showing
6 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
import { client } from '../client' | ||
import { updatePlayerAreas } from './updatePlayerAreas' | ||
/** | ||
* Triggered when an item on the area list is clicked. | ||
* @param {HTMLElement} el | ||
*/ | ||
export function area_click(el: HTMLElement) { | ||
const area = client.areas[el.id.substr(4)].name; | ||
const area = client.areas[el.id.substring(4)].name; | ||
client.sender.sendMusicChange(area); | ||
|
||
const areaHr = document.createElement("div"); | ||
areaHr.className = "hrtext"; | ||
areaHr.textContent = `switched to ${el.textContent}`; | ||
document.getElementById("client_log")!.appendChild(areaHr); | ||
client.area = Number(el.id.substring(4)); | ||
updatePlayerAreas(client.area); | ||
} | ||
window.area_click = area_click; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { client } from '../client' | ||
import { area_click } from './areaClick'; | ||
/** | ||
* Triggered when someone switches areas | ||
* @param {Number} ownarea | ||
*/ | ||
export function updatePlayerAreas(ownarea: number) { | ||
for (let i=0; i < client.areas.length; i++) { | ||
if (i===ownarea) | ||
for (let classelement of Array.from(document.getElementsByClassName(`area${i}`) as HTMLCollectionOf<HTMLElement>)) | ||
classelement.style.display = ""; | ||
else | ||
for (let classelement of Array.from(document.getElementsByClassName(`area${i}`) as HTMLCollectionOf<HTMLElement>)) | ||
classelement.style.display = "none"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -564,6 +564,7 @@ | |
} | ||
|
||
#client_playerlist { | ||
width: 100%; | ||
overflow-y: scroll; | ||
} | ||
|
||
|