Changeset 884


Ignore:
Timestamp:
06/24/19 14:42:57 (5 years ago)
Author:
Maciej Komosinski
Message:

Added a function to check if a property exists in MutableParam?

Location:
cpp/frams/param
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/param/mutableparam.cpp

    r832 r884  
    11// This file is a part of Framsticks SDK.  http://www.framsticks.com/
    2 // Copyright (C) 1999-2018  Maciej Komosinski and Szymon Ulatowski.
     2// Copyright (C) 1999-2019  Maciej Komosinski and Szymon Ulatowski.
    33// See LICENSE.txt for details.
    44
     
    1717        { "_propertyAddGroup", 0, PARAM_DONTSAVE | PARAM_USERHIDDEN, "Add property group", "p(s name)", PROCEDURE(p_addgroup), PROPERTY_WARNING },
    1818        { "_propertyRemoveGroup", 0, PARAM_DONTSAVE | PARAM_USERHIDDEN, "Remove property group", "p(d index)", PROCEDURE(p_remgroup), PROPERTY_WARNING },
     19        { "_propertyExists", 0, PARAM_DONTSAVE | PARAM_USERHIDDEN, "Check for property existence", "p d(s name)", PROCEDURE(p_exists) },
    1920        { "_property_changed_index", 0, PARAM_DONTSAVE | PARAM_USERHIDDEN | PARAM_READONLY, "Last changed property index", "d", FIELD(changed), },
    2021        { "_property_changed_id", 0, PARAM_DONTSAVE | PARAM_USERHIDDEN | PARAM_READONLY, "Last changed property id", "s", GETONLY(changedname), },
     
    246247}
    247248
     249void MutableParam::p_exists(ExtValue *args, ExtValue *ret)
     250{
     251        ret->setInt(findId(args->getString().c_str()) >= 0);
     252}
     253
    248254void MutableParam::notify(int id)
    249255{
  • cpp/frams/param/mutableparam.h

    r832 r884  
    11// This file is a part of Framsticks SDK.  http://www.framsticks.com/
    2 // Copyright (C) 1999-2018  Maciej Komosinski and Szymon Ulatowski.
     2// Copyright (C) 1999-2019  Maciej Komosinski and Szymon Ulatowski.
    33// See LICENSE.txt for details.
    44
     
    6969        PARAMPROCDEF(p_addgroup);
    7070        PARAMPROCDEF(p_remgroup);
     71        PARAMPROCDEF(p_exists);
    7172        PARAMGETDEF(changedname) { arg1->setString(id(changed)); }
    7273#undef STATRICKCLASS
Note: See TracChangeset for help on using the changeset viewer.