Skip to content

Instantly share code, notes, and snippets.

@brownan
Created December 5, 2011 19:18
Show Gist options
  • Save brownan/1434861 to your computer and use it in GitHub Desktop.
Save brownan/1434861 to your computer and use it in GitHub Desktop.
Another overviewer configuration mockup idea
# Each render is declared by an entry in the renders dictionary. Tiles
# outputted go into a directory named by the dictionary key
# The following two declarations define renders for one world, but two
# rendermodes. They are both defined explicitly here and linked together below.
renders["world-smooth-lighting"] = {
"name": "Day",
"worldpath": "/opt/mc/server/world",
"rendermode": "smooth-lighting"
"north-direction": "upper-left",
}
renders["world-smooth-night"] = {
"name": "Night",
"worldpath": "/opt/mc/server/world",
"rendermode": "smooth-night"
"north-direction": "upper-left",
}
# The worldgroups dictionary maps world names to tile directories (which are
# the keys to the renders dictionary)
# This configures the interface. Each world name becomes an item in a drop down
# box, and each value given is represented by a button along the top of the
# page, whose text comes from the corresponding render's "name" attribute.
worldgroups = {
"Creative World": ["world-smooth-lighting", "world-smooth-night"],
}
# Declare another world to render, but with only one rendermode, and with different orientations
renders["survival-upper-left"] = {
# No need for a "name" attribute since this is the only rendermode here
"worldpath": "/opt/mc/server/survivalworld",
"rendermode": "smooth-lighting"
"north-direction": "upper-left",
# The rotate-right attribute tells the interface to add a "clockwise"
# button which, when clicked, displays this render. Similarly for
# rotate-left
"rotate-right": "survival-upper-right",
"rotate-left": "survival-upper-left",
}
renders["survival-upper-right"] = dict(renders["survival-upper-left"])
renders["survival-upper-right"]["north-direction"] = "upper-right"
renders["survival-upper-right"]["rotate-right"] = "lower-right"
renders["survival-upper-right"]["rotate-left"] = "upper-left"
renders["survival-lower-right"] = dict(renders["survival-upper-left"])
renders["survival-lower-right"]["north-direction"] = "lower-right"
renders["survival-lower-right"]["rotate-right"] = "lower-right"
renders["survival-lower-right"]["rotate-left"] = "upper-right"
renders["survival-lower-left"] = dict(renders["survival-upper-left"])
renders["survival-lower-left"]["north-direction"] = "lower-left"
renders["survival-lower-left"]["rotate-right"] = "upper-left"
renders["survival-lower-left"]["rotate-left"] = "lower-right"
# The above pattern could be simplified with a helper function such as:
renders["newcreative"] = {
"worldpath": "/opt/mc/server/newworld",
"rendermode": "smooth-lighting",
"north-direction": "upper-left",
}
create_other_orientations(renders,
"newcreative",
["upper-left", "upper-right", "lower-left", "lower-right"]
)
# That would create similar structs for each orientation, and append e.g.
# "-upper-left" to the end of the render name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment