Using a picture as a class name

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
JossTheFox
Posts: 26
Joined: Sat Jun 19, 2021 6:35 am

Using a picture as a class name

Post by JossTheFox »

Hello again!
I'm making a few custom classes for a project I've been working on, and I was wondering if you could set an image to be used in the class selection screen as the class name, similar to what you can do with the main menu options and the level names.
The reason I'm asking this is because I'd like to have the classes be color-coded in a sense. For example, class one would be associated with purple, class two would be red, class three would be green. I'd like to have a rainbow class too, but I don't know if that one is possible. The picture solution was the only one I could think of, but if anyone else has a better solution I'd love to hear it.
So...is what I'm asking even possible?
User avatar
m8f
 
 
Posts: 1445
Joined: Fri Dec 29, 2017 4:15 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Manjaro Linux
Location: Siberia (UTC+7)
Contact:

Re: Using a picture as a class name

Post by m8f »

Maybe you can color your classes with escape codes: https://zdoom.org/wiki/Print#Colors ?
JossTheFox
Posts: 26
Joined: Sat Jun 19, 2021 6:35 am

Re: Using a picture as a class name

Post by JossTheFox »

That doesn't work, text codes don't work in the menus.
User avatar
m8f
 
 
Posts: 1445
Joined: Fri Dec 29, 2017 4:15 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Manjaro Linux
Location: Siberia (UTC+7)
Contact:

Re: Using a picture as a class name

Post by m8f »

Do you specify text strings in MENUDEF itself or in LANGUAGE lump?

When it's in LANGUAGE, it works for me (see icon near Gearbox entry):



LANGUAGE:

Code: Select all

[enu default]

GB_OPTIONS = "\ch⚙\c- Gearbox Options";
MENUDEF:

Code: Select all

AddOptionMenu OptionsMenu       { Submenu "$GB_OPTIONS", gb_Options }
JossTheFox
Posts: 26
Joined: Sat Jun 19, 2021 6:35 am

Re: Using a picture as a class name

Post by JossTheFox »

Oh, we're talking about completely different menus.
I'm talking about the class selection screen, the one that appears when you start a new game with more than one player class.
User avatar
m8f
 
 
Posts: 1445
Joined: Fri Dec 29, 2017 4:15 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Manjaro Linux
Location: Siberia (UTC+7)
Contact:

Re: Using a picture as a class name

Post by m8f »

Nonetheless, if you define your strings in LANGUAGE (and use them from your ZScript/Decorate player class definitions), will it work?
JossTheFox
Posts: 26
Joined: Sat Jun 19, 2021 6:35 am

Re: Using a picture as a class name

Post by JossTheFox »

Ohh my God I am a huge idiot.
The name isn't defined in LANGUAGE, I currently just put it in the decorate lump itself. I'll change that the next time I get the chance to and see if it works. (I'd do it right now, but I have to share a computer with my brother rn)
JossTheFox
Posts: 26
Joined: Sat Jun 19, 2021 6:35 am

Re: Using a picture as a class name

Post by JossTheFox »

I completely forgot to update this, geez.
Defining the name in LANGUAGE with the text code works! Thanks :3
Post Reply

Return to “Scripting”