Window Per Actor in Main Menu?

Discussion in 'Javascript/Plugin Support' started by wonderjosh3000, Feb 10, 2019.

    Tags:
  1. wonderjosh3000

    wonderjosh3000 Veteran Veteran

    Messages:
    57
    Likes Received:
    37
    Location:
    The Frosty Plains of The Great White North
    First Language:
    English
    Primarily Uses:
    RMMV
    OH HOWDY.

    So, my latest question for guidance and/or assistance and/or help, which is essentially just saying the same thing 3 times, is this:

    How do I go about having each actor having their status be displayed in their own window? Everything is laid out normally, except rather than all 4 characters sharing one window, they all have their own. There's ways around it, sorta, like using NASTY's window replacer plugin, but I don't want to do that. That's just a visual trick. I'd like actual windows per actor.

    I'm also using SRD's Busty Icon Menu plugin. That's not it's real name but I'm just having fun now. The Alt Menu Bust & Icons plugin.

    Help would be grandiosely appreciated! Thanks!
     
    #1
  2. Shaz

    Shaz Veteran Veteran

    Messages:
    37,715
    Likes Received:
    11,421
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    The problem is, only one window can be active at a time, and your chosen actor is determined based on your cursor position within that one window. You'd have to pretty much rewrite the entire scene to accommodate real different windows. And that's going to make it awkward, as the formation, equip, skills menus are all based on choosing your actor first.
     
    #2
    wonderjosh3000 likes this.
  3. Poryg

    Poryg Dark Lord of the Castle of Javascreeps Veteran

    Messages:
    3,930
    Likes Received:
    9,930
    Location:
    Czech Republic
    First Language:
    Czech
    Primarily Uses:
    RMMV
    Well, the raw four windows will require some serious rework, but it won't be as awkward as @Shaz said.
    I'm not sure how would the busts work out with it though, since I don't want to analyse the 3rd party plugin.
    Anyway, for your windows:
    1. You'll be creating four windows instead of one Window_MenuStatus. For this I recommend to rename the
    Scene_Menu.prototype.createStatusWindow to
    Scene_Menu.prototype.createStatusWindows
    and handle it from there.
    2. WIndows will be Window_Selectable.prototype with max items set to 1. Preferably you'll have these windows stored inside one array for easier access.
    3. You need to rework the index method. By default the index method returns window's index variable. Since you'll have X windows, it's a pain to define one window that carries the variable. The easiest way is to define an _actorIndex property to the scene's window layer, because then the windows can use
    Code:
    this.parent._actorIndex
    .
    The solution on how to do that is simple:
    Code:
    Window_MenuStatus.prototype.index = function () {
    return this.parent._actorIndex;
    }
    
    // Creating the extra property in the window layer
    Scene_Menu.prototype.createWindowLayer = function () {
    Scene_MenuBase.prototype.createWindowLayer.call(this);
    this._windowLayer._actorIndex = 0;
    this._windowLayer._currentActorSelected = 0; //this variable is important for handling currently selected actor for formation command. If you don't use it, feel free to ignore.
    } 
    4. It's important to redefine cursorUp, cursorDown, cursorPageup and cursorPagedown to not change the window's index, but to change the window.parent's actorIndex property. They will also deactivate and deselect the current window and activate and select(0) the next window.
    Code:
    Window_MenuStatus.prototype.cursorDown = function () {
    if (this.index() == this.maxIndex()) return;
    this.parent._actorIndex++;
    SceneManager._scene.drawWindows();
    }
    5. Change the commands mentioned by @Shaz to accomodate the changes. You can find them in rpg_scenes under Scene_Menu.prototype.
    Code:
    Scene_Menu.prototype.commandFormation = function () {
    this._windowLayer._formationMode = true;
    this.selectLastWindow();
    this._statusWindows[this._windowLayer._actorIndex].activate();
    for (var i in this._statusWindows) this._statusWindow[i].setHandler("ok", this.onFormationOk.bind(this);
    }
    Of course I'm not going to provide the whole solution, since it's at least 8 hours of work for me and I currently don't have time to make plugins. So I'll let you figure it out.
     
    #3
    wonderjosh3000 likes this.
  4. wonderjosh3000

    wonderjosh3000 Veteran Veteran

    Messages:
    57
    Likes Received:
    37
    Location:
    The Frosty Plains of The Great White North
    First Language:
    English
    Primarily Uses:
    RMMV
    Holy smokes, I didn't realize what my question entailed, but as you guys have explained it, it totally makes sense.

    BUT I'LL GIVE IT A SHOT!

    Thanks for providing the framework! If it proves to be insurmountable after x amount of time, perhaps I'll do the work-around like I had mentioned the original post. But I'll give it the ol' college try first and I'll let you know how it's going and if I have any questions! :thumbsup-right:

    EDIT:

    Well, looks like this might not be a feasible route for the look I want, especially since I can get the look without all the coding. It's a bit of a cheat but it's something I can do fairly easily compared to diving into a wild amount of JavaScript that's over my head! Hopefully this thread will help others out who are looking to do this!
     
    Last edited: Feb 14, 2019
    #4

Share This Page