[REQUEST] Set marking selector start/end points

A new update is now available, introducing seasons and more!
  • First, thank you for the quick fix on the marking selector "thing"! It was a quick fix that got a lot of server owners relieved :P


    Anyhow! It would be great to be able to set the initial coordinates of the marking selector. For example, when resizing an area in AreaProtection, the script could just invoke event.player:enableMarkingSelector(...) and the player could already have the current area's boundaries selected. Another example would be when selecting an area, invoking some commands and realizing the selection should've been just a little wider. I managed to go around this with the latest World Edit by adding -p flag, however I could also add a command to recall the last selection... just in case.


    The way this could be implemented is fairly simple; the callback function receives a markingEventStatus object or a false value (in fact, player:enableMarkingSelector seems to always get false); if the callback returns anything, it should be the markingEventStatus, or any compatible table that should modify the selection. Naturally, some values should be capped to avoid WTF situations, but this is trivial boundary checks.


    For example, this could be an implementation


    Code
    --- Start new selection. If there was some previous
    --- selection saved, use it as initial selection boundaries
    player:enableMarkingSelector(function ()
    if savedSelection then
    return savedSelection;
    end
    end);


    This is no rush, but would greatly enhance scripting.

  • Thinking about it, it should perhaps be a separate function...


    Code
    player:setInitMarkingSelector(function ()
    if previousSelection then
    return previousSelection;
    end
    end);


    Then, if the callback of setInitMarkingSelector returns a non-nil value, it should be a table (i.e. object) with the proper attributes to set for the initial selector start and end point coordinates.


    The next function would then be


    Code
    player:enableMarkingSelector(function (markingEvent)
    if markingEvent ~= false then
    print("Initial marking selection set);
    end
    end);


    Currently, enableMarkingSelector always pass false to the callback function.

  • Since there has not been any replies to this, I'll update with yet another amendment :P


    It would be very... very useful to dynamically restrict the size of the selected area. For example :

    • Restrict selecting inside a predefined area
    • Restrict selecting outside a predefined area
    • Fixed width/height/depth (i.e. static selection that the player can only "move" around)
    • Fixed min/max selection (ex: prevent having a 100km² selection, then clearing the whole thing from absolutely everything... which is bad)

    Do not assume that, because a player is an admin, that it will not try to do something stupid and/or dumb :)

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!