ColorThemeHUD & ColorThemeMenu

A refuge for those migrating from the fallen DXEditing.com and a place for general discussion relating to Deus Ex editing (coding, mapping, etc).
Post Reply
User avatar
Eye.sys
Thug
Posts: 10
Joined: Sat Jun 01, 2013 12:23 pm
Location: Italy
Contact:

ColorThemeHUD & ColorThemeMenu

Post by Eye.sys »

Hello Forum,

I'm seeking advice among you because I'd like to script some new Color Themes (both for Menu and HUD), and unfortunately I'm still very n00b with the DXEditing package.
The only things I have been able to do so far were opening WOTgreal Exporter and have a look around a bit; as I was expecting I found some classes in TNMGUI.u, they are named like ColorThemeMenu_<name> and ColorThemeHUD_<name> and scripted like this:

(e.g.)

Code: Select all

//=============================================================================
// ColorThemeMenu_Default
//=============================================================================

class ColorThemeMenu_DeusExDefault extends ColorThemeMenu;

/*
   Colors!

	colors(0)  = MenuColor_Background
	colors(1)  = MenuColor_TitleBackground
	colors(2)  = MenuColor_TitleText
	colors(3)  = MenuColor_ButtonFace
	colors(4)  = MenuColor_ButtonTextNormal
	colors(5)  = MenuColor_ButtonTextFocus
	colors(6)  = MenuColor_ButtonTextDisabled
	colors(7)  = MenuColor_HeaderText
	colors(8)  = MenuColor_NormalText
	colors(9)  = MenuColor_ListText
	colors(10) = MenuColor_ListHighlight
	colors(11) = MenuColor_ListFocus

*/

// ----------------------------------------------------------------------
// ----------------------------------------------------------------------

defaultproperties
{
    themeName="DX Default"
    bSystemTheme=True
    Colors(0)=(R=200,G=200,B=200,A=0),
    Colors(1)=(R=100,G=100,B=255,A=0),
    Colors(2)=(R=250,G=250,B=250,A=0),
    Colors(3)=(R=255,G=255,B=255,A=0),
    Colors(4)=(R=200,G=200,B=200,A=0),
    Colors(5)=(R=255,G=255,B=255,A=0),
    Colors(6)=(R=100,G=100,B=100,A=0),
    Colors(7)=(R=175,G=175,B=175,A=0),
    Colors(8)=(R=175,G=175,B=175,A=0),
    Colors(9)=(R=255,G=255,B=255,A=0),
    Colors(10)=(R=100,G=100,B=100,A=0),
    Colors(11)=(R=150,G=150,B=150,A=0),
    Colors(12)=(R=255,G=255,B=255,A=0),
}
I'm sure there are similar classes in one or more of the vanilla .u for the different color schemes that come with the game, but I was unable to find them. I guess that there's no difference anyway.

Now, having absolutely no clue on what to do next, my guess would be to export a sample in .uc, change it\script new files starting from that, then re-compile a .u (in a way I don't know) and have the game read it (in another way I don't know).

Would someone magnanimously know how to direct me?


P.S. I want to apologize in the case this topic has already been discussed maybe eras ago, but I seem to be n00b with the search function as well, and I was unable to find it.
Image
Cybernetic pig
Illuminati
Posts: 2284
Joined: Thu Mar 08, 2012 3:21 am

Re: ColorThemeHUD & ColorThemeMenu

Post by Cybernetic pig »

Eye.sys wrote:TNMGUI.u, .
I think you should ignore that, unless you are trying to mod The Nameless Mod.

What you need to do is export vanilla DeusEx.u Scripts. Best way is via the Unreal Editor master browser.

Once you have done that there are four classes you want to edit:

ColorTheme.uc
ColorThemeHUD.uc
ColorThemeMenu.uc
ColorThemeManager.uc

You will also need to make your own new class/.uc for each new theme you add.

I don't know what to do from here, but since all the code in those files acts as an example and if you know unreal script you should be able to figure it out.
User avatar
Eye.sys
Thug
Posts: 10
Joined: Sat Jun 01, 2013 12:23 pm
Location: Italy
Contact:

Re: ColorThemeHUD & ColorThemeMenu

Post by Eye.sys »

Ok, I got what you are suggesting. Of course, I know that TNMGUI.u refers to TNM but it was only an example.
In addition, I was also hoping to make a separate .u and have the game load it along with all the vanilla files, without having to edit those files although.

Anyway I can make myself some backup files and try going on with what you suggest if lacking a better solution. Tomorrow I'm going to try exporting the classes you mentioned from DeusEx.u
Image
User avatar
bjorn98009_91
Silhouette
Posts: 688
Joined: Thu May 08, 2008 8:17 am
Location: Hufvudstaden, Sweden
Contact:

Re: ColorThemeHUD & ColorThemeMenu

Post by bjorn98009_91 »

Oh man, I fucking love your signature! Data <3
Producer and Quality Assurance Manager for Deus Ex: Revision.
User avatar
Eye.sys
Thug
Posts: 10
Joined: Sat Jun 01, 2013 12:23 pm
Location: Italy
Contact:

Re: ColorThemeHUD & ColorThemeMenu

Post by Eye.sys »

Ok, as suggested I had a look into DeusEx.u and found the classes for the different color themes in the game.
I also found something very interesting which I can't seem to recall having in the game though.

Code: Select all

//=============================================================================
// ColorThemeManager 
//=============================================================================
class ColorThemeManager extends Actor;

Enum EColorThemeTypes
{
	CTT_Menu,
	CTT_HUD
};

var travel ColorTheme FirstColorTheme;
var travel ColorTheme CurrentSearchTheme;
var travel EColorThemeTypes CurrentSearchThemeType;

var travel ColorTheme currentHUDTheme;
var travel ColorTheme currentMenuTheme;

// ----------------------------------------------------------------------
// SetCurrentHUDColorTheme()
// ----------------------------------------------------------------------

simulated function SetCurrentHUDColorTheme(ColorTheme newTheme)
{
	if (newTheme != None)
		currentHUDTheme = newTheme;
}

// ----------------------------------------------------------------------
// SetCurrentMenuColorTheme()
// ----------------------------------------------------------------------

simulated function SetCurrentMenuColorTheme(ColorTheme newTheme)
{
	if (newTheme != None)
		currentMenuTheme = newTheme;
}

// ----------------------------------------------------------------------
// NextHUDColorTheme()
// ----------------------------------------------------------------------

simulated function NextHUDColorTheme()
{
	currentHUDTheme = GetNextThemeByType(currentHUDTheme, CTT_HUD);
}

// ----------------------------------------------------------------------
// NextMenuColorTheme()
// ----------------------------------------------------------------------

simulated function NextMenuColorTheme()
{
	currentMenuTheme = GetNextThemeByType(currentMenuTheme, CTT_Menu);
}

// ----------------------------------------------------------------------
// GetCurrentHUDColorTheme()
// ----------------------------------------------------------------------

simulated function ColorTheme GetCurrentHUDColorTheme()
{
	return currentHUDTheme;
}

// ----------------------------------------------------------------------
// GetCurrentMenuColorTheme()
// ----------------------------------------------------------------------

simulated function ColorTheme GetCurrentMenuColorTheme()
{
	return currentMenuTheme;
}

// ----------------------------------------------------------------------
// DeleteColorTheme()
// ----------------------------------------------------------------------

simulated function bool DeleteColorTheme(String themeName)
{
	local ColorTheme deleteTheme;
	local ColorTheme prevTheme;
	local Bool bDeleted;
	
	bDeleted    = False;
	prevTheme   = None;
	deleteTheme = FirstColorTheme;
	
	while(deleteTheme != None)
	{
		if ((deleteTheme.GetThemeName() == themeName) && (deleteTheme.IsSystemTheme() != True))
		{
			if (deleteTheme == FirstColorTheme)
				FirstColorTheme = deleteTheme.next;
				
			if (prevTheme != None)
				prevTheme.next = deleteTheme.next;
			
			bDeleted = True;
			break;
		}
		
		prevTheme   = deleteTheme;
		deleteTheme = deleteTheme.next;
	}
}

// ----------------------------------------------------------------------
// CreateTheme()
// ----------------------------------------------------------------------

function ColorTheme CreateTheme(Class<ColorTheme> newThemeClass, String newThemeName)
{
	local ColorTheme newTheme;
	
	newTheme = AddTheme(newThemeClass);

	if (newTheme != None)
		newTheme.SetThemeName(newThemeName);

	return newTheme;
}

// ----------------------------------------------------------------------
// AddTheme()
// ----------------------------------------------------------------------

simulated function ColorTheme AddTheme(Class<ColorTheme> newThemeClass)
{
	local ColorTheme newTheme;
	local ColorTheme theme;

	if (newThemeClass == None)
		return None;
		
	// Spawn the class
	newTheme = Spawn(newThemeClass, Self);

	if (FirstColorTheme == None)
	{
		FirstColorTheme = newTheme;
	}
	else
	{
		theme = FirstColorTheme;

		// Add at end for now
		while(theme.next != None) 
			theme = theme.next;
		
		theme.next = newTheme;
	}

	return newTheme;
}

// ----------------------------------------------------------------------
// GetFirstTheme()
//
// Intended to be called from external classes since we can't freakin' 
// pass in the EColorThemeTypes.  God I hate that.
// ----------------------------------------------------------------------

simulated function ColorTheme GetFirstTheme(int intThemeType)
{
	local EColorThemeTypes themeType;

	if (intThemeType == 0)
		themeType = CTT_Menu;
	else
		themeType = CTT_HUD;
	
	CurrentSearchThemeType = themeType;
	CurrentSearchTheme     = GetNextThemeByType(None, CurrentSearchThemeType);

	return CurrentSearchTheme;
}

// ----------------------------------------------------------------------
// GetNextTheme()
// ----------------------------------------------------------------------

simulated function ColorTheme GetNextTheme()
{
	if (CurrentSearchTheme != None)
		CurrentSearchTheme = GetNextThemeByType(CurrentSearchTheme, CurrentSearchThemeType);

	return CurrentSearchTheme;
}

// ----------------------------------------------------------------------
// GetNextThemeByType()
// ----------------------------------------------------------------------

simulated function ColorTheme GetNextThemeByType(ColorTheme theme, EColorThemeTypes themeType)
{
	if (theme == None)
		theme = FirstColorTheme;
	else
		theme = theme.next;

	while(theme != None)
	{
		if (theme.themeType == themeType)
			break;
			
		theme = theme.next;
	}

	return theme;
}

// ----------------------------------------------------------------------
// FindTheme()
// ----------------------------------------------------------------------

simulated function ColorTheme FindTheme(String themeName)
{
	local ColorTheme theme;

	theme = FirstColorTheme;

	while(theme != None)
	{
		if (theme.GetThemeName() == themeName)
			break;
	}

	return theme;
}

// ----------------------------------------------------------------------
// SetHUDThemeByName()
// ----------------------------------------------------------------------

simulated function ColorTheme SetHUDThemeByName(String themeName)
{
	local ColorTheme theme;
	local ColorTheme firstHUDTheme;

	theme = FirstColorTheme;

	while(theme != None)
	{
		if (theme.themeType == CTT_HUD)
			firstHUDTheme = theme;

		if ((theme.GetThemeName() == themeName) && (theme.themeType == CTT_HUD))
		{
			currentHUDTheme = theme;			
			break;
		}

		theme = theme.next;
	}

	if (currentHUDTheme != None)
		return currentHUDTheme;
	else
		return firstHUDTheme;
}

// ----------------------------------------------------------------------
// SetMenuThemeByName()
// ----------------------------------------------------------------------

simulated function ColorTheme SetMenuThemeByName(String themeName)
{
	local ColorTheme theme;
	local ColorTheme firstMenuTheme;

	theme = FirstColorTheme;

	while(theme != None)
	{
		if (theme.themeType == CTT_Menu)
			firstMenuTheme = theme;

		if ((theme.GetThemeName() == themeName) && (theme.themeType == CTT_Menu))
		{
			currentMenuTheme = theme;			
			break;
		}

		theme = theme.next;
	}

	if (currentMenuTheme != None)
		return currentMenuTheme;
	else
		return firstMenuTheme;
}

// ----------------------------------------------------------------------
// ----------------------------------------------------------------------

defaultproperties
{
    bHidden=True
    bTravel=True
}
What's that? Looks like some kind of editor from my very newbie point of view.


bjorn98009_91 wrote:Oh man, I fucking love your signature! Data <3
LOL thanks dude! I appreciate the comment.
By the way just so that you know I fucking love Revision! I'm playing just these days and imho it's awesome, really.
Image
G-Flex
Silhouette
Posts: 621
Joined: Mon Jul 11, 2011 10:16 pm

Re: ColorThemeHUD & ColorThemeMenu

Post by G-Flex »

ColorThemeManager isn't an "editor"; an instance of the class belongs to the player and is responsible for, well, managing the color themes.
User avatar
bjorn98009_91
Silhouette
Posts: 688
Joined: Thu May 08, 2008 8:17 am
Location: Hufvudstaden, Sweden
Contact:

Re: ColorThemeHUD & ColorThemeMenu

Post by bjorn98009_91 »

Then I trust you will be happy with the update that's coming soon. Still no ETA, but bug testing is done and it's basically just a thing of fixing the last few remaining bugs and wrapping up the installer so it works the way I want it to.
Producer and Quality Assurance Manager for Deus Ex: Revision.
User avatar
Eye.sys
Thug
Posts: 10
Joined: Sat Jun 01, 2013 12:23 pm
Location: Italy
Contact:

Re: ColorThemeHUD & ColorThemeMenu

Post by Eye.sys »

bjorn98009_91 wrote:Then I trust you will be happy with the update that's coming soon. Still no ETA, but bug testing is done and it's basically just a thing of fixing the last few remaining bugs and wrapping up the installer so it works the way I want it to.
:D


G-Flex wrote:ColorThemeManager isn't an "editor"; an instance of the class belongs to the player and is responsible for, well, managing the color themes.
I didn't understand if it is something I can use, or it's actually the Setting tab in the game through which you select the color theme. Because if that's the case, I don't remember to have seen something that corresponds, for instance, to CreateTheme(), AddTheme(), DeleteColorTheme() etc.
Image
User avatar
Eye.sys
Thug
Posts: 10
Joined: Sat Jun 01, 2013 12:23 pm
Location: Italy
Contact:

Re: ColorThemeHUD & ColorThemeMenu

Post by Eye.sys »

Eye.sys wrote:
G-Flex wrote:ColorThemeManager isn't an "editor"; an instance of the class belongs to the player and is responsible for, well, managing the color themes.
I didn't understand if it is something I can use, or it's actually the Setting tab in the game through which you select the color theme. Because if that's the case, I don't remember to have seen something that corresponds, for instance, to CreateTheme(), AddTheme(), DeleteColorTheme() etc.
Ok, I kind of understood what's for, it is used by the game to get the list of available themes if I'm correct, along with other things. Not what I need I guess.

I would be curious to understand how the TNM team managed this thing about Color Themes because they seemed to have worked it out like-a-boss D:
Anyway next thing I'm trying is editing a theme and adding a new one using DeusEx.u as a starting point, as soon as I understand how to pack .uc's into .u's of course.
Image
User avatar
Bird
NSF
Posts: 86
Joined: Sat Sep 19, 2009 3:24 pm
Location: between your synaptic gap

Long live necroposting!

Post by Bird »

Use this in-game:

Code: Select all

showrgbdialog 1
Post Reply