Question UPROPERTY writability (Editor, Game.ini, etc.)

Hi,
I developed a plugin that exposes multiple UEPROPERTYs. Right now I implemented them like this:



/** Enables/disables logging messages for actions */
UPROPERTY(config, EditAnywhere, BlueprintReadWrite, Category="Development")
bool LogActions = true;


This allows them to be edited in the Editor (Project Settings → ‘Plugin Name’ → List of Settings) and also via GameSettings.ini.

Now I have certain settings I only want to be editable before packaging and not via the GameSettings.ini. What is the right flag for this case?


 EditDefaultsOnly //?

Thank you in advance :slight_smile:

As far as I know this has to be done on a per-class basis, not a per-property basis. You can try to use it though:

Add:



DefaultConfig


First of all, thanks a lot for answering :slight_smile:

Do you mean DefaultConfig for the UDeveloperSettings Class oder adding DefaultConfig per Property? I haven’t found any reference for this.

My Class looks like this:



UCLASS(config=Game, defaultconfig, meta=(DisplayName="My Plugin"))
class MYPLUGIN_API UMyGameSettings final : public UDeveloperSettings
{
    GENERATED_UCLASS_BODY()
public:
    /** Enables/disables logging messages for actions */
    UPROPERTY(config, EditAnywhere, BlueprintReadWrite, Category="Development")
    bool LogActions = true;

...


I assumed it isn’t uncommon for a plugin to have editable settings before packaging that will be fixed afterwards. Did I use the wrong approach using the Developer/GameSettings to achieve this?

Yeah I think that’s what it should look like.

Out of interest have you tried packaging a game up with this to see what happens?

Yes, it works fine, the only thing being is that all of my plugin’s settings can be overwritten via the GameSettings.ini which I’d like to prevent. I’ll experiment with DefaultsOnly and other Property Specifiers later (Unreal Engine UProperty Specifiers | Unreal Engine 5.2 Documentation).