じ☆ve冰风 发表于 2026-7-19 21:31:18

DoubleX RMMV Object Properties

Note: This plugin's available for commercial use.


Purpose


        Traces all object properties meeting some conditions linked to the queried object


        Designed as a bug diagnosis tool used by Javascript coders with debug experience


Plugin Calls

SpoilerSpoiler






 *============================================================================
 *    ## Plugin Call Info                                                     
 *       A path in the object property trace will stop if it'd be cyclic      
 *----------------------------------------------------------------------------
 *    # Object manipulations                                                  
 *      1. trace_obj_prop(cond, label)                                        
 *         - Traces all object properties satisfying function cond linked to  
 *           this object                                                      
 *         - Labels all traced object properties with function label          
 *         - cond and label are functions written in                          
 *           Object Property Tracing Condition Function and                   
 *           Object Property Tracing Label Function respectively              
 *      2. _obj_prop_log                                                
 *         - Returns the log of all traced object properties satisfying       
 *           function cond linked to this object                              
 *============================================================================








Configurations

SpoilerSpoiler






    /*------------------------------------------------------------------------
     *    Object Property Tracing Condition Function                          
     *    - Setups cond used by trace_obj_prop(cond, label)                   
     *------------------------------------------------------------------------*/
    /* cond must be a function taking the object property as the only argument
       The below examples are added to help you setup your own cond functions */

    // Checks if the currently traced object's indeed an object
    cond_obj: function(obj) {
        return typeof obj === "object";
    }, // substitute cond with "cond_obj" to use this function

    // Checks if the currently traced object's an array
    cond_array: function(obj) {
        return Array.isArray(obj);
    }, // substitute cond with "cond_array" to use this function

    // Add your own cond functions here
    

    /*------------------------------------------------------------------------
     *    Object Property Tracing Label Function                              
     *    - Setups label used by trace_obj_prop(cond, label)                  
     *------------------------------------------------------------------------*/
    /* label must be a function taking the object property as the only argument
       All label functions must return a string
       The below examples are added to help you setup your own label functions */

    // Always returns the entire object
    label_obj: function(obj) {
        return obj;
    }, // substitute label with "label_obj" to use this function

    // Always returns the type(including Array) of each traced object property
    label_array: function(obj) {
        if (Array.isArray(obj)) {
            return "array";
        }
        return typeof obj;
    } // substitute label with "label_array" to use this function

    // Add your own label functions here
  








Prerequisites


        Abilities:


        1. Basic knowledge of inspecting object properties in Javascript


        2. Some Javascript coding proficiency to fully utilize this plugin


Terms Of Use


        You shall keep this plugin's Plugin Info part's contents intact


        You shalln't claim that this plugin's written by anyone other than DoubleX or his aliases


        None of the above applies to DoubleX or his/her aliases


Changelog

SpoilerSpoiler






 *      v1.00d(GMT 1500 27-1-2016):                                           
 *      1. Fixed enumerating this plugin's functions via for in loops bug    
 *      v1.00c(GMT 0100 13-11-2015):                                          
 *      1. Fixed tracing properties from null or non object object bug       
 *      v1.00b(GMT 1100 11-11-2015):                                          
 *      1. Added descriptions that will be shown in the plugin manager        
 *      v1.00a(GMT 1500 27-10-2015):                                          
 *      1. 1st version of this plugin finished                               






View attachment DoubleX RMMV Obj Prop v100d.rar


本贴来自国际rpgmaker官方论坛作者:DoubleX处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/doublex-rmmv-object-properties.47834/
页: [1]
查看完整版本: DoubleX RMMV Object Properties