BenBenBenB / Lethal-Company-Guy-in-Chair

A UI and AHK script to help cycle through camera views in the game Lethal Company.
MIT License
2 stars 1 forks source link

Bespoke AHK Scripts #3

Open BenBenBenB opened 9 months ago

BenBenBenB commented 9 months ago

Right now, some hot keys are hard coded in. I'd like to give the option to assign hotkeys to each player.

  1. Determine the list of allowable hotkeys from AHK. See https://www.autohotkey.com/docs/v1/KeyList.htm. Ensure that only these values can be set for hotkey inputs. Ideally, we can create a reusable component for all hotkey inputs.
  2. Add column to allow users to assign hotkeys to each individual camera view for them to:
    • switch the camera to the camera view
    • ping the specific camera view (for radars)
    • flash the specific camera view (for radars)
  3. Add another place outside of the table to assign global hotkeys for:
    • cycle next
    • cycle previous
    • toggle map
    • ping current camera view
    • flash current camera view
  4. Any time a hotkey is updated, it should be made exceedingly apparent to the user that they will need to generate and run a new AHK script.
  5. Add a button to generate the AHK script based on chosen hotkeys.

    • From the table, add to the script for each row's switch/ping/flash hotkeys

      ${switch_hotkey_from_table[0]}::
      ${switch_hotkey_from_table[1]}::
      {
      SwitchToIndex({table_row_index + 1})
      }
      ; and/or
      ${ping_hotkey_from_table[0]}::
      ${ping_hotkey_from_table[1]}::
      {
      PingIndex{table_row_index + 1})
      }
    • Assign for each of the global hotkeys:

      ${button1}::
      ${button2}::
      . . .
      ${buttonN}::
      {
      the_function()
      }

Edits:

Ryan-Florida commented 9 months ago

Did away with the hard-coded hot keys but will need to incorporate the valid list of AHK keys (currently, all function keys are accounted for).

Still need to do dynamic generation (i.e., templatizing the AHK script) but that won't be too hard. Also need to alert the user (probably with a toast or something) about needing to rerun the script.

BenBenBenB commented 9 months ago

Deleted the old one, here is an updated template. Also see the .ahk script in main branch. We could replace lines starting with BESPOKE in the attached file. ahk_template.txt

BenBenBenB commented 9 months ago

We could slap a line on to the start of a template saying something like "; Generated by GuyInChair v1.0.0 on 2023-12-10" and append the bespoke hotkeys to the end of the template. No messy middle work is needed for file generation.