Skip to content
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

Adding Rule Based Config #34

Open
wants to merge 48 commits into
base: master
from
Open

Adding Rule Based Config #34

wants to merge 48 commits into from

Conversation

@kins-dev
Copy link
Contributor

kins-dev commented Feb 1, 2020

Adds support for rule based screen shots. Not 100% complete, but it is getting close. See todo.md for outstanding tasks.

In short, this takes the old config file format and brings it into a new format that allows much more flexibility in when, where and under what conditions a screenshot is taken. User input is validated much more strictly and fixed up inputs are given back to the user so they can see what it should be.

A sample config file:

{
  "SnapshotRules": [
    {
      "Name": "Unnamed Rule 1",
      "ZoomLevel": 0.25,
      "Directory": "Default",
      "FileName": "Default",
      "Trigger": {
        "Days": "Daily",
        "Weather": "Any",
        "Location": "Farm",
        "Key": "None",
        "StartTime": 600,
        "EndTime": 2600
      }
    },
    {
      "Name": "Unnamed Rule 2",
      "ZoomLevel": 1.0,
      "Directory": "/home/bob/SDV",
      "FileName": "Default",
      "Trigger": {
        "Days": "Daily",
        "Weather": "Any",
        "Location": "Farm",
        "Key": "None",
        "StartTime": 600,
        "EndTime": 2600
      }
    },
    {
      "Name": "Unnamed Rule 3",
      "ZoomLevel": 1.0,
      "Directory": "/home/bob/SDV",
      "FileName": "None",
      "Trigger": {
        "Days": "Daily",
        "Weather": "Any",
        "Location": "Any",
        "Key": "Multiply",
        "StartTime": 600,
        "EndTime": 2600
      }
    }
  ]
}

As I said this is not ready for prime time, maybe it should go onto a 2.0 branch. But I wanted to update the base with my structure changes.

kins-dev added 21 commits Jan 24, 2020
Fixed logo
…ley-daily-screenshot-mod into CompSciLauren-master
Using queues to wait on warp so the screen renders
Using queues to wait for ticks before moving files
Fixed issues where rules were applied incorrectly
Added documentation
Fixed exception for key commands during load screen
@kins-dev kins-dev changed the title Rules Adding Rule Based Config Feb 2, 2020
@kins-dev

This comment has been minimized.

Copy link
Contributor Author

kins-dev commented on DailyScreenshot/ModEntry.cs in 444260b Feb 2, 2020

Adding locking just to be paranoid. I don't think this will run in a multi-threaded context, but a little safety now prevents race conditions later

@kins-dev

This comment has been minimized.

Copy link
Contributor Author

kins-dev commented on DailyScreenshot/ModEntry.cs in 444260b Feb 2, 2020

Changed so the game has time to process between screenshot and moves (reduces the chance of a file locking conflict)

kins-dev added 6 commits Feb 2, 2020
Documenting new config file format
Clarifying the values
kins-dev added 9 commits Feb 2, 2020
…enshot-mod into Rules
Added more validation
Added checks for filename overlap
Addec checks for rules that will never trigger
Added dialog box on config file load failure
Added warnings on fixup
Added function documentation
Updated user documentation
Fixed spelling in user documenation
Made days work without the leading 0
Set a reasonable minimum on ZoomLevel
Fixed release build error (Verbose log only takes one parameter)
Added documentation of functions
Using FileInfo and DirectoryInfo objects
Fixed Typo
Added markdown lint
Changed builds (vscode + monodevelop)
Added helper functions
Added TODOs
@kins-dev

This comment has been minimized.

Copy link
Contributor Author

kins-dev commented Feb 5, 2020

This is feature complete, I'm now going back to optimize things like the event hooks.

kins-dev added 11 commits Feb 5, 2020
Found the overlap checking for days/months was wrong
Added space before the rule name when displaying
Added json files for testing
Added script for generating the days json file
Fixed typo
Added inactive test cases
Ran weather tests, added results
Updated todo
Test complete
Feature complete
@kins-dev

This comment has been minimized.

Copy link
Contributor Author

kins-dev commented Feb 9, 2020

So I've finished running through test cases (included) as well as getting some user input. I think this is good to go.

Added a show config.json to the config menu under DailyScreenshot Mod
Added the flash when taking a screenshot
@kins-dev

This comment has been minimized.

Copy link
Contributor Author

kins-dev commented Feb 14, 2020

You should be able to test with this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.