141 lines
3.4 KiB
C#
141 lines
3.4 KiB
C#
using System;
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
using UnityEngine.UI;
|
|
|
|
// Token: 0x0200009B RID: 155
|
|
public class CompanionDrop : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler, IPointerDownHandler, IPointerUpHandler
|
|
{
|
|
// Token: 0x06000E8B RID: 3723 RVA: 0x001160F3 File Offset: 0x001142F3
|
|
private void OnEnable()
|
|
{
|
|
}
|
|
|
|
// Token: 0x06000E8C RID: 3724 RVA: 0x001160F5 File Offset: 0x001142F5
|
|
private void Start()
|
|
{
|
|
this.EndDrag();
|
|
}
|
|
|
|
// Token: 0x06000E8D RID: 3725 RVA: 0x001160FD File Offset: 0x001142FD
|
|
public void StartDrag()
|
|
{
|
|
this.SetButton(true);
|
|
}
|
|
|
|
// Token: 0x06000E8E RID: 3726 RVA: 0x00116106 File Offset: 0x00114306
|
|
public void EndDrag()
|
|
{
|
|
this.SetButton(false);
|
|
}
|
|
|
|
// Token: 0x06000E8F RID: 3727 RVA: 0x00116110 File Offset: 0x00114310
|
|
public void SetButton(bool state)
|
|
{
|
|
new Color(0.6039216f, 0.4745098f, 0.4745098f, 0f);
|
|
this.btn.interactable = state;
|
|
this.img.raycastTarget = state;
|
|
if (state)
|
|
{
|
|
Color color = this.highlight;
|
|
ColorBlock colors = this.btn.colors;
|
|
colors.normalColor = color;
|
|
colors.selectedColor = color * 1.5f;
|
|
colors.highlightedColor = color * 1.5f;
|
|
if (!Links.x.formation.dragging)
|
|
{
|
|
Links.x.formation.ToggleHighlight(this.label1, true);
|
|
Links.x.formation.ToggleHighlight(this.label2, true);
|
|
return;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
ColorBlock colors2 = this.btn.colors;
|
|
colors2.normalColor = this.normal;
|
|
colors2.highlightedColor = this.normal;
|
|
colors2.selectedColor = this.normal;
|
|
if (Links.x.formation.hoverBox != this)
|
|
{
|
|
Links.x.formation.ToggleHighlight(this.label1, false);
|
|
Links.x.formation.ToggleHighlight(this.label2, false);
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x06000E90 RID: 3728 RVA: 0x0011624B File Offset: 0x0011444B
|
|
public void ToggleHighlight(bool state)
|
|
{
|
|
Links.x.formation.ToggleHighlight(this.label1, state);
|
|
Links.x.formation.ToggleHighlight(this.label2, state);
|
|
}
|
|
|
|
// Token: 0x06000E91 RID: 3729 RVA: 0x0011627C File Offset: 0x0011447C
|
|
public void OnPointerEnter(PointerEventData eventData)
|
|
{
|
|
if (Links.x.formation)
|
|
{
|
|
Links.x.formation.canDrop = true;
|
|
Links.x.formation.hoverBox = this;
|
|
if (Links.x.formation.dragging)
|
|
{
|
|
Links.x.formation.GetDescription(null, this);
|
|
}
|
|
}
|
|
this.ToggleHighlight(true);
|
|
}
|
|
|
|
// Token: 0x06000E92 RID: 3730 RVA: 0x001162E4 File Offset: 0x001144E4
|
|
public void OnPointerExit(PointerEventData eventData)
|
|
{
|
|
if (Links.x.formation)
|
|
{
|
|
Links.x.formation.canDrop = false;
|
|
Links.x.formation.hoverBox = null;
|
|
if (!Links.x.joy)
|
|
{
|
|
if (!Links.x.formation.selectedCharacter)
|
|
{
|
|
Links.x.formation.formationDescription = Links.x.formation.defaultText;
|
|
}
|
|
else
|
|
{
|
|
Links.x.formation.GetDescription(null, null);
|
|
}
|
|
}
|
|
}
|
|
this.ToggleHighlight(false);
|
|
}
|
|
|
|
// Token: 0x06000E93 RID: 3731 RVA: 0x0011637C File Offset: 0x0011457C
|
|
public void OnPointerUp(PointerEventData eventData)
|
|
{
|
|
}
|
|
|
|
// Token: 0x06000E94 RID: 3732 RVA: 0x0011637E File Offset: 0x0011457E
|
|
public void OnPointerDown(PointerEventData eventData)
|
|
{
|
|
}
|
|
|
|
// Token: 0x04001710 RID: 5904
|
|
public Button btn;
|
|
|
|
// Token: 0x04001711 RID: 5905
|
|
public int dropNum;
|
|
|
|
// Token: 0x04001712 RID: 5906
|
|
public Image img;
|
|
|
|
// Token: 0x04001713 RID: 5907
|
|
public Color highlight;
|
|
|
|
// Token: 0x04001714 RID: 5908
|
|
public Color normal;
|
|
|
|
// Token: 0x04001715 RID: 5909
|
|
public string label1;
|
|
|
|
// Token: 0x04001716 RID: 5910
|
|
public string label2;
|
|
}
|