Skip to content
This repository has been archived by the owner on Aug 29, 2020. It is now read-only.

Avatar clothing files #56

Merged
merged 2 commits into from
Dec 12, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Python/ki/xKIChat.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,7 @@ def __call__(self, message):
if PtIsInternalRelease():
commands.update(kCommands.Internal)
commands.update(kCommands.EasterEggs)
commands.update(kCommands.Other)

# Does the message contain a standard command?
for command, function in commands.iteritems():
Expand Down Expand Up @@ -1283,3 +1284,28 @@ def LookForFeathers(self, params):
self.chatMgr.AddChatLine(None, pOut, 0)
else:
self.chatMgr.AddChatLine(None, "There is nothing there but lint.", 0)

## Export the local avatar's clothing to a file
def SaveClothing(self, file):
if not file:
self.chatMgr.AddChatLine(None, "Usage: /loadclothing <name>", kChat.SystemMessage)
return
file = file + ".clo"
if PtGetLocalAvatar().avatar.saveClothingToFile("./" + file):
self.chatMgr.AddChatLine(None, "Outfit exported to " + file, 0)
else:
self.chatMgr.AddChatLine(None, "Could not export to " + file, kChat.SystemMessage)

## Import the local avatar's clothing from a file
def LoadClothing(self, file):
if not file:
self.chatMgr.AddChatLine(None, "Usage: /loadclothing <name>", kChat.SystemMessage)
return
if PtGetPlayerList() and not PtIsInternalRelease():
self.chatMgr.AddChatLine(None, "You have to be alone to change your clothes!", kChat.SystemMessage)
return
file = file + ".clo"
if PtGetLocalAvatar().avatar.loadClothingFromFile("./" + file):
self.chatMgr.AddChatLine(None, "Outfit imported from " + file, 0)
else:
self.chatMgr.AddChatLine(None, file + " not found", kChat.SystemMessage)
2 changes: 2 additions & 0 deletions Python/ki/xKIConstants.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ class kCommands:
"/look in pocket" : "LookForFeathers"}
Text = {"/go" : "Put one foot in front of the other and eventually you will get there.",
"/fly" : "You close your eyes, you feel light headed and the ground slips away from your feet... Then you open your eyes and WAKE UP! (Ha, you can only dream about flying.)"}
Other = {"/saveclothing" : "SaveClothing",
"/loadclothing" : "LoadClothing"}

## Numeric limits for the KI.
class kLimits:
Expand Down
8 changes: 8 additions & 0 deletions Python/plasma/Plasma.py
Original file line number Diff line number Diff line change
Expand Up @@ -1553,6 +1553,10 @@ def gotoStage(self,behaviorKey,stage,transitionTime,setTimeFlag,newTime,SetDirec
"""Tells a multistage behavior to go to a particular stage"""
pass

def loadClothingFromFile(self,filename):
"""Load avatar clothing from a file"""
pass

def netForce(self,forceFlag):
"""Specify whether this object needs to use messages that are forced to the network
- This is to be used if your Python program is running on only one client
Expand Down Expand Up @@ -1595,6 +1599,10 @@ def saveClothing(self):
"""Saves the current clothing options (including morphs) to the vault"""
pass

def saveClothingToFile(self,filename):
"""Save avatar clothing to a file"""
pass

def setMorph(self,clothing_name,layer,value):
"""Set the morph value (clipped between -1 and 1)"""
pass
Expand Down