Giter Site home page Giter Site logo

punchableplushie / godot-game-settings Goto Github PK

View Code? Open in Web Editor NEW
374.0 2.0 17.0 53.82 MB

Create and manage game settings in Godot Engine.

License: MIT License

GDScript 100.00%
godot game-development ggs addons gdscript godot-engine godot-game-settings plugins

godot-game-settings's Introduction

Godot Game Settings (GGS)

Godot Game Settings allows you to create and manage game settings for your small to medium projects. It takes care of all the fundamental functionalities required to have proper game settings, including predefined logic for common settings (e.g. display, audio, input), UI components, saving/loading data, and applying settings.

View the documentation for information on how to use the plugin.

View the demo branch for information on how to get the demo.

demo preview

Major Update: v3.1.0

This version completely reworks how the categories and settings are stored, and adds several QoL features to the plugin.

General

  • Categories and Settings are now saved on the disc instead of being subresources of the plugin data. This allows more flexibility when handling them such as moving, renaming, and deleting.
  • Icon and description support for settings and components have been removed. While this was a "cool" feature, it didn't add anything significant and just added to the code bloat since I don't think people would actually spend time designing icons and writing descriptions for their own custom settings.
  • The plugin now applies settings (executes their logic) using a separate thread instead of doing it on the main thread.
  • The preferences window now includes a button for updating the plugin theme to reflect the theme of your own Godot editor.
  • The preferences window has been slightly redesigned for clarity.
  • A "Send Feedback" button has been added which takes you to a Google survey where you can provide feedback regarding the plugin. You can still request features and QoL changes using issues on GitHub.
  • Options were added to the Save File menu that allow you to remake the save file from either current or default values.

Settings

  • The settings panel UI has been reworked.
  • You can now group settings in a category for organization. Additionally, you can add settings to multiple groups at the same time, speeding up the process of adding settings to a category.
  • The way custom settings are created and added has been slightly changed and streamlined.
  • The predefined settings (previously in the settings directory) are now considered to be templates.
  • The templates directory (previously the settings directory) now supports tree walking. You can now organize your templates in folders.

  • The input setting has been reworked to use InputEvent resources instead of clunky strings.
  • The input setting now supports multiple inputs of the same type for each action (i. e. you can have more than one keyboard or gamepad event for an action).

Components

  • All list components now support using item IDs instead of indices.
  • The input button now supports icons for mouse events.
  • UI components now warn the user when they don't have a setting or their setting is invalid.
  • You can now set up sound effects for UI components.

Full Changelog

godot-game-settings's People

Contributors

andygeorge avatar norodix avatar punchableplushie 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  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  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  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

godot-game-settings's Issues

Cannot remap inputs to arrow keys

Trying to remap some inputs to arrow keys causes the right and left arrow to be saved as B and X respectively.

I suspect this occurs during saving or loading because setting it behaves normally. Exiting the setting menu and going back overwrites left and right with X and B.

I noticed it in our game, but I also tested it in the GGS demo, it happens just the same.

Steps to reproduce:

  • Start the demo UI
  • Set move inputs to the respective arrows
  • close the ui
  • start the UI again, observe the left and right input names

item_order not getting set

I created a new category "Assist Mode" in my game, and added three custom-made settings to it. However, whenever running the game, these settings would get reset to their default. When opening up the plugin_data.tres, I found the category:

[sub_resource type="Resource" id="Resource_8kxsx"]
resource_name = "AssistMode"
script = ExtResource("1_8aw2k")
name = "AssistMode"
settings = {}
item_order = Array[Resource("res://addons/ggs/classes/resources/ggs_setting.gd")]([])

It looks like the item_order isn't getting properly set, even though I added the settings to the category. Any ideas why?

image

This image was taken when the settings were first added. After closing Godot and reopening the project, the settings were gone.

Slider can override setting value hint string range

I don't know if it's intended, but apply(value) can still take values higher that 0,1 range from slider. Maybe slider should change it's min/max values based on it's resource?
My setting:
image
Values from slider:
image

Crash when add category

res://addons/ggs/editor/category_panel/category_panel.gd:38 - Invalid call. Nonexistent function 'add_item' in base 'Tree ()'.

Fullscreen Script Error

Installed v2.0 via the Godot Engine AssetLib tab.

I'm trying to implement the fullscreen setting as explained in the docs. I've added the setting as below in the screen shot.
Screenshot_20210512_163043

I have then setup the fullscreen.gd script on that setting:

extends Node
# value: bool
#	Whether window is fullscreen or not
# window_script_path: String
#	Path to the logic script that's used for changing window size
# window_setting_index: int/String
#	The index of the window size setting in the settings list


func main(value: Dictionary) -> void:
	OS.window_fullscreen = value["value"]
	
	## Execute the window size logic again, in case the player changed the
	# window size while the window was at fullscreen.
	if value["value"] == false:
		var script_resource: Script = load(value["window_script_path"])
		var script_instance: Object = script_resource.new()
		var current = ggsManager.settings_data[str(value["window_setting_index"])]["current"]
		script_instance.main(current)
	
	OS.center_window()

And added the control to the screen with the correct setting index.

However when I run the scene I am getting the following error:

Invalid get index 'window_script_path' (on base: 'Dictionary').

Removing the if block in the above function removed the issue but I just thought I'd call it out as I don't see any mention of window_script_path on the How to Use page

Adding settings post-release

Hello! First, thanks for making this plugin, it's amazing! Is it still under development / maintained, or is it abandoned?

To my main question: how does this work when you add settings post-release? For example:

  • Release v1.0 version of the game with "full_screen" setting
  • Release v1.1 version of the game with a new "window_scale" setting

My understanding is that the settings get copied over from the settings JSON file on first run; so if a user runs v1.0 of my game, they will have full_screen in their settings JSON. But when they run v1.1, what happens? Does GGS automatically merge the two JSON files, or add the new settings automatically? If not, is there some additional work needed, or something I can do on my side?

Use different class_name for Utils

Utils is pretty generic name to use for a class and unfortunately it immediately caused issue with another addon which had similarly created utils script with exact same class_name. Using some sort of prefix (i.e. GGSUtils) would propably cause lot less conflicts

Adding new properties crashes the addon

Adding a new settings property to the possibilities can crash the addon.

When there is an existing saved settings resource changing the game and adding a new setting makes the addon search for that category and setting inside that category. When it cannot find that it crashes the addon and the game as well. As far as I can tell, changing the save file in a way that the format is changed so that the addon cannot read it properly crashes it.

Adding a failsafe to instead delete this badly formatted file and recreate one based on the defaults might be the proper way to handle it.

(Awesome plugin btw, thank you!)

Mouse Scroll Wheel Input

I just got around to this, you can only detect mouse wheel using Input.is_action_just_released so there probably should be an option to allow/disallow mouse wheel inputs

Navigate Menus using Keyboard

Is there a way to make the settings menu navigable with just the keyboard? So users can use either the mouse or the keyboard.

I know GGS isn't responsible for the configuration of the Settings-Menu, so maybe setting Focus on those items isn't an issue for this package?

Game crashes when trying to load settings_data.json

I went through all of the required setup steps and I looked through ggs_manager.gd and I can't seem to find an issue. When I delete the settings_data.json from my app data and run the program it crashes when I open my options menu. A settings_data.json file is created fine when running in the editor but when I build it for windows, it creates an empty json in the right location with the right name.

Supporing InputEventJoypadMotion

I have a controller whose left/right/up/down controls return a InputEventJoypadMotion event instead of an InputEventJoypadButton.

Horizontal movements have axis=0 and axis_value=1 for right (-1 for left).
Vertical movements have axis=1 and axis_value=1 for down (-1 for up).

Is there a way to make keybind_gp support this?

Settings Panel does not work properly at first in Godot 4.1

When first starting the project in Godot 4.1, the settings list might not work properly.
Trying to select a category gives the following error:

res://addons/ggs/editor/setting_panel/setting_list.gd:28 - Invalid get index 'item_order' (on base: 'Nil').

And from there on, the setting list seems to "lag" behind. For example, if you select category_1 the plugin doesn't show anything and gives the aforementioned error. Selecting category_2 shows the settings of category_1. Selecting another category after that shows the settings of category_2 and so on.


More Details

The settings list uses the global variable active_category located in ggs_globals.gd to populate the list. When a category is selected, a global signal (category_selected) is fired off. ggs_globals.gd listens for this signal and assigns the category that was just selected to active_category. Finally, the settings list will use the (now valid) active_category to populate the list.

In Godot 4.1, and at least until the plugin is restarted, it seems like the setting list code is executed before active_category is set properly, which leads to the mentioned issue.


I'm not quite sure why this is happening but it happens when upgrading from 4.0.x to 4.1. And I'm not sure if it's an issue only on my side or something that happens for everyone.
Restarting the plugin (Project Settings โ†’ Disable the plugin, then enable it again) seem to temporarily fix it until the project is opened again.

Documentation Feedback

Hey! Sorry if this isn't the place for this but I thought I'd quickly share some feedback with you because you were asking. The google feedback form had too many required irrelevant questions for what I wanted to say and I didn't want to pollute your data with fake answers.

I tried to use this project for a 7 day game jam (currently on-going) so I do want to preface this by saying that I didn't give this project anywhere close to the proper time or thought it deserves (about 15-20 minutes total) and that I'm sure it's great but I can share my perspective as an outsider that saw this project and thought "oh I can make a quick settings menu? Great!" and tried to use it with no context.

Going through, installation and set up seemed good, there were no real issues. The troubleshooting page seemed pretty good and fixed an issue I had. My primary issue is that as far as I can tell, nowhere in the docs does it describe how to actually connect the settings page. My vague impression was that stuff done in the editor view was making some kind of settings type somewhere that I could edit or drop into my SceneTree and make it appear when a button is pressed. Perhaps I was supposed to drag components into my own settings scene? But if so then it's less clear why I was going through the process of using that editor view.

Either way, I just thought it might be helpful to share that as someone with 0 context on this project coming in and trying to make a quick and dirty menu in about 30 minutes or so that my impression was that I could make what I needed faster without this project. Primarily because the "Time To 'Hello World'" was too long and the path there was unclear. I think it could be invaluable to have a bit in the docs about what node I should add to my scene tree or what API call I should make to make the settings page appear or hit me over the head with an explicit "This plugin provides components to build your own settings page, here's a Hello World example". I did see that you had a demo project so perhaps that would have been sufficient for my needs but it seemed like too much work to get that set up when I was hoping to see screenshots/code snippets to get the smallest possible menu set up immediately.

The project seems really cool and I'd love to check it out again later when I have more to dedicate to figuring it out, and if quick and dirty game jam menus made by people with 0 context aren't the goal of this project then you can safely ignore this feedback.

godot 4.2 beta4 have a error

When running the project using Godot 4.2 beta 4, there will be an error when adding the UI settings:

image

Original code

func _on_List_item_activated(item_index: int) -> void:
	var EI: EditorInterface = ggsUtils.get_editor_interface()
	var ES: EditorSelection = EI.get_selection()

If you modify the code like this, it will run normally:

func _on_List_item_activated(item_index: int) -> void:
	var EI = ggsUtils.get_editor_interface()
	var ES = EI.get_selection()

Upgrading existing project from GGS 3.0 to 3.1?

Only yesterday did I find out about this great little plugin, and implemented it into my ongoing project. And to my surprise, not one day later and there's already a major update.

I am struggling with porting my project to the new version, likely because of all the file storing changes. I tried reinstalling from scratch, replacing the files in the plugin folder, resetting the plugin, and whatnot.
Any suggestions or method on how to port?

Thanks,
Orez

Godot 4 version

Will the addon be ported to Godot 4 and when could this be?

Window Size Setting Sizes don't get shown in lists

Godot 4.1.1

I create a Window Size setting from the list and I type in a size setting and then apply a node such as an option list or an arrow list. The issue is in the Arrow List options is set to "null" and the same with the option list except it wont crash with the option list but no options (or items) will appear and I can't scroll through the options in the editor despite the resource saying there's a size.

windowsize
(Image of an Option List with the setting in it with the size)

=====

optionbutton
(Image of the same Option List's child having no items in it)

=====

addon
(Showing what it looks like in game)

Receive error on add category

Receive this on add category
<built-in>:43 - Invalid call. Nonexistent function 'load_list' in base 'ItemList (category_list.gd)'.

Window moves to secondary monitor when changing resolution

When starting a game with the Display Size setting it moves the window to my secondary monitor. This still happens when I drag the window back to the main monitor and then change the resolution. The resolution changes but the window moves to the second monitor. I've also noticed that it appears to center it according to the dimensions of the primary monitor but on the secondary monitor. With this being that case much of the window is off screen (my primary monitor is much larger).

Any thoughts on what's doing this and if it's maybe an issue with my implementation?

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.