erkyrath / tworld

A choice-based shared online text environment sandbox
MIT License
72 stars 13 forks source link

Execute instancepane in a context with a location #151

Open erkyrath opened 10 years ago

erkyrath commented 10 years ago

There's no reason not to. (Right now, location() is None, but location(player) is not. This is confusing and weird.)

However, we should still pull the realm-level instancepane property, not the one from the player's location. I think this means we call find_symbol in a non-locid context, and then execute it in the normal context.

erkyrath commented 10 years ago

This is an easy change: (in the DIRTY_TOOL section of generate_update)

ctx = EvalPropContext(task, loctx=loctx, level=LEVEL_DISPLAY)

Unfortunately, this reveals a hidden assumption in the property-dependency code -- the generated description is really only meaningful within a location. (Bare-name property access creates a dependency on the prop name, but not on the location.) So this change leaves us open to an instancepane that doesn't refresh when you move.

The current system forces you to use location(player), which is awkward but not broken.

So I'm downgrading this to a suggestion. I may get back to it.