Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement ImGui Notifications #995

Merged
merged 4 commits into from
Jan 25, 2025

Conversation

dragonzkiller
Copy link
Contributor

Adds notifications to CET's ImGui with sol bindings (ShowToast only) and shows keybind notifications on game startup 🎉 .

All ImGuiToast methods are exposed (e.g. SetTitle, SetContent, etc.)

This must be performed within an ImGui context!

if ImGui.Begin("Toast Example") then
    if ImGui.Button("Show Toast", 120, 0) then
        toast = ImGuiToast.new(ImGuiToastType.Info, "Hello world!")
        ImGuiNotify.ShowToast(toast)
    end
end

@dragonzkiller
Copy link
Contributor Author

dragonzkiller commented Jan 20, 2025

Addressed all the comments, but made some different name changes. Keeping it under ImGui like we do for Texture makes ImGui.ImWHATEVER seem redundant to me. So now it would be done with

if ImGui.Begin('Environment Editor') then

    if ImGui.Button("Show Toast", 120, 0) then
        toast = ImGui.ToastNotification.new(ImGui.ToastNotificationType.Info, "Hello world!")
        ImGui.ShowToast(toast)
    end
end

Names seem a bit long, so willing to take final suggestions before the merge.

@WSSDude
Copy link
Collaborator

WSSDude commented Jan 20, 2025

Yeah that should be fine, I believe I also said to you to not bind everything before.

@WSSDude
Copy link
Collaborator

WSSDude commented Jan 20, 2025

Names seem a bit long, so willing to take final suggestions before the merge.

May just call it Toast I suppose.

@dragonzkiller
Copy link
Contributor Author

Yeah that should be fine, I believe I also said to you to not bind everything before.

What do you mean by this? I'm only binding the types and the show function

@WSSDude
Copy link
Collaborator

WSSDude commented Jan 21, 2025

What do you mean by this? I'm only binding the types and the show function

Oh I accidentaly replied here instead of thread...

#995 (comment)

Makes sense when you connect it to the thread I hope 😁

@WSSDude WSSDude merged commit 72ed761 into maximegmd:master Jan 25, 2025
1 check passed
@dragonzkiller dragonzkiller deleted the feature/notifications branch January 26, 2025 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants