-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom Race loading similar to league settings loading #169
Comments
I think the neatest solution would be to load the default races from game_data.php into a races table on first install and then reference that table thereafter. New and existing races could then be added or edited fairly easily via phpMyAdmin initially without having to edit php files on the server. Longer term it would be great to create an admin page in OBBLM for race maintenance. |
I agree with the custom interface to just load it directly into the database. There should probably be a clean function to set it back to default as well. |
The game data isn't just used to populate the database, it is used in other parts of the code. I was going to make some suggestions on this, but with the little reward and high risk, I don't think a front end for this would be worth it. |
Would a races import/export function be easier or less risky to implement? e.g. edit a CSV to add races and then load it back in to OBBLM. |
CSV would be tough because of the nesting. Still OBBLM uses the $DEA array in other parts of the code, so the best flow in something like this would be: I did a test with json_encode and was able to set the entire $DEA to a json string, but then the reverse loses the constants and only brings it back as the numbers. |
I would like to suggest that instead of requiring a person edit header.php, following other custom races, adding a setting, and adding a file into the lib file, it should do something like this:
Add a setting in settings.php.
header.php parses the $settings['custom_races'] array and loads files based on the key name removing spaces and setting it to lowercase. Example: $settings['custom_races']['Apes of wrath'] loads 'lib/game_data_apesofwrath.php'
Though, I think these custom files should be in another folder that is just for custom races. custom may be a good folder name. It could allow another feature of loading custom libs if people wanted to edit lib files, but that is beyond this suggestion.
The text was updated successfully, but these errors were encountered: