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

Doom: shift widgets one line down so chat typing line may appear #949

Merged
merged 5 commits into from
Oct 7, 2022

Conversation

JNechaevsky
Copy link
Collaborator

Just as I have promised. This should allow chat line properly appear. Comparative screenshots: before and after.

However, I'm starting to forget how original HUD system is working after rewriting it on ID, so... Have I missed something? Any thoughts or corrections? And maybe we don't need it while demo playing since no chat string are recording in demos?

Notes: chat string may be long at take full width of the screen. Also, better variable naming.
@JNechaevsky JNechaevsky marked this pull request as ready for review September 11, 2022 18:22
@@ -590,6 +590,8 @@ void HU_Start(void)
const char *s;
// [crispy] string buffers for map title and WAD file name
char buf[8], *ptr;
// [crispy] shift widgets one line down so chat typing line may appear
const int net_chatline = netgame ? 8 : 0;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be a bit more dynamic? For example, AV.wad plays a netgame demo even if you are going to play a singleplayer game. Could it get modified so that the widgets only slip down if there is an actual chat visible and shift back to their original positions else?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I can abuse HU_Ticker with it's netgame condition, which will recalculate widgets position every calculated tic. To prevent duplication of HUlib_initTextLine(&w_kills, ... and others, I have to move them to static, separated function. Quick example how it will looks: https://youtu.be/3H2x0rUocXU

No commit for now, polishing and experementing is still needed.

@JNechaevsky
Copy link
Collaborator Author

@fabiangreffrath have a look, please. Calling HU_InitWidgets should be safe for performance, since it is called only when really necessary. Are the function name and variables okay? w_kills.y is next step.

@fabiangreffrath
Copy link
Owner

Hm, sorry, but I'd consider that a bit over-engineered. I'd prefer if only the widgets' y-coordinates would get adjusted in the ticker function, according to the current scenario. Please have a look at how @rfomin has done it for Woof (which has a lot more widgets, btw):

fabiangreffrath/woof@d3084bf

@JNechaevsky
Copy link
Collaborator Author

Jesus Christ, that dang original HUD system... 🤯

@JNechaevsky
Copy link
Collaborator Author

@fabiangreffrath, your turn, please. ♟️
Still not sure how to handle w_kills.y = HU_TITLEY; and w_kills.y = HU_MSGY + 1 * 8; better way, they not supposed to be shifted with "Status bar" type.

@JNechaevsky JNechaevsky marked this pull request as draft September 13, 2022 06:47
@@ -1073,6 +1085,7 @@ void HU_Ticker(void)
{
crispy_statsline_func_t crispy_statsline = crispy_statslines[crispy->statsformat];

if (crispy->automapstats == WIDGETS_STBAR)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this check redundant at this place?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant indeed, fixed in commit below.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess it's all done now, except some unclear positioning between tabs and spaces.
@fabiangreffrath are there any further recommendations?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I'll still have to play-test the changes, but haven't found time for it yet, because I am currently involved in other projects.

- Add back removed line break.
- No shifting of time widget is needed if no stats widget is used.
- Remove redundant automapstats check.
@JNechaevsky JNechaevsky marked this pull request as ready for review September 17, 2022 09:11
Copy link
Owner

@fabiangreffrath fabiangreffrath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did some cursory testing, seems to work as intended. Thanks!

@fabiangreffrath fabiangreffrath merged commit 35dc15e into master Oct 7, 2022
@fabiangreffrath fabiangreffrath deleted the hu_chatline branch October 7, 2022 19:17
@fabiangreffrath
Copy link
Owner

Sorry, forgot about this one.

@JNechaevsky
Copy link
Collaborator Author

No problem, thanks for accepting. I can't proceed with anything and stopped all coding activity - simply can't focus on something gaming-related now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants