// Patches applying art changes to crewed utility/science parts
// Contents:
// - Inline Clamp-O-Tron (dockingPortLateral)
// - Clamp-O-Tron Jr. Docking Port (dockingPort3)
// - Clamp-O-Tron Docking Port (dockingPort2)
// - Clamp-O-Tron Sr. Docking Port (dockingPortLarge)
// - Clamp-O-Tron Shielded Docking Port (dockingPort1)

// Clamp-O-Tron Jr
@PART[dockingPort3]
{
  @author = Chris Adderley (Nertea)
  !mesh = DELETE
  !MODEL {}
  MODEL
  {
    model = ReStock/Assets/Coupling/restock-docking-0625
  }
  %rescaleFactor = 1
  MODULE
  {
    name = ModuleColorChanger
    shaderProperty = _EmissiveColor
    animRate = 0.8
    animState = false
    useRate = true
    toggleInEditor = true
    toggleInFlight = true
    toggleInFlight = true
    unfocusedRange = 5
    toggleName = #autoLOC_502011 //#autoLOC_502011 = Toggle Lights
    eventOnName = #autoLOC_502012 //#autoLOC_502012 = Lights On
    eventOffName = #autoLOC_502013 //#autoLOC_502013 = Lights Off
    toggleAction = True
    defaultActionGroup = Light
    redCurve
    {
      key = 0 0 0 3
      key = 1 1 0 0
    }
    greenCurve
    {
      key = 0 0 0 1
      key = 1 1 1 0
    }
    blueCurve
    {
      key = 0 0 0 0
      key = 1 0.7 1.5 0
    }
    alphaCurve
    {
      key = 0 1
    }
  }
}

// Inline Clamp-O-Tron
@PART[dockingPortLateral]
{
  @author = Passinglurker
  !mesh = DELETE
  !MODEL {}
  MODEL
  {
    model = ReStock/Assets/Coupling/125/Re_dockingPortInline/restock-inlinedockingport-mk1-1
  }
  %rescaleFactor = 1
  %manufacturer = #autoLOC_501624
}

// Clamp-O-Tron
@PART[dockingPort2]
  {
  @author = Chris Adderley (Nertea)
  !mesh = DELETE
  !MODEL {}
  MODEL
  {
    model = ReStock/Assets/Coupling/restock-docking-125-1
  }
  MODEL
  {
    model = ReStock/Assets/Command/restock-hatch-common-round-white-1
    position = 0.0, -0.072, 0.0
    scale = 0.908,0.908,0.908
    rotation = 180, 0, 0
  }
  %rescaleFactor = 1
  MODULE
  {
    name = ModuleColorChanger
    shaderProperty = _EmissiveColor
    animRate = 0.8
    animState = false
    useRate = true
    toggleInEditor = true
    toggleInFlight = true
    toggleInFlight = true
    unfocusedRange = 5
    toggleName = #autoLOC_502011 //#autoLOC_502011 = Toggle Lights
    eventOnName = #autoLOC_502012 //#autoLOC_502012 = Lights On
    eventOffName = #autoLOC_502013 //#autoLOC_502013 = Lights Off
    toggleAction = True
    defaultActionGroup = Light
    redCurve
    {
      key = 0 0 0 3
      key = 1 1 0 0
    }
    greenCurve
    {
      key = 0 0 0 1
      key = 1 1 1 0
    }
    blueCurve
    {
      key = 0 0 0 0
      key = 1 0.7 1.5 0
    }
    alphaCurve
    {
      key = 0 1
    }
  }
}

// Clamp-O-Tron Shielded
@PART[dockingPort1]
{
  @author = Chris Adderley (Nertea)
  !mesh = DELETE
  !MODEL {}
  MODEL
  {
    model = ReStock/Assets/Coupling/restock-docking-shielded-125-1
  }
  MODEL
  {
    model = ReStock/Assets/Command/restock-hatch-common-round-white-1
    position = 0.0, -0.085, 0.0
    scale = 0.908,0.908,0.908
    rotation = 180, 0, 0
  }
  %rescaleFactor = 1
  @MODULE[ModuleAnimateGeneric]
  {
    @animationName = PortExtend
  }
  MODULE
  {
    name = ModuleColorChanger
    shaderProperty = _EmissiveColor
    animRate = 0.8
    animState = false
    useRate = true
    toggleInEditor = true
    toggleInFlight = true
    toggleInFlight = true
    unfocusedRange = 5
    toggleName = #autoLOC_502011 //#autoLOC_502011 = Toggle Lights
    eventOnName = #autoLOC_502012 //#autoLOC_502012 = Lights On
    eventOffName = #autoLOC_502013 //#autoLOC_502013 = Lights Off
    toggleAction = True
    defaultActionGroup = Light
    redCurve
    {
      key = 0 0 0 3
      key = 1 1 0 0
    }
    greenCurve
    {
      key = 0 0 0 1
      key = 1 1 1 0
    }
    blueCurve
    {
      key = 0 0 0 0
      key = 1 0.7 1.5 0
    }
    alphaCurve
    {
      key = 0 1
    }
  }
  MODULE
  {
    name = FXModuleLookAtConstraint
    // Ring
    CONSTRAINLOOKFX
    {
      targetName = DockingCylBottom01
      rotatorsName = DockingCylTop01
    }
    CONSTRAINLOOKFX
    {
      targetName = DockingCylBottom02
      rotatorsName = DockingCylTop02
    }
    CONSTRAINLOOKFX
    {
      targetName = DockingCylBottom03
      rotatorsName = DockingCylTop03
    }
    CONSTRAINLOOKFX
    {
      targetName = DockingCylBottom04
      rotatorsName = DockingCylTop04
    }
    CONSTRAINLOOKFX
    {
      targetName = DockingCylBottom05
      rotatorsName = DockingCylTop05
    }
    CONSTRAINLOOKFX
    {
      targetName = DockingCylBottom06
      rotatorsName = DockingCylTop06
    }
    CONSTRAINLOOKFX
    {
      targetName = DockingCylTop01
      rotatorsName = DockingCylBottom01
    }
    CONSTRAINLOOKFX
    {
      targetName = DockingCylTop02
      rotatorsName = DockingCylBottom02
    }
    CONSTRAINLOOKFX
    {
      targetName = DockingCylTop03
      rotatorsName = DockingCylBottom03
    }
    CONSTRAINLOOKFX
    {
      targetName = DockingCylTop04
      rotatorsName = DockingCylBottom04
    }
    CONSTRAINLOOKFX
    {
      targetName = DockingCylTop05
      rotatorsName = DockingCylBottom05
    }
    CONSTRAINLOOKFX
    {
      targetName = DockingCylTop06
      rotatorsName = DockingCylBottom06
    }
    // Doors
    CONSTRAINLOOKFX
    {
      targetName = ShldCylBottom01
      rotatorsName = ShldCylTop01
    }
    CONSTRAINLOOKFX
    {
      targetName = ShldCylTop01
      rotatorsName = ShldCylBottom01
    }
    CONSTRAINLOOKFX
    {
      targetName = ShldCylBottom02
      rotatorsName = ShldCylTop02
    }
    CONSTRAINLOOKFX
    {
      targetName = ShldCylTop02
      rotatorsName = ShldCylBottom02
    }
    CONSTRAINLOOKFX
    {
      targetName = ShldCylBottom03
      rotatorsName = ShldCylTop03
    }
    CONSTRAINLOOKFX
    {
      targetName = ShldCylTop03
      rotatorsName = ShldCylBottom03
    }
  }
}

// Clamp-O-Tron Sr
@PART[dockingPortLarge]
{
  @author = Chris Adderley (Nertea)
  !mesh = DELETE
  !MODEL {}
  MODEL
  {
    model = ReStock/Assets/Coupling/restock-docking-25-1
  }
  MODEL
  {
    model = ReStock/Assets/Command/restock-hatch-common-round-white-1
    position = 0.0, -0.085, 0.0
    scale = 0.821,0.821,0.821
    rotation = 180, 0, 0
  }
  %rescaleFactor = 1
  MODULE
  {
    name = ModuleColorChanger
    shaderProperty = _EmissiveColor
    animRate = 0.8
    animState = false
    useRate = true
    toggleInEditor = true
    toggleInFlight = true
    toggleInFlight = true
    unfocusedRange = 5
    toggleName = #autoLOC_502011 //#autoLOC_502011 = Toggle Lights
    eventOnName = #autoLOC_502012 //#autoLOC_502012 = Lights On
    eventOffName = #autoLOC_502013 //#autoLOC_502013 = Lights Off
    toggleAction = True
    defaultActionGroup = Light
    redCurve
    {
      key = 0 0 0 3
      key = 1 1 0 0
    }
    greenCurve
    {
      key = 0 0 0 1
      key = 1 1 1 0
    }
    blueCurve
    {
      key = 0 0 0 0
      key = 1 0.7 1.5 0
    }
    alphaCurve
    {
      key = 0 1
    }
  }
}