Skip to content

Added the GetModel function (SpawnIcon)#2407

Open
Vitroze wants to merge 1 commit intoFacepunch:masterfrom
Vitroze:alias_spawnicon
Open

Added the GetModel function (SpawnIcon)#2407
Vitroze wants to merge 1 commit intoFacepunch:masterfrom
Vitroze:alias_spawnicon

Conversation

@Vitroze
Copy link
Contributor

@Vitroze Vitroze commented Dec 12, 2025

Hello,
I just added an alias for the GetModelName function.

@robotboy655
Copy link
Collaborator

Why?

@Vitroze
Copy link
Contributor Author

Vitroze commented Dec 12, 2025

Based on the logic of the code, without necessarily looking at the wiki, I thought that GetModel could work on a SpawnIcon (given that the function for changing the model is SetModel). From a logical point of view, I thought it would be better to implement an alias.

After that, it's just for the logic of the code.

@robotboy655 robotboy655 added the Enhancement The pull request enhances current functionality. label Dec 12, 2025
@Astralcircle
Copy link
Contributor

Astralcircle commented Dec 13, 2025

I hate aliases... A striking example is the :Name and :GetName functions, which are aliases of the :Nick function, providing nothing but a little code confusion

@Vitroze
Copy link
Contributor Author

Vitroze commented Dec 13, 2025

Okay, but in terms of code logic, it would be better to implement a GetModel alias because if the developer thinks it works like DModelPanel:GetModel(), they will be mistaken. It's just to follow the logic of the vgui DModelPanel. After that, I agree that adding 40 aliases could be problematic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement The pull request enhances current functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants