Skip to content

Commit 54bb0d0

Browse files
committed
minor code cleanups
1 parent 487803d commit 54bb0d0

4 files changed

Lines changed: 18 additions & 18 deletions

File tree

ott/ShaderRegistry.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@
1212
from ott.ShaderRegistry import ShaderRegistry
1313
render.setShader(ShaderRegistry.get('render:black_and_white'))
1414
"""
15+
from typing import Dict, Any
1516

1617
from panda3d.core import Shader
1718

1819

1920
class ShaderRegistry:
2021
# Static shader dictionary
21-
shaders = {}
22+
shaders: Dict[str, Shader] = {}
2223

2324
@staticmethod
2425
def register(identifier: str, frag: str, vert: str):

run.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
"C:/Panda3D-1.11.0-Py39-x64/python/python.exe" -m pip install -r requirements.txt
1+
"C:/Panda3D-1.11.0_off-x64/python/python.exe" -m pip install -r requirements.txt
22
:top
3-
"C:/Panda3D-1.11.0-Py39-x64/python/python.exe" -m ttle --hoods TT
3+
"C:/Panda3D-1.11.0-py39-x64/python/python.exe" -m ttle --server clash --hoods OT
44
pause
55
goto top

toontown/leveleditor/LevelEditorPanel.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1601,7 +1601,6 @@ def toggleDrive(self):
16011601
def exportToBam(self):
16021602
"""
16031603
Export level geometry as .bam
1604-
:return:
16051604
"""
16061605
path = Filename.expandFrom(userfiles).toOsSpecific()
16071606
if not os.path.isdir(path):

toontown/leveleditor/RadialMenu.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
''' Camera Radial Menu - drewcification 091720 '''
1+
""" Camera Radial Menu - drewcification 091720 """
22
from direct.directtools.DirectGeometry import *
33
from direct.gui.DirectFrame import DirectFrame, OnscreenImage, OnscreenText
44
from direct.showbase.DirectObject import DirectObject
@@ -15,19 +15,19 @@ def __init__(self, nodepath: NodePath, desc: str):
1515

1616
class RadialMenu(DirectObject):
1717
def __init__(self, *items):
18-
'''
18+
"""
1919
Initialize using the set of items specified
2020
Set of items should be passed as RadialItems
21-
'''
21+
"""
2222
DirectObject.__init__(self)
2323
# Initialize variables
24-
self.isActive = 0
25-
self.selected = 0
24+
self.isActive: bool = False
25+
self.selected: int = 0
2626

27-
self.items = items
27+
self.items: List[RadialItem] = items
2828

2929
# Load the palletized gui model
30-
gui = loader.loadModel("resources/camera_gui.bam")
30+
gui: NodePath = loader.loadModel("resources/camera_gui.bam")
3131

3232
# Create the frame
3333
self.frame = DirectFrame(geom = gui.find("**/radial_menu_bg"), parent = hidden, scale = 1.3, relief = None)
@@ -41,7 +41,7 @@ def __init__(self, *items):
4141

4242
# Load all the and calculate their positions
4343
self.itemAngle = 360 / len(items)
44-
self.itemImages = []
44+
self.itemImages: List[OnscreenImage] = []
4545
for i in range(len(items)):
4646
x = .38 * math.cos(i * deg2Rad(self.itemAngle))
4747
z = .38 * math.sin(i * deg2Rad(self.itemAngle))
@@ -50,19 +50,19 @@ def __init__(self, *items):
5050
self.itemImages.append(img)
5151

5252
def activate(self):
53-
''' Shows the menu and spawns the mouse reader task '''
53+
""" Shows the menu and spawns the mouse reader task """
5454
self.frame.reparentTo(aspect2d)
5555
taskMgr.add(self.radialTask, 'cam-radialTask')
5656
self.isActive = 1
5757

5858
def deactivate(self):
59-
''' Hides the menu and kills the mouse reader task '''
59+
""" Hides the menu and kills the mouse reader task """
6060
taskMgr.remove('cam-radialTask')
6161
self.frame.reparentTo(hidden)
6262
self.isActive = 0
6363

6464
def destroy(self):
65-
''' Destroy everything '''
65+
""" Destroy everything """
6666
self.frame.destroy()
6767
self.selector.destroy()
6868
for item in self.itemImages:
@@ -74,12 +74,12 @@ def destroy(self):
7474
del self.frame
7575
del self.selector
7676

77-
def getChoice(self):
78-
''' Convenience Function Get the selected item '''
77+
def getChoice(self) -> int:
78+
""" Convenience Function Get the selected item """
7979
return self.selected
8080

8181
def radialTask(self, task):
82-
''' Reads the mouse position and calculates which object it is looking at '''
82+
""" Reads the mouse position and calculates which object it is looking at """
8383
# Initialize these as 0 incase we can't read the mouses position
8484
mouseX = 0
8585
mouseY = 0

0 commit comments

Comments
 (0)