Beispiel #1
0
        static void setAngleOfUpgrade(UpgradeUIIcon icon, float newAngle)
        {
            UpgradeDescription upgradeDescription = icon.GetDescription();

            if (upgradeDescription == null)
            {
                return;
            }

            // Old mod loading system
            upgradeDescription.SetAngleOffset(newAngle, UpgradePagesManager.TryGetModForPage(UpgradePagesManager.CurrentPage));

            // New mod loading system
            // upgradeDescription.SetAngleOffset(newAngle, ModsManager.Instance.GetLoadedModWithID(UpgradePagesManager.TryGetModIDForPage(UpgradePagesManager.CurrentPage)).ModReference);
        }
Beispiel #2
0
        void updateIcon(UpgradeUIIcon icon, BaseEventData eventData)
        {
            float scrollDelta = eventData.currentInputModule.input.mouseScrollDelta.y;
            float newAngle    = getAngleForIconAtCurrentPage(icon) + scrollDelta;

            setAngleOfUpgrade(icon, newAngle);

            UpgradeDescription       upgradeDescription = icon.GetDescription();
            ModdedUpgradeRepresenter upgrade            = new ModdedUpgradeRepresenter(upgradeDescription.UpgradeType, upgradeDescription.Level);

            _changedIconAngles[upgrade] = newAngle;

            Accessor.CallPrivateMethod("PopulateIcons", GameUIRoot.Instance.UpgradeUI);
            RefreshIconEventTriggers();
        }
Beispiel #3
0
        static float getAngleForIconAtCurrentPage(UpgradeUIIcon icon)
        {
            UpgradeDescription upgradeDescription = icon.GetDescription();

            return(UpgradePagesManager.GetAngleOfUpgrade(upgradeDescription.UpgradeType, upgradeDescription.Level));
        }