From e1753d472ecafcebd24a6dfb32a67080694683cc Mon Sep 17 00:00:00 2001 From: davidus01 Date: Fri, 25 Jun 2010 22:11:39 +0000 Subject: editor: show background picture editor: background from Themes editor: correction in themes git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@2562 b956fd51-792f-4845-bead-9b4dfca2ff2c --- us_maker_edition/game/themes/Classic.ini | 14 ++ us_maker_edition/game/themes/Deluxe.ini | 18 +- us_maker_edition/game/themes/Verdure.ini | 245 ++++++++++++------------ us_maker_edition/src/base/UThemes.pas | 10 +- us_maker_edition/src/screens/UScreenEditSub.pas | 67 ++++++- 5 files changed, 215 insertions(+), 139 deletions(-) (limited to 'us_maker_edition') diff --git a/us_maker_edition/game/themes/Classic.ini b/us_maker_edition/game/themes/Classic.ini index 919080d6..a4e255ab 100644 --- a/us_maker_edition/game/themes/Classic.ini +++ b/us_maker_edition/game/themes/Classic.ini @@ -8012,6 +8012,8 @@ Y = 535 H = 41 [EditSub] +[EditSubBackground] +Type = Colorized [EditSubTitle] X = 30 @@ -8402,3 +8404,15 @@ SBGColor = DarkBlue SBGDColor = LightBlue STColor = White STDColor = GrayDark + +[EditSubBackgroundImage] +X = 510 +Y = 60 +W = 250 +H = 205 +Z = 0.95 +Color = White +Tex = prevbackground +Type = Transparent +Reflection = 0 +ReflectionSpacing = 22 diff --git a/us_maker_edition/game/themes/Deluxe.ini b/us_maker_edition/game/themes/Deluxe.ini index dd72bfc0..623d6519 100644 --- a/us_maker_edition/game/themes/Deluxe.ini +++ b/us_maker_edition/game/themes/Deluxe.ini @@ -8681,6 +8681,8 @@ Y = 535 H = 41 [EditSub] +[EditSubBackground] +Tex = EditBG [EditSubTitle] X = 30 @@ -8761,7 +8763,7 @@ SBGDColor = ColorLight STColor = White STDColor = GrayDark -[EditSubCover] +[EditSubSlideCover] X = 30 Y = 123 W = 100 @@ -8788,7 +8790,7 @@ SBGDColor = ColorLight STColor = White STDColor = GrayDark -[EditSubBackground] +[EditSubSlideBG] X = 30 Y = 144 W = 100 @@ -9071,3 +9073,15 @@ SBGColor = DarkBlue SBGDColor = LightBlue STColor = White STDColor = GrayDark + +[EditSubBackgroundImage] +X = 510 +Y = 60 +W = 250 +H = 205 +Z = 0.95 +Color = White +Tex = prevbackground +Type = Transparent +Reflection = 0 +ReflectionSpacing = 22 diff --git a/us_maker_edition/game/themes/Verdure.ini b/us_maker_edition/game/themes/Verdure.ini index 2e878391..1e225675 100644 --- a/us_maker_edition/game/themes/Verdure.ini +++ b/us_maker_edition/game/themes/Verdure.ini @@ -8994,6 +8994,8 @@ Y = 535 H = 41 [EditSub] +[EditSubBackground] +Tex = EditBG [EditSubTitle] X = 30 @@ -9004,22 +9006,21 @@ SkipX = 10 TextSize = 16 Text = EDIT_TITLE Tex = MainBar -Type = Colorized +Type = Transparent TexSBG = MainBar -TypeSBG = Colorized +TypeSBG = Transparent ShowArrows = 0 SBGW = 350 Align = 0 -Color = ColorDark -DColor = ColorLight +Color = ColorLight +DColor = ColorDark +SBGColor = ColorLight +SBGDColor = ColorLight TColor = White TDColor = White - -SBGColor = ColorDark -SBGDColor = ColorLight STColor = White -STDColor = GrayDark +STDColor = White [EditSubArtist] X = 30 @@ -9030,22 +9031,21 @@ SkipX = 10 TextSize = 16 Text = EDIT_ARTIST Tex = MainBar -Type = Colorized +Type = Transparent TexSBG = MainBar -TypeSBG = Colorized +TypeSBG = Transparent ShowArrows = 0 SBGW = 350 Align = 0 -Color = ColorDark -DColor = ColorLight +Color = ColorLight +DColor = ColorDark +SBGColor = ColorLight +SBGDColor = ColorLight TColor = White TDColor = White - -SBGColor = ColorDark -SBGDColor = ColorLight STColor = White -STDColor = GrayDark +STDColor = White [EditSubMP3] X = 30 @@ -9056,25 +9056,24 @@ SkipX = 10 TextSize = 16 Text = EDIT_MP3 Tex = MainBar -Type = Colorized +Type = Transparent TexSBG = SelectBG -TypeSBG = Colorized +TypeSBG = Transparent ShowArrows = 1 OneItemOnly = 1 SBGW = 350 Align = 0 -Color = ColorDark -DColor = ColorLight +Color = ColorLight +DColor = ColorDark +SBGColor = ColorLight +SBGDColor = ColorLight TColor = White TDColor = White - -SBGColor = ColorDark -SBGDColor = ColorLight STColor = White -STDColor = GrayDark +STDColor = White -[EditSubCover] +[EditSubSlideCover] X = 30 Y = 123 W = 100 @@ -9083,25 +9082,24 @@ SkipX = 10 TextSize = 16 Text = EDIT_COVER Tex = MainBar -Type = Colorized +Type = Transparent TexSBG = SelectBG -TypeSBG = Colorized +TypeSBG = Transparent ShowArrows = 1 OneItemOnly = 1 SBGW = 350 Align = 0 -Color = ColorDark -DColor = ColorLight +Color = ColorLight +DColor = ColorDark +SBGColor = ColorLight +SBGDColor = ColorLight TColor = White TDColor = White - -SBGColor = ColorDark -SBGDColor = ColorLight STColor = White -STDColor = GrayDark +STDColor = White -[EditSubBackground] +[EditSubSlideBG] X = 30 Y = 144 W = 100 @@ -9110,23 +9108,22 @@ SkipX = 10 TextSize = 16 Text = EDIT_BACKGROUND Tex = MainBar -Type = Colorized +Type = Transparent TexSBG = SelectBG -TypeSBG = Colorized +TypeSBG = Transparent ShowArrows = 1 OneItemOnly = 1 SBGW = 350 Align = 0 -Color = ColorDark -DColor = ColorLight +Color = ColorLight +DColor = ColorDark +SBGColor = ColorLight +SBGDColor = ColorLight TColor = White TDColor = White - -SBGColor = ColorDark -SBGDColor = ColorLight STColor = White -STDColor = GrayDark +STDColor = White [EditSubBPM] X = 30 @@ -9137,22 +9134,21 @@ SkipX = 10 TextSize = 16 Text = EDIT_BPM Tex = MainBar -Type = Colorized +Type = Transparent TexSBG = MainBar -TypeSBG = Colorized +TypeSBG = Transparent ShowArrows = 0 SBGW = 100 Align = 0 -Color = ColorDark -DColor = ColorLight +Color = ColorLight +DColor = ColorDark +SBGColor = ColorLight +SBGDColor = ColorLight TColor = White TDColor = White - -SBGColor = ColorDark -SBGDColor = ColorLight STColor = White -STDColor = GrayDark +STDColor = White [EditSubGAP] X = 30 @@ -9163,22 +9159,21 @@ SkipX = 10 TextSize = 16 Text = EDIT_GAP Tex = MainBar -Type = Colorized +Type = Transparent TexSBG = MainBar -TypeSBG = Colorized +TypeSBG = Transparent ShowArrows = 0 SBGW = 100 Align = 0 -Color = ColorDark -DColor = ColorLight +Color = ColorLight +DColor = ColorDark +SBGColor = ColorLight +SBGDColor = ColorLight TColor = White TDColor = White - -SBGColor = ColorDark -SBGDColor = ColorLight STColor = White -STDColor = GrayDark +STDColor = White [EditSubStart] X = 30 @@ -9189,22 +9184,21 @@ SkipX = 10 TextSize = 16 Text = EDIT_START Tex = MainBar -Type = Colorized +Type = Transparent TexSBG = MainBar -TypeSBG = Colorized +TypeSBG = Transparent ShowArrows = 0 SBGW = 100 Align = 0 -Color = ColorDark -DColor = ColorLight +Color = ColorLight +DColor = ColorDark +SBGColor = ColorLight +SBGDColor = ColorLight TColor = White TDColor = White - -SBGColor = ColorDark -SBGDColor = ColorLight STColor = White -STDColor = GrayDark +STDColor = White [EditSubDuration] X = 30 @@ -9215,22 +9209,21 @@ SkipX = 10 TextSize = 16 Text = EDIT_DURATION Tex = MainBar -Type = Colorized +Type = Transparent TexSBG = MainBar -TypeSBG = Colorized +TypeSBG = Transparent ShowArrows = 0 SBGW = 100 Align = 0 -Color = ColorDark -DColor = ColorLight +Color = ColorLight +DColor = ColorDark +SBGColor = ColorLight +SBGDColor = ColorLight TColor = White TDColor = White - -SBGColor = ColorDark -SBGDColor = ColorLight STColor = White -STDColor = GrayDark +STDColor = White [EditSubTone] X = 30 @@ -9241,22 +9234,21 @@ SkipX = 10 TextSize = 16 Text = EDIT_TONE Tex = MainBar -Type = Colorized +Type = Transparent TexSBG = MainBar -TypeSBG = Colorized +TypeSBG = Transparent ShowArrows = 0 SBGW = 100 Align = 0 -Color = ColorDark -DColor = ColorLight +Color = ColorLight +DColor = ColorDark +SBGColor = ColorLight +SBGDColor = ColorLight TColor = White TDColor = White - -SBGColor = ColorDark -SBGDColor = ColorLight STColor = White -STDColor = GrayDark +STDColor = White [EditSubLyric] X = 30 @@ -9267,22 +9259,21 @@ SkipX = 10 TextSize = 16 Text = EDIT_LYRIC Tex = MainBar -Type = Colorized +Type = Transparent TexSBG = MainBar -TypeSBG = Colorized +TypeSBG = Transparent ShowArrows = 0 SBGW = 350 Align = 0 -Color = ColorDark -DColor = ColorLight +Color = ColorLight +DColor = ColorDark +SBGColor = ColorLight +SBGDColor = ColorLight TColor = White TDColor = White - -SBGColor = ColorDark -SBGDColor = ColorLight STColor = White -STDColor = GrayDark +STDColor = White [EditSubVideoGap] X = 510 @@ -9291,30 +9282,29 @@ W = 100 H = 20 SkipX = 10 TextSize = 16 -Text = EDIT_VIDEOGAP Tex = MainBar -Type = Colorized +Type = Transparent TexSBG = MainBar -TypeSBG = Colorized +TypeSBG = Transparent ShowArrows = 0 SBGW = 100 Align = 0 +Text = EDIT_VIDEOGAP -Color = ColorDark -DColor = ColorLight +Color = ColorLight +DColor = ColorDark +SBGColor = ColorLight +SBGDColor = ColorLight TColor = White TDColor = White - -SBGColor = ColorDark -SBGDColor = ColorLight STColor = White -STDColor = GrayDark +STDColor = White [EditSubSelectVolAudio] TexSBG = SelectBG Text = EDIT_VOLUME_AUDIO -Type = Colorized -TypeSBG = Colorized +Type = Transparent +TypeSBG = Transparent X = 580 Y = 545 W = 250 @@ -9325,21 +9315,20 @@ ShowArrows = 1 OneItemOnly = 1 SBGW = 100 -Color = ColorDark -DColor = ColorLight +Color = ColorLight +DColor = ColorDark +SBGColor = ColorDark +SBGDColor = ColorDark TColor = White TDColor = White - -SBGColor = DarkBlue -SBGDColor = LightBlue STColor = White -STDColor = GrayDark +STDColor = White [EditSubSelectVolMidi] TexSBG = SelectBG Text = EDIT_VOLUME_MIDI -Type = Colorized -TypeSBG = Colorized +Type = Transparent +TypeSBG = Transparent X = 580 Y = 562 W = 0 @@ -9350,21 +9339,20 @@ ShowArrows = 1 OneItemOnly = 1 SBGW = 100 -Color = ColorDark -DColor = ColorLight +Color = ColorLight +DColor = ColorDark +SBGColor = ColorDark +SBGDColor = ColorDark TColor = White TDColor = White - -SBGColor = DarkBlue -SBGDColor = LightBlue STColor = White -STDColor = GrayDark +STDColor = White [EditSubSelectVolClick] TexSBG = SelectBG Text = EDIT_VOLUME_CLICK -Type = Colorized -TypeSBG = Colorized +Type = Transparent +TypeSBG = Transparent X = 580 Y = 579 W = 0 @@ -9375,12 +9363,23 @@ ShowArrows = 1 OneItemOnly = 1 SBGW = 100 -Color = ColorDark -DColor = ColorLight +Color = ColorLight +DColor = ColorDark +SBGColor = ColorDark +SBGDColor = ColorDark TColor = White TDColor = White - -SBGColor = DarkBlue -SBGDColor = LightBlue STColor = White -STDColor = GrayDark +STDColor = White + +[EditSubBackgroundImage] +X = 510 +Y = 60 +W = 250 +H = 205 +Z = 0.95 +Color = White +Tex = prevbackground +Type = Transparent +Reflection = 0 +ReflectionSpacing = 22 diff --git a/us_maker_edition/src/base/UThemes.pas b/us_maker_edition/src/base/UThemes.pas index 21d729f8..de569b97 100644 --- a/us_maker_edition/src/base/UThemes.pas +++ b/us_maker_edition/src/base/UThemes.pas @@ -507,6 +507,7 @@ type TThemeEditSub = class(TThemeBasic) //in editor - headers + BackgroundImage: TThemeStatic; SlideTitle: TThemeSelectSlide; SlideArtist: TThemeSelectSlide; SlideMP3: TThemeSelectSlide; @@ -521,7 +522,7 @@ type SelectVolAudio: TThemeSelectSlide; SelectVolMidi: TThemeSelectSlide; SelectVolClick: TThemeSelectSlide; - SlideVideoGap: TThemeSelectSlide; + SlideVideoGap: TThemeSelectSlide; end; //Error- and Check-Popup @@ -913,7 +914,7 @@ begin Edit := TThemeEdit.Create; EditSub := TThemeEditSub.Create; - + ErrorPopup := TThemeError.Create; CheckPopup := TThemeCheck.Create; @@ -1405,11 +1406,12 @@ begin // editor ThemeLoadBasic (EditSub, 'EditSub'); + ThemeLoadStatic(EditSub.BackgroundImage, 'EditSubBackgroundImage'); ThemeLoadSelectSlide(EditSub.SlideTitle, 'EditSubTitle'); ThemeLoadSelectSlide(EditSub.SlideArtist, 'EditSubArtist'); ThemeLoadSelectSlide(EditSub.SlideMP3, 'EditSubMP3'); - ThemeLoadSelectSlide(EditSub.SlideCover, 'EditSubCover'); - ThemeLoadSelectSlide(EditSub.SlideBackground, 'EditSubBackground'); + ThemeLoadSelectSlide(EditSub.SlideCover, 'EditSubSlideCover'); + ThemeLoadSelectSlide(EditSub.SlideBackground, 'EditSubSlideBG'); ThemeLoadSelectSlide(EditSub.SlideBPM, 'EditSubBPM'); ThemeLoadSelectSlide(EditSub.SlideGAP, 'EditSubGAP'); ThemeLoadSelectSlide(EditSub.SlideStart, 'EditSubStart'); diff --git a/us_maker_edition/src/screens/UScreenEditSub.pas b/us_maker_edition/src/screens/UScreenEditSub.pas index ee29b93b..96dc7708 100644 --- a/us_maker_edition/src/screens/UScreenEditSub.pas +++ b/us_maker_edition/src/screens/UScreenEditSub.pas @@ -187,6 +187,8 @@ type VolumeAudio: array of UTF8String; VolumeMidi: array of UTF8String; VolumeClick: array of UTF8String; + // background image & video preview + BackgroundImageId: integer; // currentX, CurrentY CurrentX: integer; CurrentY: integer; @@ -237,7 +239,7 @@ type // show transparent background note for intaractions procedure ShowInteractiveBackground; public - Tex_Background: TTexture; + Tex_PrevBackground: TTexture; FadeOut: boolean; constructor Create; override; procedure OnShow; override; @@ -1237,6 +1239,14 @@ begin CopyToUndo; SelectsS[Interactions[nBut].Num].SelectedOption := SelectsS[Interactions[nBut].Num].SelectedOption -1; CurrentSong.Background := Path(SelectsS[Interactions[nBut].Num].TextOptT[SelectsS[Interactions[nBut].Num].SelectedOption]); + // change background picture + Tex_PrevBackground := Texture.LoadTexture(CurrentSong.Path.Append(CurrentSong.Background)); + Texture.AddTexture(Tex_PrevBackground, TEXTURE_TYPE_PLAIN, false); + Statics[BackgroundImageId].Texture := Tex_PrevBackground; + Statics[BackgroundImageId].Texture.X := theme.EditSub.BackgroundImage.X; + Statics[BackgroundImageId].Texture.Y := theme.EditSub.BackgroundImage.Y; + Statics[BackgroundImageId].Texture.W := theme.EditSub.BackgroundImage.W; + Statics[BackgroundImageId].Texture.H := theme.EditSub.BackgroundImage.H; end; if ((BackgroundSlideId = Interactions[nBut].Num) and (Action = maRight) and (SelectsS[Interactions[nBut].Num].SelectedOption < Length(SelectsS[Interactions[nBut].Num].TextOptT)-1)) then @@ -1244,7 +1254,15 @@ begin CopyToUndo; SelectsS[Interactions[nBut].Num].SelectedOption := SelectsS[Interactions[nBut].Num].SelectedOption +1; CurrentSong.Background := Path(SelectsS[Interactions[nBut].Num].TextOptT[SelectsS[Interactions[nBut].Num].SelectedOption]); - end; + // change background picture + Tex_PrevBackground := Texture.LoadTexture(CurrentSong.Path.Append(CurrentSong.Background)); + Texture.AddTexture(Tex_PrevBackground, TEXTURE_TYPE_PLAIN, false); + Statics[BackgroundImageId].Texture := Tex_PrevBackground; + Statics[BackgroundImageId].Texture.X := theme.EditSub.BackgroundImage.X; + Statics[BackgroundImageId].Texture.Y := theme.EditSub.BackgroundImage.Y; + Statics[BackgroundImageId].Texture.W := theme.EditSub.BackgroundImage.W; + Statics[BackgroundImageId].Texture.H := theme.EditSub.BackgroundImage.H; + end; if ((Mp3SlideId = Interactions[nBut].Num) and (Action = maLeft) and (SelectsS[Interactions[nBut].Num].SelectedOption > 0)) then begin @@ -1962,7 +1980,7 @@ begin //Theme: //bg glDisable(GL_BLEND); - +{ x := 0; y := 0; w := 800; @@ -1973,7 +1991,7 @@ begin glVertex2f(x, y+h); glVertex2f(x+w, y+h); glVertex2f(x+w, y); - glEnd; + glEnd;} // Line glColor4f(0.9, 0.9, 0.9, 1); @@ -2290,6 +2308,7 @@ end; constructor TScreenEditSub.Create; begin inherited Create; + LoadFromTheme(Theme.EditSub); //video fCurrentVideo := nil; SetLength(Player, 1); @@ -2378,6 +2397,8 @@ begin SelectsS[VideoGapSlideId].Text.Align := 0; SelectsS[VideoGapSlideId].Text.X := SelectsS[VideoGapSlideId].Texture.X + 3; + // background image & preview + BackgroundImageId := AddStatic(Theme.EditSub.BackgroundImage); // TextTitle := AddText(180, 65, 0, 24, 0, 0, 0, 'a'); // TextArtist := AddText(180, 90, 0, 24, 0, 0, 0, 'b'); // TextMp3 := AddText(180, 115, 0, 24, 0, 0, 0, 'c'); @@ -2584,7 +2605,7 @@ begin // volume slides SetLength(VolumeAudio, 0); SetLength(VolumeMidi, 0); - SetLength(VolumeClick, 0); + SetLength(VolumeClick, 0); for i:=0 to 100 do begin SetLength(VolumeAudio, high(VolumeAudio)+2); @@ -2630,6 +2651,32 @@ begin AudioInput.CaptureStart; end; + // background picture + try + //BgFile := CurrentSong.Path.Append(CurrentSong.Background); + Statics[BackgroundImageId].Texture.X := 500; + Statics[BackgroundImageId].Texture.Y := 65; + Statics[BackgroundImageId].Texture.W := 80; + Statics[BackgroundImageId].Texture.H := 0; + + if (Not (CurrentSong.Background = PATH_NONE) and CurrentSong.Path.Append(CurrentSong.Background).Exists) then + begin + log.LogError('background:' + CurrentSong.Background.ToUTF8()); + Tex_PrevBackground := Texture.LoadTexture(CurrentSong.Path.Append(CurrentSong.Background)); + Texture.AddTexture(Tex_PrevBackground, TEXTURE_TYPE_PLAIN, true); + Statics[BackgroundImageId].Texture := Tex_PrevBackground; + Statics[BackgroundImageId].Texture.X := theme.EditSub.BackgroundImage.X; + Statics[BackgroundImageId].Texture.Y := theme.EditSub.BackgroundImage.Y; + Statics[BackgroundImageId].Texture.W := theme.EditSub.BackgroundImage.W; + Statics[BackgroundImageId].Texture.H := theme.EditSub.BackgroundImage.H; + + end; + + except + Log.LogError('Background could not be loaded: ' + CurrentSong.Background.ToNative); + Tex_PrevBackground.TexNum := 0; + end; + //Interaction := 0; TextEditMode := false; TitleEditMode := false; @@ -2646,7 +2693,7 @@ var notechange: boolean; begin - glClearColor(1,1,1,1); + //glClearColor(1,1,1,1); // midi music if PlaySentenceMidi then @@ -2827,9 +2874,9 @@ begin fCurrentVideo.GetFrame(CurrentSong.VideoGAP + AudioPlayback.Position); fCurrentVideo.SetScreen(1); fCurrentVideo.Alpha := 1; - fCurrentVideo.SetScreenPosition(510, 60, 1); - fCurrentVideo.Width := 250; - fCurrentVideo.Height := 205; + fCurrentVideo.SetScreenPosition(theme.EditSub.BackgroundImage.X, theme.EditSub.BackgroundImage.Y, 1); + fCurrentVideo.Width := theme.EditSub.BackgroundImage.W; + fCurrentVideo.Height := theme.EditSub.BackgroundImage.H; fCurrentVideo.ReflectionSpacing := 1; fCurrentVideo.AspectCorrection := acoCrop; @@ -2849,7 +2896,7 @@ begin {$ENDIF} Lyric.Free; //Music.SetVolume(1.0); - AudioInput.CaptureStop; + AudioInput.CaptureStop; end; function TScreenEditSub.GetNoteName(Note: integer): string; -- cgit v1.2.3