x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Issue with OnClicked in IDetailCustomization

i have class FLevelStatsDetailsCustomization that inheritances from IDetailCustomization. In the CustomizeDetails method, I create custom row and add a Sbutton to it. The button has an OnClicked event to call back to LevelStatsDetailsCustomization::GenerateLevels. When the button is clicked, the method is called; however, the code does call the method GenerateLevelValues on SourceBatchComponent. It is just jumps back to the for line and exits out of the loop, since there is only ever one item being loop over.

In the debugger, I am able to see that ObjectsBeingCustomized, and StrongObjects contain one item which is the item that I am editing, and that item is a UISLevelStats. I dont understand what I am doing wrong.

 FReply FLevelStatsDetailsCustomization::GenerateLevels()
 {
     TArray<UObject*> StrongObjects;
     CopyFromWeakArray(StrongObjects, ObjectsBeingCustomized);
     for (UObject* SourceComponent : StrongObjects)
     {
         UISLevelStats* SourceBatchComponent = CastChecked<UISLevelStats>(SourceComponent);
         SourceBatchComponent->GenerateLevelValues();
         
     }
     return FReply::Handled();
     
 }

Here is ISLevelStats.h where i define UISLevelStats as a subclass of UObject

 UCLASS(BlueprintType, meta = (DisplayThumbnail = "true"))
 class  UISLevelStats : public UObject


My end goal is trying to get designers to edit some properties and click this button to auto filling data into the custom asset.

Update:

I have tried the IsA method to see if the engine see that SourceComponent is a UISLevelStats. The result of that method call was true, SourceComponent is a UISLevelStats, but I am just having issue downcasting to the UISLevelStats class

I have even tried UISLevelStats* SourceBatchComponent = Cast(SourceComponent); but that does not work

Product Version: UE 4.18
Tags:
more ▼

asked Mar 22 '18 at 04:56 AM in C++ Programming

avatar image

Mike Joye
11 1 3 4

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question