Skip to content

Conversation

Nico8340
Copy link
Member

Additions

  • Adds a default parameter to the getResourceName function, which is based on the current resource
  • Adds a global variable named resourceName, which is based on the current resource

Antecedent

This is a continuation of the previous pull request (#3363) which fixed the previously mentioned map editor issues.
Thus this pull request closes #3527

Example

addEventHandler("onResourceStart", resourceRoot,
    function()
        local myResourceName = resourceName or getResourceName()
        local myResourceMessage = string.format("Resource successfully started: %s", myResourceName)

        outputServerLog(myResourceMessage)
    end
)

@Dutchman101
Copy link
Member

Both you and Tracer submitted a fixed PR at the exact same time (lol)

Code reviews and (self-)feedback should determine which of the 2 PR's is ideal, and to save us time, also please add details on what the problem was and how you fixed it; there's no specific "fix" commit.

Tracer's PR: #3530
Nico's PR: #3531

@Nico8340
Copy link
Member Author

Nico8340 commented Jun 30, 2024

This pull request contains the option to omit the parameter of the getResourceName function, which was the intended functionality of the reverted pull request, so this pull request restores it with the correction.
The problem was with the !resource->IsActive() check, after removing this the mentioned issue no longer occurs.

cc @Dutchman101

@Nico8340
Copy link
Member Author

The other pull request was closed by Tracer's own decision, so this is the only one left.

@tederis tederis added the enhancement New feature or request label Jul 1, 2024
Copy link
Contributor

@TracerDS TracerDS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Nico8340 Nico8340 requested a review from TracerDS July 1, 2024 10:56
@Nico8340 Nico8340 requested review from Lpsd, TracerDS and FileEX July 6, 2024 19:18
@Nico8340 Nico8340 requested a review from TracerDS July 10, 2024 00:45
Copy link
Contributor

@TracerDS TracerDS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Dutchman101 Dutchman101 merged commit 49fb6c6 into multitheftauto:master Jul 15, 2024
MTABot pushed a commit that referenced this pull request Jul 15, 2024
49fb6c6 GetResourceName default parameter and Global variable (#3531)
@Nico8340 Nico8340 deleted the resourcename branch July 15, 2024 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Map Editor bugs out
6 participants