Announcement

Collapse
No announcement yet.

Auto Settings - Game options and input binding toolkit

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    I have another hotfix to submit:

    Inside AutoSettingsConfig.h

    Code:
    class UAutoSettingsConfig : public UObject
    should be

    Code:
    class AUTOSETTINGS_API UAutoSettingsConfig : public UObject
    Without this, you are not able to use this in C++ classes because of the modules.

    Thanks!

    Leave a comment:


  • replied
    Perfect! Thanks for the update!

    Leave a comment:


  • replied
    Got a double hotfix here, enjoy

    1.5.3 Release Notes
    - Fixed crash in some projects due to KeyLabel binding a delegate that is already bound

    1.5.4 Release Notes
    - Fixed SetPlayerKeyGroup (for dynamic icon display based on input device) not working

    Leave a comment:


  • replied
    Hey grujicbr, thanks a lot for the report! I'll address those bugs in a hotfix.

    SetPlayerKeyGroup should have been calling SavePlayerInputMappings with the modified struct to commit them, otherwise it doesn't make any changes at all.

    I might look into exposing finer control of the ActionLabel layout in a future version too but glad you were able to get it working.

    Cheers!

    Leave a comment:


  • replied
    Another feature support request I would love to have is having support for orientation for action labels but maybe you have an idea how to support this already:

    Example:

    Currently if have an action label which says

    [X ] Icon_Jump

    This completely works, but it looks quite weird, this is because your horizontal box in the actionLabel code is inserting left to right,
    and if the user sets the keycombo to be

    [CTRL + X]
    Icon_Jump

    We will notice that the text overflows over the Icon_jump (i put it on two lines to illustrate point but i mean to say single line, with text over icon).

    Do you have any suggestions on how to support these 2 alternate configurations:

    [ x ] Icon_Jump (in this case when X changes to CTR + X, it would also expand to the left and not the right)
    and
    [ X] Icon_Jump (in this case when X changes to CTRL + X, it would expand to the left and not the right)

    * Edit:

    I figured out how to do this:

    ActionLabel.h

    Code:
    UENUM(BlueprintType)
    enum class EHLabelAlignment : uint8
    {
        Left, // Everything is aligned to the left
        Right, // Everything is aligned to the right
        Center, // Everything is aligned to the center
        Count
    };
    Add new property inside ActionLabel class

    Code:
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Action Label")
        EHLabelAlignment ActionAlignment = EHLabelAlignment::Left;
    Wrap the code inside NativePreconstructIO with these two function calls:

    Code:
    if (ActionAlignment == EHLabelAlignment::Right || ActionAlignment == EHLabelAlignment::Center)
        AddAlignmentSeparator();
    
    GetKeyContainer()->AddChild(ShiftLabel);
    ShiftSeparator = AddSeparatorIfValid();
    
    GetKeyContainer()->AddChild(CtrlLabel);
    CtrlSeparator = AddSeparatorIfValid();
    
    GetKeyContainer()->AddChild(AltLabel);
    AltSeparator = AddSeparatorIfValid();
    
    GetKeyContainer()->AddChild(CmdLabel);
    CmdSeparator = AddSeparatorIfValid();
    
    GetKeyContainer()->AddChild(PrimaryKeyLabel);
    
    if (ActionAlignment == EHLabelAlignment::Left || ActionAlignment == EHLabelAlignment::Center)
        AddAlignmentSeparator();
    Also add this function to the class::

    Code:
    void UActionLabel::AddAlignmentSeparator()
    {
        if (USpacer* spacer = WidgetTree->ConstructWidget<USpacer>())
            if (UHorizontalBoxSlot* slot = Cast<UHorizontalBoxSlot>(GetKeyContainer()->AddChild(spacer)))
                slot->SetSize(FSlateChildSize(ESlateSizeRule::Fill));
    }
    Last edited by grujicbr; 01-10-2019, 08:14 PM.

    Leave a comment:


  • replied
    Hi,

    Thank you for the great plugin, I have found two bugs so far when using it in my C++ UE4.21 project which I fixed but you might want to push through in the official plugin:

    1. AutoSettings\Source\AutoSettings\Private\InputMapping\UI\KeyLabel.cpp

    Inside nativeConstruct, you are adding a DynamicCallback into the globalkeyicontag manager *however* when using this in a c++ project and adding an actionlabel to a widget, and that widget is added into a horizontalbox, the re-creation keeps the pointer alive while recreating the data which causes a crash because the same pointer is added MANY times. Simple fix is to change:

    Code:
    UGlobalKeyIconTagManager::Get()->OnGlobalKeyIconTagsModified.AddDynamic(this, &ThisClass::OnGlobalKeyIconTagsModified);
    to

    Code:
    UGlobalKeyIconTagManager::Get()->OnGlobalKeyIconTagsModified.AddUniqueDynamic(this, &ThisClass::OnGlobalKeyIconTagsModified);
    2. AutoSettings/Source/AutoSettings/Private/InputMapping/InputMappingManager.cpp

    The function which *changes* the single instance data is not correct when a user presses a different input type. In your sample project, you have the user hook into the anykey function and call

    Code:
    UInputMappingManager::SetPlayerKeyGroupStatic(this, UAutoSettingsConfig::GetKeyGroupStatic(key));
    Which in turn calls

    Code:
    void UInputMappingManager::SetPlayerKeyGroup(APlayerController* Player, FGameplayTag KeyGroup)
    {
    FPlayerInputMappings InputOverride = FindPlayerInputMappings(Player);
    InputOverride.PlayerKeyGroup = KeyGroup;
    
    // Even though the actual mappings haven't changed it all, broadcast so that widgets that do care about the new value can update
    Get()->OnMappingsChanged.Broadcast(Player);
    }
    This code is support to *edit* the playerinput mappings and provide it the correct playerkeygroup *BUT* this function FindPlayerInputMappings is returning a COPY of the original data,
    so setting the playerkeyground here does not work at all. I noticed that you do this in multiple places and it seems to work but that is ONLY because you are broadcasting the copy of the playerinputmappings in the other cases and here you do not. I added a local function for now:


    Code:
    void UInputMappingManager::SetPlayerKeyGroup(APlayerController* Player, FGameplayTag KeyGroup)
    {
        UpdatePlayerInputMappings(Player, KeyGroup); // new function
    
        // Even though the actual mappings haven't changed it all, broadcast so that widgets that do care about the new value can update
        Get()->OnMappingsChanged.Broadcast(Player);
    }
    
    void UInputMappingManager::UpdatePlayerInputMappings(APlayerController* Player, FGameplayTag KeyGroup)
    {
    if (!ensure(Player))
    {
    return;
    }
    
    FPlayerInputMappings FoundMappings;
    bool bSuccess = IAutoSettingsPlayer::GetInputMappings(Player, FoundMappings);
    
    if (bSuccess)
    {
    UE_LOG(LogAutoSettingsInput, Verbose, TEXT("Found input mappings for %s with via IAutoSettingsPlayer::GetInputMappings"), *Player->GetHumanReadableName());
    FoundMappings.PlayerKeyGroup = KeyGroup;
    return;
    }
    
    // Player ID string to compare
    FString PlayerIdString = IAutoSettingsPlayer::GetUniquePlayerIdentifier(Player);
    
    UE_LOG(LogAutoSettingsInput, Verbose, TEXT("Checking internal mappings for %s with ID %s"), *Player->GetHumanReadableName(), *PlayerIdString);
    
    for (FPlayerInputMappings& PlayerInputMapping : PlayerInputOverrides)
    {
    // Compare ID strings
    if (PlayerIdString == PlayerInputMapping.PlayerId)
    {
    UE_LOG(LogAutoSettingsInput, Verbose, TEXT("Found existing input mappings"));
    PlayerInputMapping.PlayerKeyGroup = KeyGroup;
    return;
    }
    else
    {
    // Backwards compatibility for old mappings with stored PlayerIndex
    FString PlayerIndexString = FString::FromInt(PlayerInputMapping.PlayerIndex);
    if (PlayerIdString == PlayerIndexString)
    {
    UE_LOG(LogAutoSettingsInput, Verbose, TEXT("Found existing input mappings based on old player index"));
    // Update to new string format
    PlayerInputMapping.PlayerId = PlayerIndexString;
    PlayerInputMapping.PlayerKeyGroup = KeyGroup;
    return;
    }
    }
    }
    
    return;
    }
    I will use these local changes until you release an update to fix them
    I ran into these cases very simply by placing an actionlabel in a widget and pressing controller vs keyboard key and not seeing the UI update.

    Thanks for the great plugin otherwise!
    Last edited by grujicbr; 01-10-2019, 08:08 PM.

    Leave a comment:


  • replied
    Albie_123

    Hotfix for the previously discussed category issue is now live - if there are any other issues please let me know, thanks!

    (It has to be updated via engine version 4.20 or 4.21 > Installed Plugins in the Epic launcher)

    Leave a comment:


  • replied
    Originally posted by Albie_123 View Post
    Just purchased, getting the following error on packaging:

    Code:
    UATHelper: Packaging (Windows (64-bit)): C:/Program Files/Epic Games/UE_4.20/Engine/Plugins/Marketplace/AutoSettings/Source/AutoSettings/Public/InputMapping/UI/InputLabel.h(42) : LogCompile: Error: An explicit Category specifier is required for Blueprint accessible functions in an Engine module.
    UATHelper: Packaging (Windows (64-bit)): C:/Program Files/Epic Games/UE_4.20/Engine/Plugins/Marketplace/AutoSettings/Source/AutoSettings/Public/InputMapping/UI/InputMapping.h(22) : LogCompile: Error: An explicit Category specifier is required for Blueprint accessible functions in an Engine module.
    UATHelper: Packaging (Windows (64-bit)): C:/Program Files/Epic Games/UE_4.20/Engine/Plugins/Marketplace/AutoSettings/Source/AutoSettings/Public/InputMapping/UI/InputMapping.h(26) : LogCompile: Error: An explicit Category specifier is required for Blueprint accessible functions in an Engine module.
    That's an issue with the recent update, the hotfix has already been submitted but is waiting for Epic's approval.

    You can work around it by copying the plugin from <Engine install directory>/Engine/Plugins/Marketplace/AutoSettings to <Project directory>/Plugins/AutoSettings

    Sorry about that! Hopefully the fix goes through quickly.

    Leave a comment:


  • replied
    Just purchased, getting the following error on packaging:

    Code:
    UATHelper: Packaging (Windows (64-bit)):   C:/Program Files/Epic Games/UE_4.20/Engine/Plugins/Marketplace/AutoSettings/Source/AutoSettings/Public/InputMapping/UI/InputLabel.h(42) : LogCompile: Error: An explicit Category specifier is required for Blueprint accessible functions in an Engine module.
    UATHelper: Packaging (Windows (64-bit)):   C:/Program Files/Epic Games/UE_4.20/Engine/Plugins/Marketplace/AutoSettings/Source/AutoSettings/Public/InputMapping/UI/InputMapping.h(22) : LogCompile: Error: An explicit Category specifier is required for Blueprint accessible functions in an Engine module.
    UATHelper: Packaging (Windows (64-bit)):   C:/Program Files/Epic Games/UE_4.20/Engine/Plugins/Marketplace/AutoSettings/Source/AutoSettings/Public/InputMapping/UI/InputMapping.h(26) : LogCompile: Error: An explicit Category specifier is required for Blueprint accessible functions in an Engine module.

    Leave a comment:


  • replied
    Version 1.5 for UE 4.20 and version 1.5.1 adding UE 4.21 support have been released!

    1.5.1
    • UE 4.21 now supported

    1.5

    New:
    • PlayerControllers can determine which input preset they should use by default via IAutoSettingsPlayer interface
    • PlayerControllers can determine how to save and load input mappings via IAutoSettingsPlayer interface This is useful if you need to store saved mappings yourself instead of using the default config implementation
    • Added a OnPressed capture mode to BindCapturePrompt which makes it possible to capture input on key down rather than key up, if you are not using modifier keys
    • BindCapturePrompt can be restricted to only accept input from a Key Group, rejecting other input and staying open
    • Added BlacklistedActions and BlacklistedAxes to Auto Settings config, allowing input mappings to be ignored by the system
    • Exposed some more properties of various widgets with BlueprintReadWrite and BlueprintReadOnly
    • Added "Update" functions to some widget types that is called when properties change at runtime, which can be used for responding to data changes as an alternative to UMG's data binding
    • InputMapping (ActionMapping and AxisMapping) can now be passed a chord from an external source to bind it to an action or axis
    • Added OnChordRejected and OnCapturePromptClosed delegates to BindCapturePrompt
    • Added bIgnoreGameViewportInputWhileCapturing property to BindCapturePrompt to control if the prompt should block input from the game viewport
    Editor:
    • ActionLabel and AxisLabel will now preview the default input preset in the editor (e.g. if an ActionLabel is for Jump, it would show Spacebar if that's the default mapping) This requires the KeyLabel you are using to implement UpdateKeyLabel
    • Added TitleProperty meta tag to many config arrays allowing the contents to be viewed more easily while editing Auto Settings config in project settings
    Last edited by Sam Bonifacio; 11-18-2018, 03:12 AM.

    Leave a comment:


  • replied
    1.4.1 Release Notes
    • Properly exposed Apply Setting and Save Setting functions to Blueprint. These were intended to be exposed in a previous version but not correctly set up as static Blueprint-callable functions.

    Leave a comment:


  • replied
    Version 1.4 supporting UE 4.20 released!

    http://autosettings.readthedocs.io/e...t/versions/#14
    • UE 4.20 now supported
    • Plugin developer config (AutoSettings page in Project Settings) converted to use Game category instead of EditorPerProjectUserSettings category

    Important note: Because of the config category change, projects upgrading from older versions of the plugin will have to move or copy the [/Script/AutoSettings.AutoSettingsConfig] category, including all of its entries, from YourProject/Config/DefaultEditorPerProjectUserSettings.ini to YourProject/Config/DefaultGame.ini to retain existing config values.

    Leave a comment:


  • replied
    AutoSettings 1.3 for UE 4.19 released

    http://autosettings.readthedocs.io/e...t/versions/#13

    New:
    • Added option to disable automatic player input initialization in plugin settings and call it manually using InitializePlayerInputOverrides.
    • Added the ability for projects to override how the plugin uniquely identifies players for storing inputs by implementing the AutoSettingsPlayer interface on PlayerController - by default it still uses the Controller ID of the local player.
    • Slider setting no longer auto-saves every delta while the handle is being dragged, which was performance heavy as it was writing to config each time. Now it can still auto-apply while the handle is being dragged, but only auto-saves once the handle is released.
    • Added option to control sensitivity of mouse-axis binding, specifying how far the mouse must move before it is registered.
    • Added the ability to manually add input overrides using AddPlayerActionOverride and AddPlayerAxisOverride.
    • Added the option for projects to specify special escape keys that cancel input binding without capturing anything.
    • Added HasUnappliedChange to settings. Previously you could only check HasUnsavedChange.
    • Saving a setting automatically applies it if it hasn't been already. This removes the possibile state of having saved but unapplied changes.

    Fixed:
    • Setting widgets now read their initial value from their applied console variable if available instead of saved config. This fixes the unintended behaviour of settings showing the saved value instead of the applied value where the two differ.
    • Fixed a bug with input binding where left mouse button would register as none / invalid if pressed within a second or so of the prompt opening.
    • Fixed bug with some saved settings such as max FPS being overridden by engine initialization. Saved setting values are now applied after engine initialization so that they take precedence over engine values.
    • Fixed Cancel reverting the setting to the applied value. It now reverts to the saved value instead.
    • Fixed issues while saving settings with masked values (e.g. Resolution / window mode) recombining with applied values instead of saved values.
    • Fixed settings with unapplied changes being incorrectly reverted when any console variable is changed, including other settings

    Example project:
    • Split each page of settings into their own widgets, making them easier to manage.
    • Added UI to video settings page to demonstrate manual save / apply / cancel functionality.
    • Added gamma setting to video settings.

    Let me know if there are any issues - thanks for supporting the plugin!
    Last edited by Sam Bonifacio; 07-03-2018, 08:11 AM.

    Leave a comment:


  • replied
    I just got the plug in from the summer sale and I think it was well worth the money... once I figure out my problem. The example project runs great. I migrated the menu into my project (4.19.2) and when i open the menu, most of the settings don't work. When I stop PIE, I get errors about several CVars not being found. Is there some project set up that I have to do to get it all set up? (Such as adding CVars to an ini or something of that nature)?

    Update... I read again and realized that I did not read well enough. I figured out that I did not add the calls to initialize the CVars, RTFM me....
    Last edited by brian.boettger; 06-08-2018, 04:12 PM.

    Leave a comment:


  • replied
    1.2.4 Changelist
    • ComboBox setting now chooses not to apply or save settings when the selection is changed externally - this fixes a crash that could happen when constructing new widgets
    • Fixed a crash when external code tries to register CVar change callback delegates that are already registered - warn instead
    Last edited by Sam Bonifacio; 06-11-2018, 11:21 PM.

    Leave a comment:

Working...
X