-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from Supalosa/react
React frontend rewrite, add ability to drag from buttons onto the map
- Loading branch information
Showing
21 changed files
with
3,150 additions
and
671 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import js from '@eslint/js' | ||
import globals from 'globals' | ||
import reactHooks from 'eslint-plugin-react-hooks' | ||
import reactRefresh from 'eslint-plugin-react-refresh' | ||
import tseslint from 'typescript-eslint' | ||
|
||
export default tseslint.config( | ||
{ ignores: ['dist'] }, | ||
{ | ||
extends: [js.configs.recommended, ...tseslint.configs.recommended], | ||
files: ['**/*.{ts,tsx}'], | ||
languageOptions: { | ||
ecmaVersion: 2020, | ||
globals: globals.browser, | ||
}, | ||
plugins: { | ||
'react-hooks': reactHooks, | ||
'react-refresh': reactRefresh, | ||
}, | ||
rules: { | ||
...reactHooks.configs.recommended.rules, | ||
'react-refresh/only-export-components': [ | ||
'warn', | ||
{ allowConstantExport: true }, | ||
], | ||
// allow `var` for legacy reasons, but we should replace with `let` or `const` eventually | ||
'no-var': 'off', | ||
// LOS logic has some unused functions that we might bring back for Inferno mode | ||
'no-unused-vars': 'off', | ||
}, | ||
}, | ||
) |
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,114 +1,12 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Colosseum LOS</title> | ||
<link rel="stylesheet" href="style.css" /> | ||
</head> | ||
<body id="container"> | ||
<script type="module" src="/src/main.ts"></script> | ||
<div style="margin-bottom: 10px; width: 860px; text-align: center"> | ||
<button onclick="remove()">Clear</button> | ||
| ||
<button onclick="place()">Place NPC</button> | ||
| ||
<button onclick="setMode(0)" style="border-color: red">Player</button> | ||
| ||
<button onclick="setMode(1)" style="border-color: cyan">Serpent</button> | ||
| ||
<button onclick="setMode(2)" style="border-color: lime">Javelin</button> | ||
| ||
<button onclick="setMode(3)" style="border-color: orange">Jaguar</button> | ||
| ||
<button onclick="setMode(4, 'r')" style="border-color: purple"> | ||
Manti (Range) | ||
</button> | ||
| ||
<button onclick="setMode(4, 'm')" style="border-color: purple"> | ||
Manti (Mage) | ||
</button> | ||
| ||
<button onclick="setMode(5)" style="border-color: brown">Minotaur</button> | ||
| ||
<button onclick="setMode(6)" style="border-color: blue">Shockwave</button> | ||
</div> | ||
<div style="margin-bottom: 10px; width: 860px; text-align: center"> | ||
Toggle: | ||
<!--<button onclick="toggleNS()">N/S</button>--> | ||
<button | ||
onclick="togglePlayerLoS()" | ||
aria-label="Show the currently selected unit's Line of Sight" | ||
data-microtip-position="bottom" | ||
role="tooltip" | ||
> | ||
LoS | ||
</button> | ||
<button onClick="copySpawnURL()">Copy Spawn URL</button> | ||
<button | ||
id="copyReplayUrlButton" | ||
disabled="true" | ||
onClick="copyReplayURL()" | ||
aria-label="Copy the current tick diagram as replay (or select a segment). Max 32 ticks" | ||
data-microtip-position="bottom" | ||
role="tooltip" | ||
> | ||
Copy Replay URL | ||
</button> | ||
<input | ||
type="checkbox" | ||
id="delayFirstAttack" | ||
value="false" | ||
aria-label="NPCs will not attack for 3t after wave start" | ||
data-microtip-position="bottom" | ||
role="tooltip" | ||
/>Delay first attack by 3t | ||
<input | ||
type="checkbox" | ||
id="showVenatorBounce" | ||
value="false" | ||
aria-label="Mouse over an NPC to show nearby NPCs that a Venator bow will bounce to" | ||
data-microtip-position="bottom" | ||
role="tooltip" | ||
/>Venator | ||
</div> | ||
<div style="margin-bottom: 10px; width: 800px; text-align: center"> | ||
<span id="replayIndicator"></span> | ||
Controls: | ||
<button | ||
onclick="reset(); drawWave();" | ||
title="hotkey: down or mousewheel up" | ||
> | ||
« Reset | ||
</button> | ||
| ||
<button | ||
onclick="toggleAutoReplay()" | ||
id="replayAutoButton" | ||
hidden="true" | ||
></button> | ||
| ||
<button | ||
onclick="step(); drawWave();" | ||
title="hotkey: up or mousewheel down" | ||
> | ||
Step » | ||
</button> | ||
</div> | ||
<canvas | ||
id="map" | ||
onselectstart="return false" | ||
oncontextmenu="return false" | ||
></canvas> | ||
<p style="font-size: 12px"> | ||
Based on | ||
<a href="https://ifreedive-osrs.github.io/">ifreedive's tool</a> which is | ||
in turn based on some code from | ||
<a href="https://bistools.github.io/inferno.html">Backseat's tool</a>, | ||
adapted by | ||
<a href="https://github.com/Supalosa/osrs-colosseum">Supalosa</a> for | ||
Colosseum. | ||
<a href="https://github.com/Supalosa/osrs-colosseum/issues" | ||
>[Issue tracker]</a | ||
> | ||
</p> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.