コード例 #1
0
    public override void OnKeyUp(KButtonEvent e)
    {
        bool flag = false;

        if (e.IsAction(Action.MouseRight))
        {
            GetMouseHoverInfo(out bool is_hovering_screen, out bool is_hovering_button);
            if (is_hovering_screen)
            {
                flag = true;
                if (!is_hovering_button)
                {
                    UISounds.PlaySound(UISounds.Sound.Negative);
                }
                if (!e.Consumed)
                {
                    e.TryConsume(Action.MouseRight);
                }
            }
        }
        if (!flag)
        {
            base.OnKeyUp(e);
        }
    }
コード例 #2
0
 private void PlayHoverSound()
 {
     if (!((UnityEngine.Object)GetComponent <CellSelectionObject>() != (UnityEngine.Object)null))
     {
         UISounds.PlaySound(UISounds.Sound.Object_Mouseover);
     }
 }
コード例 #3
0
 private void OnClick(int i)
 {
     UISounds.PlaySound(UISounds.Sound.ClickObject);
     if (this.onSelect != null)
     {
         this.onSelect(toggleInfo[i]);
     }
 }
 private void Sample(int cell)
 {
     UISounds.PlaySound(UISounds.Sound.ClickObject);
     SandboxToolParameterMenu.instance.settings.Element      = Grid.Element[cell];
     SandboxToolParameterMenu.instance.settings.Mass         = Mathf.Round(Grid.Mass[cell] * 100f) / 100f;
     SandboxToolParameterMenu.instance.settings.temperature  = Mathf.Round(Grid.Temperature[cell] * 10f) / 10f;
     SandboxToolParameterMenu.instance.settings.diseaseCount = Grid.DiseaseCount[cell];
     SandboxToolParameterMenu.instance.RefreshDisplay();
 }
コード例 #5
0
    private void OpenCategoryPanel(ToggleInfo toggle_info, bool play_sound = true)
    {
        HashedString plan_category = (HashedString)toggle_info.userData;

        ClearButtons();
        buildingGroupsRoot.gameObject.SetActive(true);
        activeCategoryInfo = toggle_info;
        if (play_sound)
        {
            UISounds.PlaySound(UISounds.Sound.ClickObject);
        }
        BuildButtonList(plan_category, GroupsTransform.gameObject);
        PlanCategoryLabel.text = activeCategoryInfo.text.ToUpper();
        buildingGroupsRoot.GetComponent <ExpandRevealUIContent>().Expand(null);
    }
    protected override void OnPaintCell(int cell, int distFromOrigin)
    {
        base.OnPaintCell(cell, distFromOrigin);
        bool flag = false;

        foreach (Pickupable item in Components.Pickupables.Items)
        {
            if (!((Object)item.storage != (Object)null) && Grid.PosToCell(item) == cell && (Object)Components.LiveMinionIdentities.Items.Find((MinionIdentity match) => (Object)match.gameObject == (Object)item.gameObject) == (Object)null)
            {
                if (!flag)
                {
                    UISounds.PlaySound(UISounds.Sound.Negative);
                    PopFXManager.Instance.SpawnFX(PopFXManager.Instance.sprite_Negative, UI.SANDBOXTOOLS.CLEARFLOOR.DELETED, item.transform, 1.5f, false);
                    flag = true;
                }
                Util.KDestroyGameObject(item.gameObject);
            }
        }
    }
 private void Place(int cell)
 {
     if (Grid.IsValidBuildingCell(cell))
     {
         if (SandboxToolParameterMenu.instance.settings.Entity.PrefabID() == (Tag)MinionConfig.ID)
         {
             SpawnMinion();
         }
         else if ((Object)SandboxToolParameterMenu.instance.settings.Entity.GetComponent <Building>() != (Object)null)
         {
             BuildingDef def = SandboxToolParameterMenu.instance.settings.Entity.GetComponent <Building>().Def;
             def.Build(cell, Orientation.Neutral, null, def.DefaultElements(), 298.15f, true, -1f);
         }
         else
         {
             GameObject gameObject = GameUtil.KInstantiate(Assets.GetPrefab(SandboxToolParameterMenu.instance.settings.Entity.PrefabTag), Grid.CellToPosCBC(currentCell, Grid.SceneLayer.Creatures), Grid.SceneLayer.Creatures, null, 0);
             gameObject.SetActive(true);
         }
         UISounds.PlaySound(UISounds.Sound.ClickObject);
     }
 }
コード例 #8
0
 public override void OnLeftClickDown(Vector3 cursor_pos)
 {
     UISounds.PlaySound(UISounds.Sound.Negative);
     base.OnLeftClickDown(cursor_pos);
 }