Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- from pywmo import Wmo
- wmo_name = input('Enter WMO Filename : ');
- building = Wmo(wmo_name);
- nLight = building.num_lights;
- print("There are " + str(nLight) + " lights in this WMO.");
- while(1):
- command = input("What do you want to do ?\n\"a\" - Add a light\n\"i\" - Get informations about a light\n\"q\" - Exit\n")
- if(command == "q"):
- while(1):
- save = input("Do you want to save (yes/no) ? ")
- if save.upper() == "YES":
- print("Saving file")
- building.write_file("./output/" + wmo_name)
- break;
- elif save.upper() == "NO":
- print("Exiting without saving")
- break;
- else:
- print("You have to write \"yes\" or \"no\"");
- print("See ya later");
- sys.exit();
- elif(command == "a"):
- print("Light definition")
- light = { }
- light["flag1"] = int(input("LightType : "))
- light["flag2"] = int(input("type : "))
- light["flag3"] = int(input("useAtten : "))
- light["flag4"] = int(input("pad : "))
- light["color"] = (float(input("R : ")), float(input("G : ")), float(input("B : ")), float(input("A : ")))
- light["position"] = (float(input("X : ")), float(input("Y : ")), float(input("Z : ")))
- light["intensity"] = float(input("intensity : "))
- light["attenuation_start"] = float(input("attenuation_start : "))
- light["attenuation_stop"] = float(input("attenuation_stop : "))
- light["unknown1"] = float(input("Unknown 1 : "))
- light["unknown2"] = float(input("Unknown 2 : "))
- light["unknown3"] = float(input("Unknown 3 : "))
- light["unknown4"] = float(input("Unknown 4 : "))
- building.num_lights += 1;
- building.lights.append(light);
- print("There are " + str(len(building.groups)) + " groups")
- while(1):
- group = input("In which group do you want to reference that light ( type \"s\" to return the main menu ) ? ")
- if(group == "s"):
- break;
- group = int(group)
- if(group >= 0 and group < len(building.groups)):
- if not building.groups[group].flags & 0x200:
- building.groups[group].flags &= 0x200
- building.groups[group].light_refs = []
- building.groups[group].light_refs.append(building.num_lights)
- print("Light ref added to group " + str(group))
- else:
- print("Bad group.")
- print("Light succefully added. There are now " + str(building.num_lights) + " lights.")
- else:
- print("Unknown command")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement