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!)

Using a picture as a class name

Postby JossTheFox » Tue May 03, 2022 8:38 pm

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?
JossTheFox
 
Joined: 19 Jun 2021

Re: Using a picture as a class name

Postby m8f » Wed May 04, 2022 9:19 am

Maybe you can color your classes with escape codes: https://zdoom.org/wiki/Print#Colors ?
User avatar
m8f
dreamer
 
 
 
Joined: 29 Dec 2017
Location: Siberia (UTC+7)
Discord: m8f#0629
Github ID: mmaulwurff
Operating System: Other Linux 64-bit

Re: Using a picture as a class name

Postby JossTheFox » Sun May 08, 2022 5:36 am

That doesn't work, text codes don't work in the menus.
JossTheFox
 
Joined: 19 Jun 2021

Re: Using a picture as a class name

Postby m8f » Sun May 08, 2022 6:41 am

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 allExpand view
[enu default]

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


MENUDEF:
Code: Select allExpand view
AddOptionMenu OptionsMenu       { Submenu "$GB_OPTIONS", gb_Options }
User avatar
m8f
dreamer
 
 
 
Joined: 29 Dec 2017
Location: Siberia (UTC+7)
Discord: m8f#0629
Github ID: mmaulwurff
Operating System: Other Linux 64-bit

Re: Using a picture as a class name

Postby JossTheFox » Sun May 08, 2022 6:46 am

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.
JossTheFox
 
Joined: 19 Jun 2021

Re: Using a picture as a class name

Postby m8f » Sun May 08, 2022 7:05 am

Nonetheless, if you define your strings in LANGUAGE (and use them from your ZScript/Decorate player class definitions), will it work?
User avatar
m8f
dreamer
 
 
 
Joined: 29 Dec 2017
Location: Siberia (UTC+7)
Discord: m8f#0629
Github ID: mmaulwurff
Operating System: Other Linux 64-bit

Re: Using a picture as a class name

Postby JossTheFox » Sun May 08, 2022 7:11 am

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
 
Joined: 19 Jun 2021

Re: Using a picture as a class name

Postby JossTheFox » Thu May 12, 2022 12:48 am

I completely forgot to update this, geez.
Defining the name in LANGUAGE with the text code works! Thanks :3
JossTheFox
 
Joined: 19 Jun 2021


Return to Scripting

Who is online

Users browsing this forum: brick and 0 guests