コード例 #1
0
        private void SaveClick(object sender, RoutedEventArgs e)
        {
            MainProject.SetSaveRoomReferences(AreaSelect.SelectedIndex,
                                              SaveStationListBox.SelectedIndex,
                                              RoomListBox.SelectedIndex,
                                              DoorListBox.SelectedIndex);
            MainProject.SetSaveStationValues(AreaSelect.SelectedIndex,
                                             SaveStationListBox.SelectedIndex,
                                             Tools.HexToInt(PositionInput.Text),
                                             Tools.HexToInt(SaveXInput.Text),
                                             Tools.HexToInt(SaveYInput.Text),
                                             Tools.HexToInt(SamusXInput.Text),
                                             Tools.HexToInt(SamusYInput.Text));
            int temp = SaveStationListBox.SelectedIndex;

            SaveStationListBox.ItemsSource =
                MainProject.GetSaveStationNames(AreaSelect.SelectedIndex);
            SaveStationListBox.SelectedIndex = temp;
            SaveStationListBox.ScrollIntoView(SaveStationListBox.SelectedItem);
            ChangesMade = false;
        }
コード例 #2
0
        private void SaveStation_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            SaveStationListBox.ScrollIntoView(SaveStationListBox.SelectedItem);
            if (SaveStationListBox.SelectedIndex == -1)
            {
                RoomGrid.IsEnabled = false;
                DoorGrid.IsEnabled = false;
            }
            else
            {
                RoomGrid.IsEnabled = true;
                DoorGrid.IsEnabled = true;
            }

            RoomListBox.ItemsSource = MainProject.GetRoomNames(AreaSelect.SelectedIndex);
            MainProject.GetSaveStationRoomDoor(AreaSelect.SelectedIndex,
                                               SaveStationListBox.SelectedIndex,
                                               out RoomIndex, out DoorIndex);
            RoomListBox.SelectedIndex = RoomIndex;
            DoorListBox.ItemsSource   =
                MainProject.GetIncomingDoorNames(AreaSelect.SelectedIndex,
                                                 RoomListBox.SelectedIndex);
            DoorListBox.SelectedIndex = DoorIndex;

            MainProject.GetSaveStationValues(AreaSelect.SelectedIndex,
                                             SaveStationListBox.SelectedIndex,
                                             out int doorBts, out int screenX, out int screenY,
                                             out int samusX, out int samusY);
            PositionInput.Text = Tools.IntToHex(doorBts, 4);
            SaveXInput.Text    = Tools.IntToHex(screenX, 4);
            SaveYInput.Text    = Tools.IntToHex(screenY, 4);
            SamusXInput.Text   = Tools.IntToHex(samusX, 4);
            SamusYInput.Text   = Tools.IntToHex(samusY, 4);

            ChangesMade = false;
        }