Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[469b] Make settings to adjust the chat transparency and/or size #640

Closed
Engineer9736 opened this issue Dec 12, 2021 · 8 comments
Closed
Labels
enhancement Feature request internal-fam UnrealScript This is an issue in the UnrealScript code
Milestone

Comments

@Engineer9736
Copy link

Engineer9736 commented Dec 12, 2021

Sometimes maps are so bright that the chat is hard to read. It would be helpful if there was an option in the menu to adjust the transparency of the chat. I tried all the transparency sliders but none affect the chat area. An option to adjust the chat area font size could be helpful as well.

I want to keep all the other GUI elements the size and transparency level as they are, so a combined setting for everything is not preferable.

ut99-chat-badly-readable

The GUI drawing functions for this are in Botpack.ChallangeHUD in the function DrawSpeechArea.

The is this line: Canvas.Style = ERenderStyle.STY_Translucent;

I guess some line has to be added after it which sets the specific transparency.

@stijn-volckaert stijn-volckaert changed the title Make settings to adjust the chat transparency and/or size [469b] Make settings to adjust the chat transparency and/or size Dec 28, 2021
@stijn-volckaert
Copy link
Contributor

The HUD transparency slider also sets the transparency of the chat area. Somewhat confusingly, however, you have to slide it all the way to the right to make the chat area opaque.

@stijn-volckaert stijn-volckaert added the UnrealScript This is an issue in the UnrealScript code label Dec 28, 2021
@Engineer9736
Copy link
Author

I have the slider all the way to the right, but it's still transparent. Maybe some other setting needs to be on a specific position as well to make it opaque?

Untitled

@SeriousBuggie
Copy link
Collaborator

Possible bug of old nexgen. it is always draw chat area translucent.
Class NexgenHUD, function renderMessageBox:

	c.style = ERenderStyle.STY_Translucent;

But must be (Nexgen112N):

	c.style = ERenderStyle.STY_Translucent;
	if ( (ChallengeHUD(player.myHUD).Opacity == 16) || !Level.bHighDetailMode )
		C.Style = ERenderStyle.STY_Normal;

Check nexgen version used on this server.

@SeriousBuggie
Copy link
Collaborator

Can not be solved in easy way. need modify textures.
Textures for render chat area:
img
ERenderStyle.STY_Masked or ERenderStyle.STY_Normal produce black area:
img
img
So need remake textures for black be first color in pallete (transparent for Masked output. But even with that it can be look dirty, since border be sharp on corners.

@SeriousBuggie
Copy link
Collaborator

SeriousBuggie commented Jun 20, 2022

Nexgen use different approach and draw chat area from many calls and small texture:
img

	// Borders.
	c.drawColor = baseHUDColor * 0.8;
	c.setPos(0.0, 0.0);
	c.drawTile(Texture'base', msgBoxWidth, 1.0, 0.0, 0.0, 1.0, 1.0);
	c.setPos(0.0, msgBoxHeight - 1.0);
	c.drawTile(Texture'base', msgBoxWidth, 1.0, 0.0, 0.0, 1.0, 1.0);
	c.setPos(msgBoxWidth - 1.0 - panelWidth, panelHeight + 1.0);
	c.drawTile(Texture'base', panelWidth, 1.0, 0.0, 0.0, 1.0, 1.0);
	c.setPos(0.0, 1.0);
	c.drawTile(Texture'base', 1.0, msgBoxHeight - 2.0, 0.0, 0.0, 1.0, 1.0);
	c.setPos(msgBoxWidth - 1.0, 1.0);
	c.drawTile(Texture'base', 1.0, msgBoxHeight - 2.0, 0.0, 0.0, 1.0, 1.0);
	c.setPos(msgBoxHeight - 1.0, 1.0);
	c.drawTile(Texture'base', 1.0, msgBoxHeight - 2.0, 0.0, 0.0, 1.0, 1.0);
	c.setPos(msgBoxWidth - 2.0 - panelWidth, 1.0);
	c.drawTile(Texture'base', 1.0, msgBoxHeight - 2.0, 0.0, 0.0, 1.0, 1.0);
	
	// Panels.
	renderPanel(serverState, c, panelHeight, msgBoxWidth - panelWidth - 1.0, 1.0);
	renderPanel(clientState, c, panelHeight, msgBoxWidth - panelWidth - 1.0, panelHeight + 2.0);
/***************************************************************************************************
 *
 *  $DESCRIPTION  Renders a panel with the specified contents at the given location.
 *  $PARAM        pInf         Panel contents.
 *  $PARAM        c            Canvas object that provides the drawing capabilities.
 *  $PARAM        panelHeight  Vertical space available for the panel (in pixels).
 *  $PARAM        x            Horizontal offset.
 *  $PARAM        y            Vertical offset.
 *  $REQUIRE      pInf != none && c != none && panelHeight > 0
 *
 **************************************************************************************************/
simulated function renderPanel(PanelInfo pInf, canvas c, float panelHeight, float x, float y) {
	local float separatorWidth;
	local float cx;
	local float cy;
	local float iconHeight;
	local float lifeTime;
	local float blinkFactor;
	local float blinkIntensity;
	
	if (pInf.bBlink) {
		blinkFactor = (1.0 + cos(timeSeconds * 2 * pi * panelBlinkRate)) / 2.0;
		blinkIntensity = (1.0 - blinkFactor) * 255.0;
	}
			
	separatorWidth = int(baseFontHeight * 0.4);
	
	// Draw icon.
	cx = x + separatorWidth;
	if (pInf.icon != none) {
		if (iconSize > panelHeight) {
			iconHeight = panelHeight;
			cy = y;
		} else {
			iconHeight = iconSize;
			cy = y + int((panelHeight - iconSize) / 2.0);
		}
		
		c.style = ERenderStyle.STY_Translucent;
		
		if ( (ChallengeHUD(player.myHUD).Opacity == 16) || !Level.bHighDetailMode )
		   C.Style = ERenderStyle.STY_Normal;




		c.drawColor = blankColor;
		c.setPos(cx, cy);
		c.drawTile(pInf.icon, iconHeight, iconHeight, 0.0, 0.0, iconSize, iconSize);
		if (pInf.solidIcon != none) {
			c.style = ERenderStyle.STY_Normal;
			c.setPos(cx, cy);
			c.drawTile(pInf.solidIcon, iconHeight, iconHeight, 0.0, 0.0, iconSize, iconSize);
		}
		
		cx += separatorWidth + iconHeight;
	}
	
	// Draw the text.
	cy = y + (panelHeight - baseFontHeight) / 2.0;
	c.style = ERenderStyle.STY_Normal;
	c.drawColor = pInf.textCol;
	if (pInf.bBlink) {
		c.drawColor = c.drawColor * blinkColorDamp;
		c.drawColor.r = int(float(c.drawColor.r) * blinkFactor + blinkIntensity);
		c.drawColor.g = int(float(c.drawColor.g) * blinkFactor + blinkIntensity);
		c.drawColor.b = int(float(c.drawColor.b) * blinkFactor + blinkIntensity);
	}
	c.setPos(cx, cy);
	c.font = baseFont;
	c.drawText(pInf.text, false);
}

@SeriousBuggie
Copy link
Collaborator

As solution we can goes nexgen way and build chat area from thousand pieces. And rule by turn on/off transparency for it.
Not sure if this work with set level of transparency.

As second approach - introduce another set of textures, make it same as of original, but use as masked.

Third approach - edit existing textures, make them black color masked and try out as masked texture.

@SeriousBuggie
Copy link
Collaborator

Third way without touch textures and masked output - draw solid black background before draw this crappy transparent textures.
Look as possible PR.

@SeriousBuggie
Copy link
Collaborator

SeriousBuggie commented Jul 18, 2022

There too many things in one issue. For each thing need make own issue.
For example not solid chat area, when HUD solid is one problem.
Chat font size independent scale is another. Possible together with scale chat area, since it must hold desired count of chat lines.

Currently I linked here pull request which close this issue on accept it. In this PR solved problem with chat area transparency.
If entire hud is solid, then chat area too solid. No separate opacity slider, or all together.

If this not what you want feel free make few new issues, one per problem.

@stijn-volckaert stijn-volckaert added the enhancement Feature request label Jul 28, 2022
@stijn-volckaert stijn-volckaert added this to the 469e milestone Dec 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request internal-fam UnrealScript This is an issue in the UnrealScript code
Projects
None yet
Development

No branches or pull requests

3 participants