Skip to content

Conversation

@ematth
Copy link

@ematth ematth commented Nov 14, 2024

Added functionality to change the default controls without having to edit terminal-mines.c. Controls can be modified in controls.csv, and README.md also includes this change.

@joelekstrom
Copy link
Owner

joelekstrom commented Nov 25, 2024

Hey! Thanks for the contribution 😃 (and sorry for my slowness, I really don't check my github inbox often enough).

I'd be happy to merge this functionality, though in my opinion it requires some additional changes first:

  1. Please don't change the defaults to wasd - i'd prefer if the CSV file allowed you to specify multiple ones so that it would instead look like key_left:h,a
  2. The CSV parser is not using the keys, but is dependent on line order which is quite unexpected. To merge this, it would need to be changed so the lines could be placed in any order. (key_left should be able to be in the bottom of the file and still work). The way to do this would be to parse through the lines at start, match each key, and then store the values in some struct so you don't have to read from the file buffer for every key invocation.

Also, it's not actually a csv file right now, so maybe renaming it to cfg or similar would make more sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants