Skip to content

Conversation

@nullsystem
Copy link
Collaborator

@nullsystem nullsystem commented Oct 30, 2024

Description

  • Added in sv_neo_spraydisable so server-side can disable it (also enabled if competitve mode enabled)

TODO:

  • Try out exporting DXT5 instead of DXT1. Seems DXT5 works for spray and can deal with transparency well
  • Change importer behavior from always the same spray.vtf to also applying by filename's basename + .vtf/.vmt
  • Spray now put into the NeoUI settings menu
    • Import button to import sprays
    • Gallery button to pick a spray from current already available set
    • An image on the left to show the current spray
    • Outputs VTF 7.4 DXT1/DXT5 format and 2 VMT files, one for UI and one general
  • Spray fix - fixed for local player's spray not showing up properly
    • The issue affected both default and custom sprays
  • Function to generate VTF 7.4 + DXT1/DXT5 image
    • This is partially because Source SDK's RGBA8888 to DXT conversion was broken, so a "custom" function is done instead
    • It just lays out the VTF headers, the 4 mipmaps from smallest to largest, then DXT1 or DXT5 block per mipmap images
    • It will use DXT5 if there's any transparency/usage of alpha values, otherwise DXT1 will be use if no alpha is needed due to the smaller size
  • NeoUI image/texture support - New Texture and ButtonTexture
    • The texture can be initialized from vmt texture, vtf texture direct, and general images like PNG or JPG
    • Makes sure image aspect ratio and fit is correct within the given bounds
  • NeoUI scrolling fixes
    • Fixed to use y-partition instead of widget indexes
    • Scrollbar is now determined by X-margin
  • New libraries usages:
    • All from: https://github.com/nothings/stb
    • stb_image.h for image reading (PNG, JPG) (used for both spray importer and NeoUI image support)
    • stb_image_resize2.h for image resizing (used for spray importer)
    • stb_dxt.h for outputting DXT1 blocks (used for spray importer)

Toolchain

  • Linux GCC Distro Native Arch/GCC 14

Linked Issues

Screenshot

2025-02-17T213909_screen

@nullsystem nullsystem changed the title Sprays Importer/Gallery + fixed empty spray + NeoUI Texture/Image button + stb libraries [WIP] Sprays Importer/Gallery + fixed empty spray + NeoUI Texture/Image button + stb libraries Oct 30, 2024
@nullsystem nullsystem marked this pull request as ready for review December 14, 2024 18:40
@nullsystem nullsystem changed the title [WIP] Sprays Importer/Gallery + fixed empty spray + NeoUI Texture/Image button + stb libraries Sprays Importer/Gallery + fixed empty spray + NeoUI Texture/Image button + stb libraries Dec 14, 2024
@nullsystem nullsystem requested a review from a team December 14, 2024 18:41
Copy link
Contributor

@brysondev brysondev left a comment

Choose a reason for hiding this comment

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

LGTM

@brysondev brysondev requested a review from a team December 22, 2024 14:30
@AdamTadeusz

This comment was marked as resolved.

@Masterkatze
Copy link
Contributor

what have we decided in terms of including the new library, does it pose a security threat?

I don't think so, since it's used only on client side.

@Masterkatze
Copy link
Contributor

  1. Missing texture at the first start:
    1_missing_texture

  2. I think the settings menu could be improved - move the controls/values to the right column:
    2_settings

@brysondev brysondev self-requested a review January 19, 2025 21:31
AdamTadeusz
AdamTadeusz previously approved these changes Jan 24, 2025
@AdamTadeusz
Copy link
Contributor

@nullsystem also conflicts

@brysondev
Copy link
Contributor

Waiting on nits before approving

@AdamTadeusz
Copy link
Contributor

Waiting on nits before approving

you've already approved this

brysondev
brysondev previously approved these changes Feb 5, 2025
Copy link
Contributor

@brysondev brysondev left a comment

Choose a reason for hiding this comment

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

Nuh uh

@nullsystem nullsystem marked this pull request as draft February 18, 2025 20:31
@AdamTadeusz AdamTadeusz added the Conflict conflicts with master label Feb 24, 2025
@nullsystem nullsystem requested a review from brysondev March 9, 2025 22:40
@nullsystem nullsystem marked this pull request as ready for review March 9, 2025 22:40
brysondev
brysondev previously approved these changes Mar 9, 2025
Copy link
Contributor

@brysondev brysondev left a comment

Choose a reason for hiding this comment

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

Oh so we are merging this

@nullsystem
Copy link
Collaborator Author

nullsystem commented Mar 9, 2025

Added in sv_neo_spraydisable so server-side can disable it (also enabled if competitve mode enabled)

@nullsystem nullsystem changed the title Sprays Importer/Gallery + fixed empty spray + NeoUI Texture/Image button + stb libraries Sprays Importer/Gallery + fixed empty spray + NeoUI Texture/Image button + stb libraries + server-side disable spray Mar 9, 2025
@nullsystem nullsystem requested a review from brysondev March 9, 2025 22:53
brysondev
brysondev previously approved these changes Mar 9, 2025
Copy link
Contributor

@brysondev brysondev left a comment

Choose a reason for hiding this comment

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

@Agiel have we decided on what we want to use?

brysondev
brysondev previously approved these changes Mar 9, 2025
brysondev
brysondev previously approved these changes Mar 10, 2025
@brysondev brysondev requested a review from a team March 10, 2025 00:47
Copy link
Contributor

@Masterkatze Masterkatze left a comment

Choose a reason for hiding this comment

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

LGTM

@nullsystem nullsystem merged commit 1d2dc70 into NeotokyoRebuild:master Mar 10, 2025
5 checks passed
@nullsystem nullsystem deleted the GH-602_Sprays3 branch May 7, 2025 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Conflict conflicts with master

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Root NeoUI - Sprays

4 participants