Skip to content

Commit

Permalink
Merge pull request #17 from Supalosa/react
Browse files Browse the repository at this point in the history
React frontend rewrite, add ability to drag from buttons onto the map
  • Loading branch information
Supalosa authored Nov 3, 2024
2 parents ffb4552 + 728f606 commit f8913fa
Show file tree
Hide file tree
Showing 21 changed files with 3,150 additions and 671 deletions.
32 changes: 32 additions & 0 deletions eslint.config.js
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',
},
},
)
116 changes: 7 additions & 109 deletions index.html
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>
&nbsp;
<button onclick="place()">Place NPC</button>
&nbsp;
<button onclick="setMode(0)" style="border-color: red">Player</button>
&nbsp;
<button onclick="setMode(1)" style="border-color: cyan">Serpent</button>
&nbsp;
<button onclick="setMode(2)" style="border-color: lime">Javelin</button>
&nbsp;
<button onclick="setMode(3)" style="border-color: orange">Jaguar</button>
&nbsp;
<button onclick="setMode(4, 'r')" style="border-color: purple">
Manti (Range)
</button>
&nbsp;
<button onclick="setMode(4, 'm')" style="border-color: purple">
Manti (Mage)
</button>
&nbsp;
<button onclick="setMode(5)" style="border-color: brown">Minotaur</button>
&nbsp;
<button onclick="setMode(6)" style="border-color: blue">Shockwave</button>
</div>
<div style="margin-bottom: 10px; width: 860px; text-align: center">
Toggle: &nbsp;
<!--<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: &nbsp;
<button
onclick="reset(); drawWave();"
title="hotkey: down or mousewheel up"
>
&laquo; Reset
</button>
&nbsp;
<button
onclick="toggleAutoReplay()"
id="replayAutoButton"
hidden="true"
></button>
&nbsp;
<button
onclick="step(); drawWave();"
title="hotkey: up or mousewheel down"
>
Step &raquo;
</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>
Loading

0 comments on commit f8913fa

Please sign in to comment.