From 4ae4a6e3e454150a766a429bba7c3e8682a17651 Mon Sep 17 00:00:00 2001 From: Open Toontown Date: Sun, 10 Nov 2019 21:25:06 -0500 Subject: [PATCH] general: Loads to Pick A Toon (forced) --- libotp/settings/Settings.py | 8 ++++++++ otp/distributed/OTPClientRepository.py | 13 ++++++++++--- otp/otpbase/PythonUtil.py | 10 +++++++++- toontown/toontowngui/TeaserPanel.py | 5 ++--- 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/libotp/settings/Settings.py b/libotp/settings/Settings.py index 568fc4f..9764b1b 100644 --- a/libotp/settings/Settings.py +++ b/libotp/settings/Settings.py @@ -34,3 +34,11 @@ class Settings: @staticmethod def getResolution(): return 1 + + @staticmethod + def getEmbeddedMode(): + return 0 + + @staticmethod + def doSavedSettingsExist(): + return 0 diff --git a/otp/distributed/OTPClientRepository.py b/otp/distributed/OTPClientRepository.py index cc21d13..d0f52a3 100644 --- a/otp/distributed/OTPClientRepository.py +++ b/otp/distributed/OTPClientRepository.py @@ -950,12 +950,19 @@ class OTPClientRepository(ClientRepositoryBase): @report(types=['args', 'deltaStamp'], dConfigParam='teleport') def enterWaitForAvatarList(self): - self.handler = self.handleWaitForAvatarList + if not self.astronSupport: + self.handler = self.handleWaitForAvatarList self._requestAvatarList() @report(types=['args', 'deltaStamp'], dConfigParam='teleport') def _requestAvatarList(self): - self.sendGetAvatarsMsg() + if not self.astronSupport: + self.sendGetAvatarsMsg() + else: + # TODO SET UP PROPERLY + #self.astronLoginManager.sendRequestAvatarList() + self.avList = [] + self.loginFSM.request('chooseAvatar', [self.avList]) self.waitForDatabaseTimeout(requestName='WaitForAvatarList') self.acceptOnce(OtpAvatarManager.OtpAvatarManager.OnlineEvent, self._requestAvatarList) @@ -2241,7 +2248,7 @@ class OTPClientRepository(ClientRepositoryBase): break else: - self.notify.warning('Received generate from %d for %d:%d, which is not a part of any existing interests!' % (doId, parentId, zoneId)) + self.notify.warning('Received generate for %d from %d:%d, which is not a part of any existing interests!' % (doId, parentId, zoneId)) interest = None if not interest or not interest.events: diff --git a/otp/otpbase/PythonUtil.py b/otp/otpbase/PythonUtil.py index 7d89eee..1dd81db 100644 --- a/otp/otpbase/PythonUtil.py +++ b/otp/otpbase/PythonUtil.py @@ -1,7 +1,7 @@ import __builtin__ import sys -__all__ = ['enumerate', 'nonRepeatingRandomList', 'describeException', 'pdir'] +__all__ = ['enumerate', 'nonRepeatingRandomList', 'describeException', 'pdir', 'choice'] if not hasattr(__builtin__, 'enumerate'): def enumerate(L): @@ -130,6 +130,13 @@ def pdir(obj, str = None, width = None, _pdir(obj, str, width, fTruncate, lineWidth, wantPrivate) print +def choice(condition, ifTrue, ifFalse): + # equivalent of C++ (condition ? ifTrue : ifFalse) + if condition: + return ifTrue + else: + return ifFalse + def quantize(value, divisor): # returns new value that is multiple of (1. / divisor) return float(int(value * int(divisor))) / int(divisor) @@ -148,3 +155,4 @@ def isClient(): __builtin__.pdir = pdir __builtin__.isClient = isClient +__builtin__.choice = choice diff --git a/toontown/toontowngui/TeaserPanel.py b/toontown/toontowngui/TeaserPanel.py index 4c71a4b..e4d1947 100644 --- a/toontown/toontowngui/TeaserPanel.py +++ b/toontown/toontowngui/TeaserPanel.py @@ -125,7 +125,7 @@ class TeaserPanel(DirectObject): base.cr.centralLogger.writeClientEvent('velvetRope: %s' % pageName) self.browser.scrollTo(PageOrder.index(pageName)) self.cleanup() - self.dialog = TTDialog.TTDialog(parent=aspect2dp, text=TTLocalizer.TeaserTop, text_scale=TTLocalizer.TPdialog, text_align=TextNode.ACenter, text_wordwrap=TTLocalizer.TPdialogWordwrap, topPad=-0.15, midPad=1.25, sidePad=0.25, pad=(0.25, 0.25), command=self.__handleDone, fadeScreen=0.5, style=TTDialog.TwoChoice, buttonTextList=[TTLocalizer.TeaserSubscribe, TTLocalizer.TeaserContinue], button_text_scale=TTLocalizer.TPbuttonTextList, buttonPadSF=5.5, sortOrder=NO_FADE_SORT_INDEX, image=self.upsellBackground) + self.dialog = TTDialog.TTDialog(parent=aspect2dp, text=TTLocalizer.TeaserTop, text_scale=TTLocalizer.TPdialog, text_align=TextNode.ACenter, text_wordwrap=TTLocalizer.TPdialogWordwrap, topPad=-0.15, midPad=1.25, sidePad=0.25, pad=(0.25, 0.25), command=self.__handleDone, fadeScreen=0.5, style=TTDialog.TwoChoice, buttonTextList=[TTLocalizer.TeaserSubscribe, TTLocalizer.TeaserContinue], button_text_scale=TTLocalizer.TPbuttonTextList, buttonPadSF=5.5, sortOrder=DGG.NO_FADE_SORT_INDEX, image=self.upsellBackground) self.dialog.setPos(0, 0, 0.75) self.browser.reparentTo(self.dialog) base.transitions.fadeScreen(0.5) @@ -160,8 +160,7 @@ class TeaserPanel(DirectObject): class FeatureBrowser(DirectScrolledList): def __init__(self, parent = aspect2dp, **kw): - self.parent = parent - optiondefs = (('parent', self.parent, None), + optiondefs = (('parent', parent, None), ('relief', None, None), ('numItemsVisible', 1, None), ('items', [], None))