Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Example of the data spec being used:
- This JSON defines a space where draggable CommanderModules can be dropped.
- There is a different spec for each Chassis (CommanderClass)
- The JSON is expected to be supplied by the server. (easy)
- CSS Classes are assigned to Divs such that CSS can be used for the positioning of modules
- on an img of the commander, etc.
- */
- var commanderClassDefs =
- {"supportCommander":
- {"name":"Support Commander",
- "moduleSlotDict":
- {"slot1":
- { "types": ["weapon"],
- "levels": ["Basic","Battle","Adv","KrogBasher"],
- },
- "slot2":
- { "types": ["weapon-mod", "stackable", "etc."],
- "levels": ["Battle","Adv","KrogBasher"],
- }
- }
- },
- "strikeCommander":
- {"name":"Strike Commander",
- "moduleSlotDict":
- {"slot1":
- { "types": ["weapon"],
- "levels": ["Basic","Battle","Adv","KrogBasher"],
- }
- }
- }
- };
- /* Modules use classes the same way. Images are loaded from an url supplied by the server.
- Optionally a sound effect and an overlay image can be supplied.
- Most importantly are the bounds requirements. Id like to get this right, and leave it flexibly to obvious changes in the modules
- */
- var moduleClassDict = {};
- moduleClassDict.moduleClassDefs =
- { "62":
- { "name" : "Beam Laser",
- "moduleType" : "weapon", //grey slightly
- "commanderClassRequiredList" : ["supportCommander", "strikeCommander"], //!imp
- "slotLevelRequiredList" : ["Basic"], //!important
- "maxStackable" : 1, //!important
- "otherModulesRequiredList" : [], //!important
- "tooltipKey" : "62", //nicetitles
- "imageURL": "../zklobby_summer/zero-k/trunk/mods/zk/unitpics/commweapon_beamlaser.png",
- //optional
- "equipSoundEffectURL":"",
- "dequipSoundEffectURL":"",
- "overlayImageURL":"",
- },
- "77":
- { "name" : "Concussion Shell",
- "moduleType" : "weapon", //slightly shady
- "commanderClassRequiredList" : ["strikeCommander"], //!important
- "slotLevelRequiredList" : ["Battle"], //!important
- "maxStackable" : 1, //!important
- "otherModulesRequiredList" : ["62"], //!important
- "tooltipKey" : "77", //nicetitles
- "imageURL" : "../zklobby_summer/zero-k/trunk/mods/zk/unitpics/commweapon_concussion.png"
- //optional
- "equipSoundEffectURL":"",
- "dequipSoundEffectURL":"",
- "overlayImageURL":"",
- }
- };
- /* The "moduleType" E.g.="weapon" I think needs extending a little. It would be nice to have little galleries (the red purple and turq boxes with icons in in the mockup) for each module type ("weapon", "weaponmod", "stackables", etc...), which are essentially colour coded. But there, at the moment are only two types of moduleSlot, weapon and other. Should I code so that the module slots accept "weaponmod", "stackble", "etc" all, which will leave room for more specialised moduleSlots later? Seems reasonable.
- The idea of the interface is that most of the styling is done in css. The javascript handles assigning detailed css classes to everything and managing the constraints as shown in the fields above
- Please comment
- */
Add Comment
Please, Sign In to add comment