Commit 8b7c1c33

Show available jobs when selecting a context object after selecting a primary object. Introduce the JobContextList to the Interface Manager

This is a big one. This extends the interface manager to show a list of possible jobs that fulfil the following criteria:

  • the object being clicked on (“context object”) exposes a list of actions
  • the currently selected (“primary”) object supports the action required by a job
  • if the job requires funds, make sure the user’s funds are sufficient

This also meant extending the whole click handling logic for objects had to be re-done and the concept of the “context object” selection had to be introduced.
On top of that the JobContextList widget was added, it still looks a little wonky and does not do much except being shown, but here it is:

Commit 4477c5d8

– add new “parameter” property on job types
– add new “supported actions” property to object types
pass both on to the appropriate python functions and change their signature accordingly

This is properly implementing the aforementioned concept of “supported actions” instead of just hard-coding it. It also adds parameters to the job definitions in order to minimise code duplication. To give a practical example here, look at the definition of the “eat” job in order to see the difference:

Commit 19cd1b6b

Make the job definition more generic and move actual job handlers to separate files

So far all (not like all that much exists yet) the job logic and general object logic were stored in the same file, the implementations for specific tasks no move to separate files. This is realised by iterating over the specified supported actions when instantiating an object (in Python) and dynamically adding the respective functions to the class:

Commit 71203ec2

Add configuration information for action points and job type icons

This adds the concept of “action points”, meaning coordinates relative to object’s position (and rotation) with which other objects may interact. Or at least the configuration to store information about them. 🙂
It further adds support for storing a path to a job type icon – neither of these settings is used – yet.

Commit 4f3466cf

Add job queues (per object) and wire everything up so that objects work through a work queue

This brings a lot of pieces together, finally not only are single jobs executed, but an arbitrary number of jobs can be queued up and executed in order, the interface in the ObjectManager looks like this for the time being:

What is still missing here is cancelling jobs, but one step at a time. 🙂
If you look carefully at the console output you can see the job queue in action:

Commit f8ef72ef

Add job wrapper class

This adds what is in essence just a container for job that is currently being executed, it is made up of

  • the JobType, that describes the full nature of the job
  • the JobContext, that stores information about the “where” and “what” to interact with
  • the JobStep, that stores information about the state of the current step being executed

This was added in preparation for the job queues which will be implemented next. As always the python mappings (and scripts) had to be adapted to support this change.