Fix Drag&Drop
This commit is contained in:
1 parent
ae7a7fd390
commit
e7d1febe4b
3 files changed
+16
-19
No files matched your search
@@ -104,7 +104,6 @@ namespace Vocaluxe.Screens
|
||||
_ChooseAvatarStatic = GetNewStatic();
|
||||
_ChooseAvatarStatic.Visible = false;
|
||||
_ChooseAvatarStatic.Aspect = EAspect.Crop;
|
||||
_AddStatic(_ChooseAvatarStatic);
|
||||
|
||||
CProfiles.AddProfileChangedCallback(_OnProfileChanged);
|
||||
}
|
||||
@@ -118,6 +117,7 @@ namespace Vocaluxe.Screens
|
||||
_OriginalPlayerAvatarTextures[i] = _Statics[_StaticPlayerAvatar[i]].Texture;
|
||||
_Statics[_StaticPlayerAvatar[i]].Aspect = EAspect.Crop;
|
||||
}
|
||||
_AddStatic(_ChooseAvatarStatic);
|
||||
}
|
||||
|
||||
public override bool HandleInput(SKeyEvent keyEvent)
|
||||
|
||||
@@ -85,7 +85,6 @@ namespace Vocaluxe.Screens
|
||||
private SScreenSongOptions _Sso;
|
||||
|
||||
private CStatic _DragAndDropCover;
|
||||
private bool _DragAndDropActive;
|
||||
private int _OldMousePosX;
|
||||
private int _OldMousePosY;
|
||||
|
||||
@@ -139,6 +138,8 @@ namespace Vocaluxe.Screens
|
||||
_ThemeSelectSlides = new string[] {_SelectSlideOptionsMode, _SelectSlideOptionsPlaylistAdd, _SelectSlideOptionsPlaylistOpen, _SelectSlideOptionsNumMedleySongs};
|
||||
_ThemeSongMenus = new string[] {_SongMenuName};
|
||||
_ThemePlaylists = new string[] {_PlaylistName};
|
||||
|
||||
_DragAndDropCover = GetNewStatic();
|
||||
}
|
||||
|
||||
public override void LoadTheme(string xmlPath)
|
||||
@@ -147,12 +148,12 @@ namespace Vocaluxe.Screens
|
||||
_SongMenu = _SongMenus[_SongMenuName];
|
||||
_Playlist = _Playlists[_PlaylistName];
|
||||
_ToggleSongOptions(ESongOptionsView.None);
|
||||
_DragAndDropCover = GetNewStatic();
|
||||
|
||||
_Playlist.Init();
|
||||
_Playlist.Visible = false;
|
||||
|
||||
_AvailableGameModes.Clear();
|
||||
_AddStatic(_DragAndDropCover);
|
||||
}
|
||||
|
||||
public override bool HandleInput(SKeyEvent keyEvent)
|
||||
@@ -398,7 +399,7 @@ namespace Vocaluxe.Screens
|
||||
{
|
||||
base.HandleMouse(mouseEvent);
|
||||
|
||||
if (_DragAndDropActive)
|
||||
if (_DragAndDropCover.Visible)
|
||||
{
|
||||
_DragAndDropCover.X += mouseEvent.X - _OldMousePosX;
|
||||
_DragAndDropCover.Y += mouseEvent.Y - _OldMousePosY;
|
||||
@@ -585,20 +586,24 @@ namespace Vocaluxe.Screens
|
||||
|
||||
if (mouseEvent.LBH)
|
||||
{
|
||||
if (!_DragAndDropActive && _Playlist.Visible && CSongs.NumSongsVisible > 0 && _SongMenu.GetSelectedSongNr() != -1)
|
||||
if (!_DragAndDropCover.Visible && _Playlist.Visible && CSongs.NumSongsVisible > 0 && _SongMenu.GetSelectedSongNr() != -1)
|
||||
{
|
||||
_DragAndDropCover = _SongMenu.GetSelectedSongCover();
|
||||
CStatic cover = _SongMenu.GetSelectedSongCover();
|
||||
_DragAndDropCover.Texture = cover.Texture;
|
||||
_DragAndDropCover.Aspect = cover.Aspect;
|
||||
_DragAndDropCover.MaxRect = cover.Rect;
|
||||
_DragAndDropCover.Color = cover.Color;
|
||||
_DragAndDropCover.Z = CSettings.ZNear;
|
||||
_Playlist.DragAndDropSongID = CSongs.VisibleSongs[_SongMenu.GetSelectedSongNr()].ID;
|
||||
_DragAndDropActive = true;
|
||||
_DragAndDropCover.Visible = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!mouseEvent.LBH && _DragAndDropActive)
|
||||
if (!mouseEvent.LBH && _DragAndDropCover.Visible)
|
||||
{
|
||||
_DragAndDropActive = false;
|
||||
_DragAndDropCover.Visible = false;
|
||||
_Playlist.DragAndDropSongID = -1;
|
||||
return true;
|
||||
}
|
||||
@@ -647,7 +652,7 @@ namespace Vocaluxe.Screens
|
||||
if (_Playlist.ActivePlaylistID != -1)
|
||||
_Playlist.LoadPlaylist(_Playlist.ActivePlaylistID);
|
||||
|
||||
_DragAndDropActive = false;
|
||||
_DragAndDropCover.Visible = false;
|
||||
_Playlist.DragAndDropSongID = -1;
|
||||
|
||||
UpdateGame();
|
||||
@@ -698,14 +703,6 @@ namespace Vocaluxe.Screens
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void Draw()
|
||||
{
|
||||
base.Draw();
|
||||
|
||||
if (_DragAndDropActive)
|
||||
_DragAndDropCover.Draw();
|
||||
}
|
||||
|
||||
public override void OnClose()
|
||||
{
|
||||
base.OnClose();
|
||||
|
||||
@@ -75,7 +75,6 @@ namespace VocaluxeLib.Menu
|
||||
_ChooseAvatarStatic = GetNewStatic();
|
||||
_ChooseAvatarStatic.Visible = false;
|
||||
_ChooseAvatarStatic.Aspect = EAspect.Crop;
|
||||
_AddStatic(_ChooseAvatarStatic);
|
||||
|
||||
CBase.Profiles.AddProfileChangedCallback(_OnProfileChanged);
|
||||
}
|
||||
@@ -535,6 +534,7 @@ namespace VocaluxeLib.Menu
|
||||
base.LoadTheme(xmlPath);
|
||||
_SelectSlides[_SelectSlidePlayer].WithTextures = true;
|
||||
_SelectSlides[_SelectSlidePlayer].SelectionByHover = true;
|
||||
_AddStatic(_ChooseAvatarStatic);
|
||||
}
|
||||
|
||||
public override bool UpdateGame()
|
||||
|
||||
Reference in new issue
Block a user