From e779d4f8a8ca13215895338f71e6929dc795cf60 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Mon, 29 Oct 2007 15:40:07 +0000 Subject: Add new Party Modi SDK to Trunk git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@539 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Modis/SDK/UPartyDefs.pas | 163 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 Modis/SDK/UPartyDefs.pas (limited to 'Modis/SDK/UPartyDefs.pas') diff --git a/Modis/SDK/UPartyDefs.pas b/Modis/SDK/UPartyDefs.pas new file mode 100644 index 00000000..2ca8f327 --- /dev/null +++ b/Modis/SDK/UPartyDefs.pas @@ -0,0 +1,163 @@ +unit UPartyDefs; +{********************* + uPluginDefs + Some Basic Structures and Functions used to communicate with Plugins + Usable as Delphi Plugin SDK +*********************} + +interface +uses UPluginDefs; + +type + //---------------- + // TUS_Party_Proc_Init - Structure of the Party Init Proc + // This Function is called on SingScreen Init Everytime this Modi should be sung + // Return Non Zero to Abort Party Modi Loading... In this Case another Plugin will be loaded + //---------------- + TUS_Party_Proc_Init = Function (ID: Integer): integer; stdcall; + + //---------------- + // TUS_Party_Proc_Draw - Structure of the Party Draw Proc + // This Function is called on SingScreen Draw (Not when Paused). You should draw in this Proc + // Return Non Zero to Finish Song... In this Case Score Screen is loaded + //---------------- + TUS_Party_Proc_Draw = Function (ID: Integer): integer; stdcall; + + //---------------- + // TUS_Party_Proc_Init - Structure of the Party Init Proc + // This Function is called on SingScreen DeInit When Plugin abort Song or Song finishes + // Return Non Zero to Abort Party Modi Loading... In this Case another Plugin will be loaded + //---------------- + TUS_Party_Proc_DeInit = Function (ID: Integer): integer; stdcall; + + //---------------- + // TUS_ModiInfo - Some Infos from Plugin to Partymode. + // Used to register party modi to Party manager + // --- + // Version Structure: + // First Byte: Head Revison + // Second Byte: Sub Revison + // Third Byte: Sub Revision 2 + // Fourth Byte: Letter (For Bug Fix releases. 0 or 'a' .. 'z') + //---------------- + TModiInfo_Name = Array [0..31] of Char; + TModiInfo_Desc = Array [0..63] of Char; + + PUS_ModiInfo = ^TUS_ModiInfo; + TUS_ModiInfo = record + //Size of this record (usefull if record will be extended in the future) + cbSize: Integer; //Don't forget to set this as Plugin! + + //Infos about the Modi + Name : TModiInfo_Name; //Modiname to Register for the Plugin + Description: TModiInfo_Desc; //Plugin Description + + //------------ + // Loading Settings + // --- + // Bit to Set | Triggered Option + // 1 | Song should be loaded + // 2 | Song has to be Non Duett + // 4 | Song has to be Duett (If 2 and 4 is set, both will be ignored) + // 8 | Only Playable with 2 and more players + // 16 | Restrict Background Loading + // 32 | Restrict Video Loading + // 64 | Not in Use, Don't set it! + // 128 | Not in Use, Don't set it! + LoadingSettings: Byte; + + // SingScreen Settings + // --- + // Bit to Set | Triggered Option + // 1 | ShowNotes + // 2 | ShowScores + // 4 | ShowTime + // 8 | Start Audio Playback automaticaly + // 16 | Not in Use, Don't set it! + // 32 | Not in Use, Don't set it! + // 64 | Not in Use, Don't set it! + // 128 | Not in Use, Don't set it! + SingScreenSettings: Byte; + + // With which count of players can this modi be played + // --- + //Set different Bits + //1 -> One Player + //2 -> Two Players + //4 -> Three Players + //8 -> Four Players + //16-> Six Players + //e.g. : 10 -> Playable with 2 and 4 Players + NumPlayers: Byte; + + // ID that is given to the Party Procs when they are called + // If this Modi is running + // (e.g. to register Until 2000 and Until 5000 with the same Procs + // ID is the Max Point Count in this example) + ID: Integer; + + // Party Procs called on Party + // --- + // Set to nil(C: NULL) if u don't want to use this method + ModiInit: TUS_Party_Proc_Init; + ModiDraw: TUS_Party_Proc_Draw; + ModiDeInit: TUS_Party_Proc_DeInit; + end; + +//---------------- +// Some Default Constants +//---------------- +const + // to use for TUS_ModiInfo.LoadingSettings + MLS_LoadSong = 1; //Song should be loaded + MLS_NotDuett = 2; //Song has to be Non Duett + MLS_ForceDuett = 4; //Song has to be Duett (If 2 and 4 is set, both will be ignored) + MLS_TeamOnly = 8; //Only Playable with 2 and more players + MLS_RestrictBG = 16; //Restrict Background Loading + MLS_RestrictVid = 32; //Restrict Video Loading + + // to use with TUS_ModiInfo.SingScreenSettings + MSS_ShowNotes = 1; //ShowNotes + MSS_ShowScores = 2; //ShowScores + MSS_ShowTime = 4; //ShowTime + MSS_AutoPlayback= 8; //Start Audio Playback automaticaly + + //Standard (Duell) for TUS_ModiInfo.LoadingSettings and TUS_ModiInfo.SingScreenSettings + MLS_Standard = MLS_LoadSong; + MSS_Standard = MSS_ShowNotes or MSS_ShowScores or MSS_ShowTime or MSS_AutoPlayback; + +//------------- +// Some helper functions to register Party Modi +//------------- +Function RegisterModi(const PluginInterface: PUS_PluginInterface; const Name: TModiInfo_Name; const Description: TModiInfo_Desc; const LoadingSettings, SingScreenSettings, NumPlayers: Byte; const ID: Integer; const ModiInit: TUS_Party_Proc_Init = nil; const ModiDeInit: TUS_Party_Proc_DeInit = nil; const ModiDraw: TUS_Party_Proc_Draw = nil): THandle; + + + +implementation + +//------------- +// Function that Prepares the ModiInfo Record and Calls Party/RegisterModi +//------------- +Function RegisterModi(const PluginInterface: PUS_PluginInterface; const Name: TModiInfo_Name; const Description: TModiInfo_Desc; const LoadingSettings, SingScreenSettings, NumPlayers: Byte; const ID: Integer; const ModiInit: TUS_Party_Proc_Init; const ModiDeInit: TUS_Party_Proc_DeInit; const ModiDraw: TUS_Party_Proc_Draw): THandle; +var + ModiInfo: TUS_ModiInfo; +begin + //Init Record + ModiInfo.cbSize := SizeOf(TUS_ModiInfo); + + ModiInfo.Name := Name; + ModiInfo.Description := Description; + ModiInfo.LoadingSettings := LoadingSettings; + ModiInfo.SingScreenSettings := SingScreenSettings; + ModiInfo.NumPlayers := NumPlayers; + + ModiInfo.ID := ID; + ModiInfo.ModiInit := ModiInit; + ModiInfo.ModiDraw := ModiDraw; + ModiInfo.ModiDeInit := ModiDeInit; + + //Call Service + Result := PluginInterface.CallService('Party/RegisterModi', Integer(@ModiInfo), 0); +end; + +end. \ No newline at end of file -- cgit v1.2.3 From 391d30716d48dc709f6444b19c008e82311623b9 Mon Sep 17 00:00:00 2001 From: eddie-0815 Date: Thu, 1 Nov 2007 19:34:40 +0000 Subject: Mac OS X version compiles and links. I hope I didn't break too many files on windows/linux. Added switches.inc to all files. Changed many IFDEFs. For Windows-only code please use MSWINDOWS instead of WIN32 now. WIN32 is also used by the Mac port. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@546 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Modis/SDK/UPartyDefs.pas | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Modis/SDK/UPartyDefs.pas') diff --git a/Modis/SDK/UPartyDefs.pas b/Modis/SDK/UPartyDefs.pas index 2ca8f327..bbe933c6 100644 --- a/Modis/SDK/UPartyDefs.pas +++ b/Modis/SDK/UPartyDefs.pas @@ -6,6 +6,9 @@ unit UPartyDefs; *********************} interface + +{$I switches.inc} + uses UPluginDefs; type -- cgit v1.2.3 From 8c9c787a1326b90490543bd50b56fce9b89d9807 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Sat, 3 Nov 2007 02:31:06 +0000 Subject: Windows Lazarus Build working again... Lazarus Project file includes the DPR, so that we have a unified Uses Clause ( keep this in mind please ) added "Delphi" to switches git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@560 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Modis/SDK/UPartyDefs.pas | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Modis/SDK/UPartyDefs.pas') diff --git a/Modis/SDK/UPartyDefs.pas b/Modis/SDK/UPartyDefs.pas index bbe933c6..78b04bdd 100644 --- a/Modis/SDK/UPartyDefs.pas +++ b/Modis/SDK/UPartyDefs.pas @@ -7,6 +7,10 @@ unit UPartyDefs; interface +{$IFDEF FPC} + {$MODE Delphi} +{$ENDIF} + {$I switches.inc} uses UPluginDefs; -- cgit v1.2.3 From 5e733f7e9cb2118651df90171db1892c9155e089 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Sun, 4 Nov 2007 21:00:20 +0000 Subject: Partymodule finished. All PartyScreens and SingScreen needs some adapting. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@583 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Modis/SDK/UPartyDefs.pas | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'Modis/SDK/UPartyDefs.pas') diff --git a/Modis/SDK/UPartyDefs.pas b/Modis/SDK/UPartyDefs.pas index 78b04bdd..08f5fd44 100644 --- a/Modis/SDK/UPartyDefs.pas +++ b/Modis/SDK/UPartyDefs.pas @@ -31,9 +31,9 @@ type TUS_Party_Proc_Draw = Function (ID: Integer): integer; stdcall; //---------------- - // TUS_Party_Proc_Init - Structure of the Party Init Proc + // TUS_Party_Proc_DeInit - Structure of the Party DeInit Proc // This Function is called on SingScreen DeInit When Plugin abort Song or Song finishes - // Return Non Zero to Abort Party Modi Loading... In this Case another Plugin will be loaded + // Return Winner //---------------- TUS_Party_Proc_DeInit = Function (ID: Integer): integer; stdcall; @@ -69,7 +69,7 @@ type // 8 | Only Playable with 2 and more players // 16 | Restrict Background Loading // 32 | Restrict Video Loading - // 64 | Not in Use, Don't set it! + // 64 | Increase TimesPlayed for Cur. Player // 128 | Not in Use, Don't set it! LoadingSettings: Byte; @@ -111,6 +111,24 @@ type ModiDeInit: TUS_Party_Proc_DeInit; end; + //-------------- + // Team Info Record. Used by "Party/GetTeamInfo" and "Party/SetTeamInfo" + //-------------- + TTeamInfo = record + NumTeams: Byte; + Teaminfo: array[0..5] of record + Name: PChar; //Teamname + Score: Word; //TeamScore + Joker: Byte; //Team Jokers available + CurPlayer: Byte; //Id of Cur. Playing Player + NumPlayers: Byte; + Playerinfo: array[0..3] of record + Name: PChar; //Playername + TimesPlayed: Byte; //How often this Player has Sung + end; + end; + end; + //---------------- // Some Default Constants //---------------- @@ -122,6 +140,7 @@ const MLS_TeamOnly = 8; //Only Playable with 2 and more players MLS_RestrictBG = 16; //Restrict Background Loading MLS_RestrictVid = 32; //Restrict Video Loading + MLS_IncTP = 64; //Increase TimesPlayed for Cur. Player // to use with TUS_ModiInfo.SingScreenSettings MSS_ShowNotes = 1; //ShowNotes @@ -130,7 +149,7 @@ const MSS_AutoPlayback= 8; //Start Audio Playback automaticaly //Standard (Duell) for TUS_ModiInfo.LoadingSettings and TUS_ModiInfo.SingScreenSettings - MLS_Standard = MLS_LoadSong; + MLS_Standard = MLS_LoadSong or MLS_IncTP; MSS_Standard = MSS_ShowNotes or MSS_ShowScores or MSS_ShowTime or MSS_AutoPlayback; //------------- -- cgit v1.2.3