|
@@ -40,6 +40,7 @@ class DirectEntry(DirectFrame):
|
|
|
('extraArgs', [], None),
|
|
('extraArgs', [], None),
|
|
|
# Sounds to be used for button events
|
|
# Sounds to be used for button events
|
|
|
('rolloverSound', getDefaultRolloverSound(), self.setRolloverSound),
|
|
('rolloverSound', getDefaultRolloverSound(), self.setRolloverSound),
|
|
|
|
|
+ ('clickSound', getDefaultClickSound(), self.setClickSound),
|
|
|
)
|
|
)
|
|
|
# Merge keyword options with default options
|
|
# Merge keyword options with default options
|
|
|
self.defineoptions(kw, optiondefs)
|
|
self.defineoptions(kw, optiondefs)
|
|
@@ -105,6 +106,14 @@ class DirectEntry(DirectFrame):
|
|
|
else:
|
|
else:
|
|
|
self.guiItem.clearSound(ENTER + self.guiId)
|
|
self.guiItem.clearSound(ENTER + self.guiId)
|
|
|
|
|
|
|
|
|
|
+ def setClickSound(self):
|
|
|
|
|
+ if base.wantSfx:
|
|
|
|
|
+ clickSound = self['clickSound']
|
|
|
|
|
+ if clickSound:
|
|
|
|
|
+ self.guiItem.setSound(ACCEPT + self.guiId, clickSound)
|
|
|
|
|
+ else:
|
|
|
|
|
+ self.guiItem.clearSound(ACCEPT + self.guiId)
|
|
|
|
|
+
|
|
|
def commandFunc(self, event):
|
|
def commandFunc(self, event):
|
|
|
if self['command']:
|
|
if self['command']:
|
|
|
# Pass any extra args to command
|
|
# Pass any extra args to command
|