diff --git a/README.md b/README.md index f90ab184..d314341b 100644 --- a/README.md +++ b/README.md @@ -24,11 +24,11 @@ ## Explosive Gaming -Explosive Gaming (often ExpGaming) is a server hosting community with a strong focus on [Factorio](factorio) and games with similar themes. We are best known for our weekly reset Factorio server with a vanilla+ scenario. Although our servers tend to attract the more experienced players, our servers are open to everyone. You can find us through our [website], [discord], or the public server list with the name ExpGaming. +Explosive Gaming (often ExpGaming) is a server hosting community with a strong focus on [Factorio][factorio] and games with similar themes. We are best known for our weekly reset Factorio server with a vanilla+ scenario. Although our servers tend to attract the more experienced players, our servers are open to everyone. You can find us through our [website], [discord], or the public server list with the name ExpGaming. ## Use and Installation -1) Download our [git repository](stable-dl) for the stable release. For the latest features you can download our [dev branch](experimental-dl). See [releases](#releases) for other major releases. +1) Download our [git repository][stable-dl] for the stable release. For the latest features you can download our [dev branch][experimental-dl]. See [releases](#releases) for other major releases. 2) Extract the downloaded zip file into your Factorio scenario directory: * Windows: `%appdata%\Factorio\scenarios` @@ -40,7 +40,7 @@ Explosive Gaming (often ExpGaming) is a server hosting community with a strong f 5) Once you have made your config changes: open Factorio, select either single or multiplayer, select (host) new game, and finally select our scenario which will be called `scenario-master` or `scenario-dev` under user scenarios. -6) You will now be asked to generate your map and the scenario will load all selected modules. If any module does not load as expected please check `factorio-current.log` in your Factorio directory for errors and report them to our [issues page](issues). +6) You will now be asked to generate your map and the scenario will load all selected modules. If any module does not load as expected please check `factorio-current.log` in your Factorio directory for errors and report them to our [issues page][issues]. ## Contributing @@ -48,7 +48,7 @@ All are welcome to make bug reports, feature requests, and pull requests for our For developers wanting to add features please follow these guidelines: -* All code is documented using ldoc, the end result can be found [here](docs). +* All code is documented using ldoc, the end result can be found [here][docs]. * Changes should be made on your own fork and merged into `dev` through a pull request. * Pull requests are automatically linted and documentation checked. * Pull requests are manually reviewed to maintain code and language quality. @@ -79,7 +79,7 @@ For developers wanting to add features please follow these guidelines: | [1.0][s1.0] | Modulation | [0.15][f0.15] | | [0.1][s0.1] | First Tracked Version | [0.14][f0.14] | -\* Scenario patch releases have been omitted and can be found [here](https://github.com/explosivegaming/scenario/releases). +\* Scenario patch releases have been omitted and can be found [here][releases]. \*\* Factorio versions show the version they were made for, often the minimum requirement to run the scenario. @@ -128,8 +128,9 @@ The Explosive Gaming codebase is licensed under the [GNU General Public License [stable-dl]: https://github.com/explosivegaming/scenario/archive/master.zip [experimental-dl]: https://github.com/explosivegaming/scenario/archive/dev.zip -[factorio]: https://factorio.com/ -[docs]: https://explosivegaming.github.io/scenario/ +[releases]: https://github.com/explosivegaming/scenario/releases +[factorio]: https://factorio.com +[docs]: https://explosivegaming.github.io/scenario [issues]: https://github.com/explosivegaming/scenario/issues/new/choose [website]: https://explosivegaming.nl [discord]: https://discord.explosivegaming.nl diff --git a/expcore/gui/_require.lua b/expcore/gui/_require.lua index 51fc0a14..78aac647 100644 --- a/expcore/gui/_require.lua +++ b/expcore/gui/_require.lua @@ -128,4 +128,17 @@ require 'expcore.gui.left_flow' require 'expcore.gui.helper_functions' require 'expcore.gui.defines' +local Roles = _C.opt_require('expcore.roles') +local Event = _C.opt_require('utils.event') + +if Roles and Event then + Event.add(Roles.events.on_role_assigned, function(e) + Gui.update_top_flow(game.get_player(e.player_index)) + end) + Event.add(Roles.events.on_role_unassigned, function(e) + Gui.update_top_flow(game.get_player(e.player_index)) + end) +end + + return Gui \ No newline at end of file diff --git a/expcore/gui/top_flow.lua b/expcore/gui/top_flow.lua index 39bfb99f..064ee906 100644 --- a/expcore/gui/top_flow.lua +++ b/expcore/gui/top_flow.lua @@ -73,7 +73,8 @@ function Gui.update_top_flow(player) end -- Set the visible state - local allowed = type(authenticator) == 'function' and authenticator(player) or authenticator + local allowed = authenticator + if type(allowed) == 'function' then allowed = allowed(player) end element.visible = is_visible and allowed or false end end