aboutsummaryrefslogtreecommitdiffstats
path: root/us_maker_edition/src/base
diff options
context:
space:
mode:
authordavidus01 <davidus01@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-07-03 00:34:03 +0000
committerdavidus01 <davidus01@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-07-03 00:34:03 +0000
commit0ab45e4c4c5bfebd97a44264c1cd47cf0b6709ba (patch)
tree7cf32c8c6079667567a3cf2a42385993690bd1c3 /us_maker_edition/src/base
parent44a4f320c0597b8a222e75b1b548d26260165abb (diff)
downloadusdx-0ab45e4c4c5bfebd97a44264c1cd47cf0b6709ba.tar.gz
usdx-0ab45e4c4c5bfebd97a44264c1cd47cf0b6709ba.tar.xz
usdx-0ab45e4c4c5bfebd97a44264c1cd47cf0b6709ba.zip
editor: mouse support to move notes
left click & motion to move note right click & motion to move note with rest notes editor: Line and Note as button editor: PlayOne - variable to play only one note git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@2569 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'us_maker_edition/src/base')
-rw-r--r--us_maker_edition/src/base/UMain.pas20
-rw-r--r--us_maker_edition/src/base/UThemes.pas5
2 files changed, 18 insertions, 7 deletions
diff --git a/us_maker_edition/src/base/UMain.pas b/us_maker_edition/src/base/UMain.pas
index 174ef162..c1e45c03 100644
--- a/us_maker_edition/src/base/UMain.pas
+++ b/us_maker_edition/src/base/UMain.pas
@@ -36,6 +36,8 @@ interface
uses
SysUtils,
SDL;
+var
+ CheckMouseButton: boolean; // for checking mouse motion
procedure Main;
procedure MainLoop;
@@ -425,16 +427,12 @@ begin
if (Ini.Mouse > 0) then
begin
case Event.type_ of
- SDL_MOUSEMOTION:
- begin
- mouseDown := false;
- mouseBtn := 0;
- end;
+
SDL_MOUSEBUTTONDOWN:
begin
mouseDown := true;
mouseBtn := Event.button.button;
-
+ CheckMouseButton := true;
if (mouseBtn = SDL_BUTTON_LEFT) or (mouseBtn = SDL_BUTTON_RIGHT) then
Display.OnMouseButton(true);
end;
@@ -442,10 +440,18 @@ begin
begin
mouseDown := false;
mouseBtn := Event.button.button;
-
+ CheckMouseButton := false;
if (mouseBtn = SDL_BUTTON_LEFT) or (mouseBtn = SDL_BUTTON_RIGHT) then
Display.OnMouseButton(false);
end;
+ SDL_MOUSEMOTION:
+ begin
+ if (CheckMouseButton) then
+ mouseDown := true
+ else
+ mouseDown := false;
+ mouseBtn := 0;
+ end;
end;
Display.MoveCursor(Event.button.X * 800 * Screens / ScreenW,
diff --git a/us_maker_edition/src/base/UThemes.pas b/us_maker_edition/src/base/UThemes.pas
index de569b97..49340038 100644
--- a/us_maker_edition/src/base/UThemes.pas
+++ b/us_maker_edition/src/base/UThemes.pas
@@ -508,6 +508,8 @@ type
TThemeEditSub = class(TThemeBasic)
//in editor - headers
BackgroundImage: TThemeStatic;
+ ButtonCurrentLine: TThemeButton;
+ ButtonCurrentNote: TThemeButton;
SlideTitle: TThemeSelectSlide;
SlideArtist: TThemeSelectSlide;
SlideMP3: TThemeSelectSlide;
@@ -1407,6 +1409,9 @@ begin
// editor
ThemeLoadBasic (EditSub, 'EditSub');
ThemeLoadStatic(EditSub.BackgroundImage, 'EditSubBackgroundImage');
+ // current position in editor
+ ThemeLoadButton(EditSub.ButtonCurrentLine, 'EditSubButtonCurrentLine');
+ ThemeLoadButton(EditSub.ButtonCurrentNote, 'EditSubButtonCurrentNote');
ThemeLoadSelectSlide(EditSub.SlideTitle, 'EditSubTitle');
ThemeLoadSelectSlide(EditSub.SlideArtist, 'EditSubArtist');
ThemeLoadSelectSlide(EditSub.SlideMP3, 'EditSubMP3');