示例#1
0
 private void openPoseSaveFile()
 {
     if (skeleton != null)
     {
         (editDock.FindNode("save_pose_dialog") as FileDialog).PopupCentered();
     }
 }
示例#2
0
    public override void _EnterTree()
    {
        GD.Print("register type");

        editDock = (VBoxContainer)GD.Load <PackedScene>("res://addons/uma/UmaSkeletonMenu.tscn").Instance();

        editDock.FindNode("save_pose").Connect("pressed", this, "openPoseSaveFile");
        (editDock.FindNode("save_pose_dialog") as FileDialog).Connect("file_selected", this, "savePose");

        editDock.FindNode("save_reciepe").Connect("pressed", this, "openReciepeSaveFile");
        (editDock.FindNode("save_reciepe_dialog") as FileDialog).Connect("file_selected", this, "saveReciepe");

        editDock.FindNode("load_reciepe").Connect("pressed", this, "openReciepeFile");
        (editDock.FindNode("load_reciepe_dialog") as FileDialog).Connect("file_selected", this, "loadReciepe");

        AddControlToContainer(CustomControlContainer.SpatialEditorSideLeft, editDock);
        editDock.Visible = false;

        AddCustomType("UMADnaHumanoid", "Resource", GD.Load <Script>("res://addons/uma/utils/UMADnaHumanoid.cs"), GD.Load <Texture>("res://addons/uma/icons/dna.png"));

        AddCustomType("UMASlotOverlayResource", "Resource", GD.Load <Script>("res://addons/uma/utils/UMASlotOverlayResource.cs"), GD.Load <Texture>("res://addons/uma/icons/slot.png"));
        AddCustomType("UMAOverlayResource", "Resource", GD.Load <Script>("res://addons/uma/utils/UMAOverlayResource.cs"), GD.Load <Texture>("res://addons/uma/icons/overlay.png"));
        AddCustomType("UMASkeleton", "Skeleton", GD.Load <Script>("res://addons/uma/utils/UMASkeleton.cs"), GD.Load <Texture>("res://addons/uma/icons/skeleton.png"));

        AddCustomType("UMAOverlay", "MeshInstance", GD.Load <Script>("res://addons/uma/utils/UMAOverlay.cs"), GD.Load <Texture>("res://addons/uma/icons/overlay.png"));

        AddSpatialGizmoPlugin(gizmoPlugin);
    }
    // Determines whether or not a joint detail
    // of the name 'JointName' is already in
    // the detail list
    private bool JointAdded(string JointName)
    {
        Node joint = jointList.FindNode(JointName);

        return(joint != null);
    }