[REL] Planet Name Themes

Discussion in 'Mod Discussions' started by cptconundrum, January 25, 2014.

  1. emraldis

    emraldis Post Master General

    Messages:
    2,641
    Likes Received:
    1,843
    Could you add a UI option do make your own theme? I can go into the mod files and make my own, but it might be easier for most people to have a UI that does that. Not to mention it would look cooler that way.

    Other than that, keep up the good work, loving the mod!
  2. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    I made it as easy as I could to allow for new themes, but only through creating new theme files. Javascript doesn't have permission to write new files to the filesystem, so I would have to keep themes in local storage if I wanted them to be editable. The reason I went with doing it this way is because I wanted to make the theme files easy to share, but not necessarily as easy to create.

    If you make a new theme, be sure to post it here! Making them takes a lot of time and it would be a waste if only you got to use it. I can add it to PAMM for everyone! Remember too that you unfortunately have to make new entries in modinfo.json in order for it to see your new theme.
  3. emraldis

    emraldis Post Master General

    Messages:
    2,641
    Likes Received:
    1,843
    All right, that's fine! thanks for the fast answer. Was gonna make a theme your way any way, but was wondering if it was possible.
  4. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    Can't wait to see what you come up with!
  5. emraldis

    emraldis Post Master General

    Messages:
    2,641
    Likes Received:
    1,843
    lol, ok, i'm ashamed of myself for having to do this, but here we go:

    "Directions unclear, got d**** stuck in ceiling fan"

    But seriously, I done broke it. :oops:
  6. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    Haha, what broke? If I did my job right (no promises), it should be simple enough. If you ever seriously break a mod, PAMM can uninstall and reinstall.
  7. emraldis

    emraldis Post Master General

    Messages:
    2,641
    Likes Received:
    1,843
    I just have no idea how to add the mod to the modinfo.json file. I opened it with word, turned this:

    Code:
        "settings": [
            "coui://ui/mods/cPlanetNameThemes/cPlanetNameThemes.js",
            "coui://ui/mods/cPlanetNameThemes/themes/legacy.js",
            "coui://ui/mods/cPlanetNameThemes/themes/stargate.js",
            "coui://ui/mods/cPlanetNameThemes/themes/star_trek.js",
            "coui://ui/mods/cPlanetNameThemes/themes/star_wars.js",
            "coui://ui/mods/cPlanetNameThemes/settings.js"
        ],
        "system_editor": [
            "coui://ui/mods/cPlanetNameThemes/cPlanetNameThemes.js",
            "coui://ui/mods/cPlanetNameThemes/system_editor.js",
            "coui://ui/mods/cPlanetNameThemes/themes/legacy.js",
            "coui://ui/mods/cPlanetNameThemes/themes/stargate.js",
            "coui://ui/mods/cPlanetNameThemes/themes/star_trek.js",
            "coui://ui/mods/cPlanetNameThemes/themes/star_wars.js"
        ],
        "new_game": [
            "coui://ui/mods/cPlanetNameThemes/cPlanetNameThemes.js",
            "coui://ui/mods/cPlanetNameThemes/new_game.js",
            "coui://ui/mods/cPlanetNameThemes/themes/legacy.js",
            "coui://ui/mods/cPlanetNameThemes/themes/stargate.js",
            "coui://ui/mods/cPlanetNameThemes/themes/star_trek.js",
            "coui://ui/mods/cPlanetNameThemes/themes/star_wars.js"
    into this:

    Code:
        "settings": [
            "coui://ui/mods/cPlanetNameThemes/cPlanetNameThemes.js",
            "coui://ui/mods/cPlanetNameThemes/themes/legacy.js",
            "coui://ui/mods/cPlanetNameThemes/themes/stargate.js",
            "coui://ui/mods/cPlanetNameThemes/themes/star_trek.js",
            "coui://ui/mods/cPlanetNameThemes/themes/star_wars.js",
            "coui://ui/mods/cPlanetNameThemes/settings.js"
            "coui://ui/mods/cPlanetNameThemes/themes/Blargh.js"
        ],
        "system_editor": [
            "coui://ui/mods/cPlanetNameThemes/cPlanetNameThemes.js",
            "coui://ui/mods/cPlanetNameThemes/system_editor.js",
            "coui://ui/mods/cPlanetNameThemes/themes/legacy.js",
            "coui://ui/mods/cPlanetNameThemes/themes/stargate.js",
            "coui://ui/mods/cPlanetNameThemes/themes/star_trek.js",
            "coui://ui/mods/cPlanetNameThemes/themes/star_wars.js"
            "coui://ui/mods/cPlanetNameThemes/themes/Blargh.js"
        ],
        "new_game": [
            "coui://ui/mods/cPlanetNameThemes/cPlanetNameThemes.js",
            "coui://ui/mods/cPlanetNameThemes/new_game.js",
            "coui://ui/mods/cPlanetNameThemes/themes/legacy.js",
            "coui://ui/mods/cPlanetNameThemes/themes/stargate.js",
            "coui://ui/mods/cPlanetNameThemes/themes/star_trek.js",
            "coui://ui/mods/cPlanetNameThemes/themes/star_wars.js"
            "coui://ui/mods/cPlanetNameThemes/themes/Blargh.js"
    And now I don't see the themes in my options at all.

    I should really learn how to code before messing with this stuff. Those classes I took years ago just aren't that easy to remember...
  8. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    Second to last line in each of those sections needs to end in a comma.
    trialq likes this.
  9. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    And there's no better way to learn how to code than by playing with someone else's code and breaking it a lot until you see how it works.

    There is also the free book posted here which is written for people new to JavaScript but not completely new to programming. I have been writing JavaScript for years and I still find it useful though.
  10. emraldis

    emraldis Post Master General

    Messages:
    2,641
    Likes Received:
    1,843
    Why thank you! Now I wish unreal script had a book like that.
  11. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    Fixed it! Actually I just added a hack that finds the div that the name is supposed to go in and fills it with the name. It bypasses knockout, but it won't matter to most people. I might just have to update this mod every time uber changes that page.
  12. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    That works! :D
  13. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    Anyone know why this mod shows up halfway down the list in PAMM even when it was just updated?
  14. proeleert

    proeleert Post Master General

    Messages:
    1,681
    Likes Received:
    1,656
    Check your date ? It should be yyyy/mm/dd
  15. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    modinfo.json:
    Code:
    "date": "2014/02/02",
  16. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
  17. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,328
    Likes Received:
    2,125
    Seems fine to me with the Linux version of PAMM. Are you sure you are sorting by "last updated"?
    Also, there are five mods that have 2014/02/02, so you should be somewhere among the first five.
  18. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    Just verified that it still works in v61250. I had a biome name for desert that was mapped to earth planets of a certain temperature, but it looks like it is picking up the new Desert biome and going with that. I love when things just work! :)
  19. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    Works in Gamma v.62037
  20. ORFJackal

    ORFJackal Active Member

    Messages:
    287
    Likes Received:
    248
    Seems broken on v.62857. I'm getting the following exceptions e.g. when trying to add a slot to a team:

    Code:
    Uncaught TypeError: Cannot read property 'biome' of undefined
    getBiome
    getPlanetNames
    cPlanetNameThemes.getPlanetName
    model.loadRandomSystem
    NewGameViewModel.self.regenSystem new_game.js:690
    click
    (anonymous function)
    jQuery.event.dispatch
    elemData.handle

Share This Page