Non-Combat Menu

Discussion in 'JS Plugin Releases (RMMV)' started by mjshi, Feb 6, 2016.

  1. mjshi

    mjshi Jack of Most Trades Veteran

    Messages:
    915
    Likes Received:
    724
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    N/A
    A wild MV port appears!
    Non-Combat Menu v1.04 (MV)
    by mjshi- OK for use in all projects with credit
    Get it here! (direct link)​

    Introduction
    Well, it was going to happen someday. So why not now?

    Introducing a sleek, minimalist menu for all your non-combat game needs! Be it survival horror, mystery, point-and-click... the non-combat menu is here for you.

    Features
    Configurable:

    - Configure what can be shown on the menu and what they will be called.
    - Configure whether or not to have a gold window, where the window should be, and how wide
    - Change what the item menu shows
    - Change where the item description box will go

    Updates:
    - Compatibility edit for Yanfly Item Core. updated to 1.0b
    - Added support for backgrounds. updated to 1.01
    - Added support for calling common events from the menu. updated to 1.02
    - Fixed the common event call to actually support multiple common events. updated to 1.02a
    - Integrated the pluginCMD addon onto the main plugin. updated to 1.03
    - Added icon and text alignment support updated to 1.04

    Screens
    (Blank project with some mapping for eye candy)

    Screenshot_1.png

    Screenshot_3.png

    Screenshot_2.png


    How to Use
    Drag the file into your plugins folder, then configure to your heart's content.
    Place below Yanfly Item Core if you have it.

    Addons

    PluginCMD addon Allows for plugin commands to be opened from the menu (thus allowing the implementation of other plugin scenes)
    Status OUTDATED, works for 1.02 and below. For 1.03+, this addon's functionality has already been added to the main plugin and thus isn't needed.
    View attachment NonCombatMenu_PluginCMD.js

    Item Only addon Skips the menu and jumps straight to the items screen
    Status up to date
    View attachment NonCombatMenu_ItemOnly.js

    Remove HP/MP from Status addon Removes the HP/MP/bar from the streamlined status screen.
    Status up to date
    View attachment 46753

    Credit
    mjshi
     
    Last edited: Aug 10, 2018
    #1
  2. Valrix

    Valrix Code Breaker Member

    Messages:
    14
    Likes Received:
    3
    First Language:
    English
    Greetings, I needed to make a few edits to your plugin in order to support calling a plugin command from the menu, allowing it to be a bit more customized. I'm not sure how useful others may find it, but I thought I'd share the changes just in case. Thank you for making such a useful plugin!


    Scene_NCMenu.prototype.createCommandWindow = function() {
    this._commandWindow = new Window_NCMenu();
    var method, split;

    for (var i = 0; i < NCMenu.menuList.length; i++) {
    method = NCMenu.menuList[1];
    if (method == 'cancel') {continue}
    split = method.split("_");
    this._commandWindow.setHandler(method, eval(String("this.command" + (split[1] ? split[0].charAt(0).toUpperCase()+split[0].slice(1) : method.charAt(0).toUpperCase()+method.slice(1)) + ".bind(this"+(split[1] ? ",'"+split[1]+"'" : "")+")")));
    }

    this._commandWindow.setHandler('cancel', this.popScene.bind(this));
    this.addWindow(this._commandWindow);
    };

    Scene_NCMenu.prototype.commandOther = function() {
    var args = Array.prototype.slice.call(arguments, 0);
    Game_Interpreter.prototype.pluginCommand(args.shift(), args);
    };




    As an example, I have the following menu in order to support Yanfly's Item Synthesis: "Items: item, Craft: other_OpenSynthesis, Status: status, Options: options, Save: save, Quit: toTitle"
     
    Last edited by a moderator: Feb 13, 2016
    #2
  3. mjshi

    mjshi Jack of Most Trades Veteran

    Messages:
    915
    Likes Received:
    724
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    N/A
    @Valrix It's just a little unclear (at least, on first glance) in that code there, what exactly 


    eval(String("this.command" + (split[1] ? split[0].charAt(0).toUpperCase()+split[0].slice(1) : method.charAt(0).toUpperCase()+method.slice(1)) + ".bind(this"+(split[1] ? ",'"+split[1]+"'" : "")+")"))


    is. I would recommend processing the "if/else" statements outside of the method binding itself, because it gets terribly messy if you do it inside the eval(). I myself can't criticize programming practices, though, because I only now realize (after looking at your code xD) that I was redefining "var method" over and over in a for loop... *facepalm* Well, I've fixed that now, and updated the plugin.


    This as well:


    Screenshot_1.png


    Then take that conditional statement you had inside the eval and check if split == method or something or another. 


    Anyways. Looks nice, would you mind me adding it to the main post, listed as an addon, or including it in the script (with credit given to you, of course)? 
     
    #3
  4. Valrix

    Valrix Code Breaker Member

    Messages:
    14
    Likes Received:
    3
    First Language:
    English
    @mjshi Yikes, this is why I shouldn't work while tired. I took your advice and cleaned it up a bit, pulling the logic from the eval and using replace() over split(). Feel free to add or include it how you like :)


    Scene_NCMenu.prototype.createCommandWindow = function() {
    this._commandWindow = new Window_NCMenu();
    var method, split, cmd;

    for (var i = 0; i < NCMenu.menuList.length; i++) {
    method = NCMenu.menuList[1];
    if (method == 'cancel') {continue}
    split = method.replace("other_", "");
    if (split === method) {
    cmd = "this.command" + method.charAt(0).toUpperCase() + method.slice(1) + ".bind(this)";
    } else {
    cmd = "this.commandOther.bind(this,'" + split + "')";
    }
    this._commandWindow.setHandler(method, eval(cmd));
    }

    this._commandWindow.setHandler('cancel', this.popScene.bind(this));
    this.addWindow(this._commandWindow);
    };




    I noticed I now get the following error when I try to back out my inventory:

    Code:
    TypeError: Cannot read property 'setItem' of undefined at Scene_Item.onItemCancel
    which points to the following line of code in Yanfly's Item Core:

    Code:
    this._statusWindow.setItem(null);
    If I change the load order so it comes after ItemCore, the menu text in Scene_Item is no longer visible.
     
    Last edited by a moderator: Feb 14, 2016
    #4
  5. mjshi

    mjshi Jack of Most Trades Veteran

    Messages:
    915
    Likes Received:
    724
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    N/A
    No, your code seems to work. I placed the Yanfly Item Core under the NonCombatMenu and I didn't get that error.


    I did change your code a little bit, though, but that shouldn't affect anything at all: https://www.diffchecker.com/zevwcogq


    Also I noticed that this plugin isn't exactly compatible with Yanfly's item core xD Welp, here I go to do a compatibility edit for it...

    Screenshot_1.png


    edit: sheesh, MV screenshots are huge. Put it into spoiler tags ^_^
     
    Last edited by a moderator: Feb 14, 2016
    #5
  6. Valrix

    Valrix Code Breaker Member

    Messages:
    14
    Likes Received:
    3
    First Language:
    English
    Interesting, I may have had an outdated plugin doing that, it went away. Thank you for taking the time to make it compatible, it's greatly appreciated.
     
    #6
  7. 0sleepy0

    0sleepy0 Veteran Veteran

    Messages:
    25
    Likes Received:
    3
    First Language:
    English
    did you know?


    there is a mix-up



    Window_ItemCategory.prototype.makeCommandList = function() {
        if (NCMenu.showConsumables) {this.addCommand(TextManager.item,  'item')}
        if (NCMenu.showKeyItems) {this.addCommand(TextManager.weapon,   'weapon')}
        if (NCMenu.showWeapons) {this.addCommand(TextManager.armor,     'armor')}
        if (NCMenu.showArmors) {this.addCommand(TextManager.keyItem,    'keyItem')}
    };


    if (NCMenu.showKeyItems...weapon,   'weapon')}


    if (NCMenu.showWeapons...armor,     'armor')}


    if (NCMenu.showArmors....keyItem,    'keyItem')}
     
    #7
  8. mjshi

    mjshi Jack of Most Trades Veteran

    Messages:
    915
    Likes Received:
    724
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    N/A
    Ah, whoops xD Thanks for catching that!


    Uploading a fix shortly.


    edit: Updated.


    Also, @Valrix, made your code into a plugin addon and added it to the main post.
     
    Last edited by a moderator: Feb 15, 2016
    #8
  9. Valrix

    Valrix Code Breaker Member

    Messages:
    14
    Likes Received:
    3
    First Language:
    English
    #9
  10. kyuukyuu

    kyuukyuu Veteran

    Messages:
    53
    Likes Received:
    92
    First Language:
    English
    I love this >ww< was wondering if it's possible to make the menus smaller? :)  
     
    #10
  11. nio kasgami

    nio kasgami VampCat Veteran

    Messages:
    8,600
    Likes Received:
    2,359
    Location:
    Canada / Quebec
    First Language:
    French
    @mjshiNice plugin now I will be a total a**hole and I will change everything's in it for allow bust ect o3o~
     
    #11
  12. mjshi

    mjshi Jack of Most Trades Veteran

    Messages:
    915
    Likes Received:
    724
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    N/A
    @kyuukyuu What do you mean "menus smaller"? Like size-wise, or what?


    @nio kasgami Feel free to modify :)  I'd like to see how it turns out, though!
     
    #12
    nio kasgami likes this.
  13. nio kasgami

    nio kasgami VampCat Veteran

    Messages:
    8,600
    Likes Received:
    2,359
    Location:
    Canada / Quebec
    First Language:
    French
    #13
  14. kyuukyuu

    kyuukyuu Veteran

    Messages:
    53
    Likes Received:
    92
    First Language:
    English
    Yup like size wise~ an example would be when it's on the item page, is it possible for it to not take up the whole screen? TwT so sorry that I have only a basic understanding of codes. I could only see adjustments for the width and height for the main menu and the gold bar TwT 
     
    #14
  15. mjshi

    mjshi Jack of Most Trades Veteran

    Messages:
    915
    Likes Received:
    724
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    N/A
    Ah, yeah, that isn't possible at the moment. I am planning on perhaps making a couple alternate Scene_Item layouts for the Non-Combat Menu, though, so if you have an idea or want to make a mock-up of how big each window should be I can take a look at it ^_^
     
    #15
  16. kyuukyuu

    kyuukyuu Veteran

    Messages:
    53
    Likes Received:
    92
    First Language:
    English
    They would be so nice of you *ooo* 


    @mjshi Here's the sizing of mockup >www< I also wonder if I can use graphics instead of the window skin? 


    mockup.png
     
    Last edited by a moderator: Feb 15, 2016
    #16
  17. dragonkiller

    dragonkiller Warper Member

    Messages:
    2
    Likes Received:
    0
    Great plugin which I am looking for.


    Would you please delete the "status"?


    I would like to make the AVG and the status is not required in the menu.
     
    #17
  18. mjshi

    mjshi Jack of Most Trades Veteran

    Messages:
    915
    Likes Received:
    724
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    N/A
    By "delete the status" do you mean you don't want the status to show up in the menu?


    You can configure that in the plugin parameters, under "-- Menu --", double click "Menu order". Then delete the part that says "Status: status,".


    edit @kyuukyuu Nothing like that has been implemented yet, but it should be fairly simple. I'll look it up.
     
    Last edited by a moderator: Feb 16, 2016
    #18
  19. mjshi

    mjshi Jack of Most Trades Veteran

    Messages:
    915
    Likes Received:
    724
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    N/A
    Update v1.01: Added support for background images for each screen.


    Pending implementation of screen resizing...
     
    #19
  20. dragonkiller

    dragonkiller Warper Member

    Messages:
    2
    Likes Received:
    0
    Thanks.


    Let me try.
     
    #20

Share This Page