2021-09-25 20:00:38 +02:00
|
|
|
import React from "react";
|
|
|
|
import { use } from "../ui/Context";
|
|
|
|
import { Exploit } from "./Exploit";
|
|
|
|
|
2021-10-12 04:34:04 +02:00
|
|
|
const getComputedStyle = window.getComputedStyle;
|
2021-09-25 20:00:38 +02:00
|
|
|
export function Unclickable(): React.ReactElement {
|
|
|
|
const player = use.Player();
|
|
|
|
|
|
|
|
function unclickable(event: React.MouseEvent<HTMLDivElement>): void {
|
|
|
|
if (!event.target || !(event.target instanceof Element)) return;
|
2022-05-25 17:43:43 +02:00
|
|
|
const display = getComputedStyle(event.target ).display;
|
|
|
|
const visibility = getComputedStyle(event.target ).visibility;
|
2021-09-25 20:00:38 +02:00
|
|
|
if (display === "none" && visibility === "hidden" && event.isTrusted) player.giveExploit(Exploit.Unclickable);
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div id="unclickable" onClick={unclickable} style={{ display: "none", visibility: "hidden" }}>
|
|
|
|
Click on this to upgrade your Source-File -1!
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|