User Tag List

Results 1 to 8 of 8

Thread: For developers: ObjectSelection Framework

  1. #1
    Clickteam Clickteam
    Anders's Avatar
    Join Date
    Jun 2006
    Location
    Denmark, Århus
    Posts
    3,456
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    For developers: ObjectSelection Framework

    This tiny framework (just one class) will help you a *lot* when developing extensions that needs to modify or read the Selected Object List. It *should* work in HWA and Unicode versions of MMF2 + it supports qualifiers.

    Please report any bugs to me so they can be fixed

    Many thanks to Dynasoft for releasing the sourcecodes for his Select Object to the public. I couldn't have made this mini-framework without it.

    Overview of the functions:
    void SelectAll(short Oi);
    - Resets the SOL by reselecting all objects

    void SelectNone(short Oi);
    - Resets the SOL, not selecting any objects

    void SelectOneObject(LPRO object);
    - Resets the SOL and inserts one given object into it

    void SelectObjects(short Oi, LPRO* objects, int count);
    - Resets the SOL and selects the given list of objects

    bool ObjectIsOfType(LPRO object, short Oi);
    - Returns true if the object is of the type (checks for qualifiers as well)

    int GetNumberOfSelected(short Oi);
    - Returns the number of selected objects for the given object type or qualifier.

    bool FilterObjects(LPRDATA rdPtr, short Oi, bool negate, bool (*filterFunction)(LPRDATA, LPRO));
    - Runs a custom filter on the current SOL, removing objects that fails the callback test.
    Returns a boolean if the event should run (already inverted by the negate flag for convenience)

    Download:
    ObjectSelection.cpp - ObjectSelection.h - My website with the same info as here

    Sample condition with callback filter
    Code:
    //Should it select the given object?
    bool sampleFilter(LPRDATA rdPtr, LPRO object)
    {
    	return (rdPtr->objectA == object || rdPtr->objectB == object);
    }
    
    long WINAPI DLLExport con_IsObjectRemembered(LPRDATA rdPtr, long param1, long param2)
    {
    	//Initialize the object selection framework
    	ObjectSelection select = ObjectSelection(rdPtr->rHo.hoAdRunHeader);
    
    	//Gets a pointer to the event information structure and find out if the condition is negated
    	PEVT pe = (PEVT)(((LPBYTE)param1)-CND_SIZE);
    	bool isNegated = (pe->evtFlags2 & EVFLAG2_NOT);
    	short oi = ((eventParam*)param1)->evp.evpW.evpW0;
    
    	//Runs the "sampleFilter" callback on any object in the SOL.
    	return select.FilterObjects(rdPtr, oi, isNegated, &sampleFilter);
    }

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,741
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: For developers: ObjectSelection Framework

    Awesome
    I will definitely find a use for this.

  3. #3
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: For developers: ObjectSelection Framework

    Quote Originally Posted by Andos
    Many thanks to Dynasoft for releasing the sourcecodes for his Select Object to the public. I couldn't have made this mini-framework without it.
    And thank you for taking the time to make this.

  4. #4
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jun 2006
    Location
    England
    Posts
    3,546
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: For developers: ObjectSelection Framework

    Nice one, Andos and Dynasoft!
    .:::.Joshtek.:::.

  5. #5
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    6,784
    Mentioned
    298 Post(s)
    Tagged
    4 Thread(s)

    Re: For developers: ObjectSelection Framework

    Thanks to both, now in my chest of codes for future uses!!!
    Regards,


    Fernando Vivolo

    ... new things are coming ...

  6. #6
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    RickyRombo's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere between here and there
    Posts
    3,167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: For developers: ObjectSelection Framework

    WOO! I might be able to finish my Bullet360 object!!

    ... that is if I still have the source! Uh oh!

  7. #7
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Aug 2006
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: For developers: ObjectSelection Framework

    Thanks Andos and Dynasoft

  8. #8
    Clicker Multimedia Fusion 2
    Retriever2's Avatar
    Join Date
    Jun 2006
    Location
    United States
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: For developers: ObjectSelection Framework

    This should be useful to many people.

    Most of the object selection capabilities in XLua is also thanks to the code Dynasoft released. It has been very helpful.

Similar Threads

  1. 'Microsoft.Xna.Framework.Content.ContentLoadExcept ion'
    By Cyberbeard in forum XNA Export Module Version 2.0
    Replies: 5
    Last Post: 7th March 2013, 01:25 PM
  2. Starling framework
    By MEHRDAD in forum SWF/Flash Export Module Version 2.0
    Replies: 2
    Last Post: 7th December 2012, 07:30 AM
  3. .net Framework Min Requirements
    By Zeussy in forum Install Creator and Patch Maker
    Replies: 2
    Last Post: 10th March 2011, 06:34 AM
  4. Installer framework 3.5
    By pl in forum Install Creator and Patch Maker
    Replies: 11
    Last Post: 1st September 2010, 09:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •