Giter Club home page Giter Club logo

untitledguiguide's People

Contributors

claudemetz avatar jansharp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

untitledguiguide's Issues

Ch 8 - Elements refactor and starting with a weird save

First, thank you so much for writing up this tutorial. I went from zero to being able to mitigate an issue I had with how I ended up progressing through the tutorial!

So long about say chapter 5 I ended up making a save. This save had the GUI open. By the time I'd worked through the updates in Chapter 8 to reference the GUI with the player_global.elements table there wasn't any way to close because the GUI wasn't made with the changes from Chapter 7 so that E and Escape wouldn't even try either. Basically the GUI was lost out there.

So I updated the info.json version number to get .on_configuration_changed to run and added a bit of code there to hunt down the old GUI and get it to close it.

Here is the code if you want to make a supplemental note about really messing up your state/migration.

script.on_configuration_changed(function(config_changed_data)
    if config_changed_data.mod_changes["GUITutorial"] then
        for _, player in pairs(game.players) do
            local player_global = global.players[player.index]
            if not player_global.elements then
                player_global.elements = {}
                player_global.elements.main_frame = player.gui.screen.ugg_main_frame
            end
            local main_frame = player_global.elements.main_frame
            if main_frame ~= nil then toggle_interface(player) end
        end
    end
end)

Some Ideas

Looking great so far. It's very consitent and i would think also easy to follow.
For me personally, even when leanring something new, i feel like it's too verbose, but too verbose is most likely better than the opposite, increasing the chance of misunderstandings. (I could go into detail why i think it's better to be "too verbose" imo because i have lots of reasons, but i don't feel like it's necessary. Just know that it's not a bad thing.)

There are just a few ideas i had. Not sure how to share them, so i pushed them to a separate branch in my fork.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.