Skip to content

Commit

Permalink
fixed level editor after grid_layout() spacing change.
Browse files Browse the repository at this point in the history
  • Loading branch information
pokepetter committed Nov 1, 2024
1 parent d143f3e commit fcee2ef
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions ursina/editor/level_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,11 @@ def load(self):
target_class = imported_classes[line["class"]]


instance = target_class(**kwargs)
try:
instance = target_class(**kwargs)
except:
instance = ErrorEntity()

self.entities.append(instance)


Expand Down Expand Up @@ -1396,7 +1400,7 @@ def update_menu(self):
else:
button.text = '\n'.join(chunk_list(prefab.__name__, 5))

grid_layout(self.ui.children, origin=(0,-.5), spacing=(.05,0,0), max_x=32)
grid_layout(self.ui.children, origin=(0,-.5), spacing=(.005,0), max_x=32)



Expand Down Expand Up @@ -1796,7 +1800,7 @@ def __init__(self, **kwargs):


class InspectorButton(Button):
defaults = dict(model='quad', origin=(-.5,.5), text_origin=(-.5,0), text_color=color.light_gray, color=color.black90, highlight_color=color._32)
defaults = dict(model='quad', origin=(-.5,.5), text='?', text_origin=(-.5,0), text_color=color.light_gray, color=color.black90, highlight_color=color._32)

def __init__(self, **kwargs):
kwargs = __class__.defaults | kwargs
Expand Down Expand Up @@ -2099,12 +2103,12 @@ def on_select_asset(self, name):
else:
changes.append((index, 'model', e.model.name, name))

for e in LEVEL_EDITOR.selection:
e.model = name
if name == 'cube':
e.collider = 'cube'
else:
e.collider = None
# for e in LEVEL_EDITOR.selection:
# e.model = name
# if name == 'cube':
# e.collider = 'box'
# else:
# e.collider = None

LEVEL_EDITOR.menu_handler.state = 'None'

Expand Down

0 comments on commit fcee2ef

Please sign in to comment.