Cleanup
This commit is contained in:
parent
c69774402c
commit
4f25af45ba
|
@ -1,8 +1,4 @@
|
|||
import shutil
|
||||
import bpy
|
||||
import os
|
||||
import json
|
||||
from bpy.types import Menu, Panel, UIList
|
||||
from bpy.props import *
|
||||
|
||||
class ArmTilesheetActionListItem(bpy.types.PropertyGroup):
|
||||
|
@ -52,7 +48,7 @@ class ArmTilesheetActionListNewItem(bpy.types.Operator):
|
|||
return{'FINISHED'}
|
||||
|
||||
class ArmTilesheetActionListDeleteItem(bpy.types.Operator):
|
||||
# Delete the selected item from the list
|
||||
"""Delete the selected item from the list"""
|
||||
bl_idname = "arm_tilesheetactionlist.delete_item"
|
||||
bl_label = "Deletes an item"
|
||||
|
||||
|
@ -80,7 +76,7 @@ class ArmTilesheetActionListDeleteItem(bpy.types.Operator):
|
|||
return{'FINISHED'}
|
||||
|
||||
class ArmTilesheetActionListMoveItem(bpy.types.Operator):
|
||||
# Move an item in the list
|
||||
"""Move an item in the list"""
|
||||
bl_idname = "arm_tilesheetactionlist.move_item"
|
||||
bl_label = "Move an item in the list"
|
||||
bl_options = {'INTERNAL'}
|
||||
|
@ -88,11 +84,12 @@ class ArmTilesheetActionListMoveItem(bpy.types.Operator):
|
|||
direction: EnumProperty(
|
||||
items=(
|
||||
('UP', 'Up', ""),
|
||||
('DOWN', 'Down', ""),))
|
||||
('DOWN', 'Down', "")
|
||||
))
|
||||
|
||||
@classmethod
|
||||
def poll(self, context):
|
||||
""" Enable if there's something in the list. """
|
||||
"""Enable if there's something in the list"""
|
||||
wrd = bpy.data.worlds['Arm']
|
||||
if len(wrd.arm_tilesheetlist) == 0:
|
||||
return False
|
||||
|
@ -155,7 +152,7 @@ class ArmTilesheetListItem(bpy.types.PropertyGroup):
|
|||
default=4.0)
|
||||
|
||||
arm_tilesheetactionlist: CollectionProperty(type=ArmTilesheetActionListItem)
|
||||
arm_tilesheetactionlist_index: IntProperty(name="Index for my_list", default=0)
|
||||
arm_tilesheetactionlist_index: IntProperty(name="Index for arm_tilesheetactionlist", default=0)
|
||||
|
||||
class ARM_UL_TilesheetList(bpy.types.UIList):
|
||||
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
|
||||
|
@ -171,7 +168,7 @@ class ARM_UL_TilesheetList(bpy.types.UIList):
|
|||
layout.label(text="", icon=custom_icon)
|
||||
|
||||
class ArmTilesheetListNewItem(bpy.types.Operator):
|
||||
# Add a new item to the list
|
||||
"""Add a new item to the list"""
|
||||
bl_idname = "arm_tilesheetlist.new_item"
|
||||
bl_label = "Add a new item"
|
||||
|
||||
|
@ -182,7 +179,7 @@ class ArmTilesheetListNewItem(bpy.types.Operator):
|
|||
return{'FINISHED'}
|
||||
|
||||
class ArmTilesheetListDeleteItem(bpy.types.Operator):
|
||||
# Delete the selected item from the list
|
||||
"""Delete the selected item from the list"""
|
||||
bl_idname = "arm_tilesheetlist.delete_item"
|
||||
bl_label = "Deletes an item"
|
||||
|
||||
|
@ -206,7 +203,7 @@ class ArmTilesheetListDeleteItem(bpy.types.Operator):
|
|||
return{'FINISHED'}
|
||||
|
||||
class ArmTilesheetListMoveItem(bpy.types.Operator):
|
||||
# Move an item in the list
|
||||
"""Move an item in the list"""
|
||||
bl_idname = "arm_tilesheetlist.move_item"
|
||||
bl_label = "Move an item in the list"
|
||||
bl_options = {'INTERNAL'}
|
||||
|
@ -214,7 +211,8 @@ class ArmTilesheetListMoveItem(bpy.types.Operator):
|
|||
direction: EnumProperty(
|
||||
items=(
|
||||
('UP', 'Up', ""),
|
||||
('DOWN', 'Down', ""),))
|
||||
('DOWN', 'Down', "")
|
||||
))
|
||||
|
||||
@classmethod
|
||||
def poll(self, context):
|
||||
|
@ -255,7 +253,6 @@ class ArmTilesheetListMoveItem(bpy.types.Operator):
|
|||
return{'FINISHED'}
|
||||
|
||||
def register():
|
||||
|
||||
bpy.utils.register_class(ArmTilesheetActionListItem)
|
||||
bpy.utils.register_class(ARM_UL_TilesheetActionList)
|
||||
bpy.utils.register_class(ArmTilesheetActionListNewItem)
|
||||
|
@ -269,7 +266,7 @@ def register():
|
|||
bpy.utils.register_class(ArmTilesheetListMoveItem)
|
||||
|
||||
bpy.types.World.arm_tilesheetlist = CollectionProperty(type=ArmTilesheetListItem)
|
||||
bpy.types.World.arm_tilesheetlist_index = IntProperty(name="Index for my_list", default=0)
|
||||
bpy.types.World.arm_tilesheetlist_index = IntProperty(name="Index for arm_tilesheetlist", default=0)
|
||||
|
||||
def unregister():
|
||||
bpy.utils.unregister_class(ArmTilesheetListItem)
|
||||
|
|
Loading…
Reference in a new issue