|
@@ -1797,6 +1797,32 @@ class ScriptTerror(object):
|
|
|
|
|
|
self.state = 0
|
|
|
self.defer = None
|
|
|
+
|
|
|
+ # Verify that they have configured auto-port trading.
|
|
|
+ # Otherwise, this doesn't work!
|
|
|
+ usefirst = self.game.gamedata.get_config('Trade_UserFirst')
|
|
|
+ if usefirst is None:
|
|
|
+ usefirst = '?'
|
|
|
+ if userfirst.upper()[0] != 'Y':
|
|
|
+ self.queue_game.put(Boxes.alert("Sorry! You need to config Trade_UseFirst=Y", base="red"))
|
|
|
+ self.deactivate()
|
|
|
+ return
|
|
|
+
|
|
|
+ turns = self.game.gamedata.get_config('Trade_Turns')
|
|
|
+ if turns is None:
|
|
|
+ turns = '0'
|
|
|
+ try:
|
|
|
+ t = int(turns)
|
|
|
+ except ValueError:
|
|
|
+ self.queue_game.put(Boxes.alert("Sorry! You need to config Trade_Turns", base="red"))
|
|
|
+ self.deactivate()
|
|
|
+ return
|
|
|
+
|
|
|
+ if t < 5:
|
|
|
+ self.queue_game.put(Boxes.alert("Sorry! You need to config Trade_Turns >", base="red"))
|
|
|
+ self.deactivate()
|
|
|
+ return
|
|
|
+
|
|
|
c = coiterate(self.find_next_good_trade_pair())
|
|
|
c.addCallback(lambda unknown: self.scary())
|
|
|
|
|
@@ -2351,6 +2377,19 @@ class ProxyMenu(object):
|
|
|
d.addCallback(self.option_input)
|
|
|
d.addErrback(self.config_menu)
|
|
|
return
|
|
|
+ elif key in ('1','2','3','4','5','6','7','8','9'):
|
|
|
+ self.queue_game.put(self.c + key + self.r + self.nl)
|
|
|
+ option = int(key)
|
|
|
+ if option in self.config_opt:
|
|
|
+ # Ok, it's a valid option!
|
|
|
+ self.option_select = self.config_opt[option]
|
|
|
+ ask = PlayerInput(self.game)
|
|
|
+ d = ask.prompt("Change {0} to?".format(self.option_select), 18)
|
|
|
+ d.addCallback(self.option_entry)
|
|
|
+ # d.addErrback(self.config_menu)
|
|
|
+ return
|
|
|
+ else:
|
|
|
+ self.queue_game.put("Unknown option, sorry." + self.nl)
|
|
|
|
|
|
elif key == 'X':
|
|
|
self.queue_game.put(self.c + key + self.r + self.nl)
|