[TeachMe]PiP Button Mod "NightShiftPIPCam"

Discussion in 'Work-In-Progress Mods' started by thetrophysystem, November 18, 2014.

  1. thetrophysystem

    thetrophysystem Post Master General

    Messages:
    7,050
    Likes Received:
    2,874
    The mod idea I have, and would like in vanilla as I requested in another mod, is "more PIP buttons" to make the PIP useable like the camera from "Five Nights at Freddy's" except for the entire star system.

    This would be my first UI mod. UI mods are of a different breed entirely from Server Mods. I know code, but not very well, I mainly feel around. Well, things I am trying to do, and would like any information anyone knows as to where to look for the hooks ingame at, are:

    1) A button added to the PiP window, that acts as "keypress toggle planet forward"
    2) A button added to the PiP window, that acts as "keypress toggle planet backward"
    3) A button added to the PiP window, that acts as "keypress toggle planet to system view"
    4) A button added to the PiP window, that acts as "keypress toggle camera anchor", preferably forward but will settle for 1-4 or something if necesary
    5) A button added to the PiP window, that acts as "keypress toggle camera anchor" backwards if possible
    6) A button that lets you set point as camera anchor, but only if this is possible with 1 button to set a progressive list of anchors, without requiring multiple buttons.

    7) This one is a stretch, but a button added to the PiP window, that automatically toggles the camera every 4 seconds through all the others. If necesary, one that auto-toggles planets and another that auto-toggles anchors, but preferably one that toggles through all of one then all of the other

    Again, feel free to share if you know, the number you are answering for, and the location the hook is ingame naturally (like livegame whicheveritis), what I could use as an example mod for a similar effect, and what code I would need to use to accomplish said effects. Will cite you as references when I make this mod, but assuming I accomplish making it without passing it off outright, at least I get a feeling of self accomplishment and a bit more understanding of ui mod building and my name listed first in the authors :D
    Last edited: November 18, 2014
  2. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    All of these things are possible. I had something similar back when my Draggable Pip mod worked, but it had less functionality to keep the ui less cluttered. The api hooks you will want are all in \PA\Planetary Annihilation\stable\media\ui\main\shared\js\api but you will need some additional javascript to keep a counter of the number of camera anchors that you have set. The engine itself has (except in extreme cases) no limit to the number of camera anchors that you can set, but in practice you are just limited by the number of keys on your keyboard. That is also true for unit control groups, by the way.
    thetrophysystem likes this.
  3. thetrophysystem

    thetrophysystem Post Master General

    Messages:
    7,050
    Likes Received:
    2,874
    The API location is helpful, I literally thought all UI mods referenced hooks the devs created with no documentation, like some sort of science-y intellegent magic.
  4. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    that's my main concept when writing code in general
    proeleert and thetrophysystem like this.

Share This Page