Exemple #1
0
 private void OnActivateClicked(object sender, RoutedEventArgs e)
 {
     if (selectedEvent.HasRoomForReward(gameSave))
     {
         this.buttonActivate.IsEnabled = false;
         selectedEvent.GenerateReward(gameSave);
         selectedEvent.GiveReward(gameSave);
         PokeManager.CompleteEventBy(selectedEvent.ID, gameSave);
         UpdateEvents();
     }
     else
     {
         TriggerMessageBox.Show(Window.GetWindow(this),
                                "There's no room for this event, make room in your " +
                                (selectedEvent.RewardType == EventRewardTypes.Pokemon ? "PC" : "Bag") + " for the reward", "No Room"
                                );
     }
 }
Exemple #2
0
        private void LoadCompletedEvents(byte[] data)
        {
            int index = 0;
            int count = LittleEndian.ToSInt32(data, 0);

            index += 4;

            for (int i = 0; i < count; i++)
            {
                string eventID = ByteHelper.ReadString(data, index, 40);
                index += 80;
                int numEntries = LittleEndian.ToSInt32(data, index);
                index += 4;
                for (int j = 0; j < numEntries; j++)
                {
                    PokeManager.CompleteEventBy(eventID, LittleEndian.ToUInt32(data, index));
                    index += 4;
                }
            }
        }