[Closed] Display System Time in SBARINFO

Moderator: GZDoom Developers

Display System Time in SBARINFO

Postby saegiru » Mon Feb 15, 2016 3:02 pm

Hi, after much searching I have yet to find a definitive answer for this - but would it be possible to add system time as an accessible display for DrawNumber or something in SBARINFO? I just find that it would be exceedingly convenient to have system time available to display as it already is on the AltHUD.

If there is a good reason that this can't be allowed, that is fine - but as it is already accessible via the AltHUD I don't see why it wouldn't be?

As for the why, it's mainly for convenience - I would like the capability to have it show on screen as something like "Earth Time: hh:mm:ss" just so that when I'm playing long sessions, I can keep an eye on what time it is. I even went so far as to create a "clock" ACS script that you set using CVARs, and runs "like" a clock, but after you save or load, it goes back to displaying the incorrect time so you would have to reset it if you die and reload, or start a new map, etc.

Maybe add a few new variables to SBARINFO for drawnumber... SysHr, SysMin, SysSec?
Example:

Drawstring SMALLFONT, Green, "Earth time: ", 50, 50;
Drawnumber 2, SMALLFONT, Green, SysHr, 60, 50;
Drawstring SMALLFONT, Green, ":", 60, 52;
Drawnumber 2, SMALLFONT, Green, SysMin, 60, 54;
Drawstring SMALLFONT, Green, ":", 60, 56;
Drawnumber 2, SMALLFONT, Green, SysSec, 60, 58;

Obviously that may or may not be lined up right - but that is the general idea... Again, if a similar function exists and I'm not aware - let me know, and if for some technical reason this can't be allowed - let me know as well

This is the one of the last things I want out of my perfect HUD at this point, and it is driving me crazy that i can't implement it.

Thanks!
User avatar
saegiru
 
Joined: 23 Jun 2014

Re: Display System Time in SBARINFO

Postby saegiru » Mon Feb 15, 2016 7:02 pm

Here is the code for the "clock" I made... just to show you my desperation. Again, it only works if you don't ever die/reload/respawn.

Code: Select allExpand view
#library "systemclock"
#include "zcommon.acs"

int gametime;
int hr;
int min;
int currenthr;
int currenttens;
int currentones;
//int sec;

Script 102 enter
{
While(True)
{
SetHudSize(640,480,0);
gametime = Timer() / 35;

hr = gametime/3600;
min = (gametime/60)%60;

currenthr = GetUserCVAR(PlayerNumber(),"current_hr")+hr;
currentones = GetUserCVAR(PlayerNumber(),"current_ones")+(min%10);
currenttens = GetUserCVAR(PlayerNumber(),"current_tens")+(min/10);

//sec = gametime%60;
If (currentones > 9)
{
currenttens = currenttens + 1;
currentones = 0;
//min = 0;
}
If (currenttens > 5)
{
currenthr = currenthr + 1;
currenttens = 0;
currentones = 0;
//min = 0;
}

hudmessagebold(d:currenthr, s:":", d:currenttens, d:currentones;//, s:":", d:sec/10, d:sec%10;
      HUDMSG_PLAIN, 215, CR_GRAY, 375.2, 270.1, 0);
     Delay(1);
}
}
User avatar
saegiru
 
Joined: 23 Jun 2014

Re: Display System Time in SBARINFO

Postby axredneck » Tue Sep 03, 2019 6:25 pm

Why this feature suggestion is [closed] ?
User avatar
axredneck
excuse me for my bad English
 
Joined: 11 Dec 2017
Location: Russia
Github ID: axredneck
Operating System: Other Linux 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Display System Time in SBARINFO

Postby Graf Zahl » Wed Sep 04, 2019 12:15 am

Because SBARINFO is deprecated and will not be extended anymore.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Display System Time in SBARINFO

Postby axredneck » Wed Sep 04, 2019 7:58 am

So what should i use instead of SBARINFO ?
User avatar
axredneck
excuse me for my bad English
 
Joined: 11 Dec 2017
Location: Russia
Github ID: axredneck
Operating System: Other Linux 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Display System Time in SBARINFO

Postby Graf Zahl » Wed Sep 04, 2019 8:01 am

ZScript, of course.
I don't think you can retrieve the system time, but on the ZScript side it has a chance of getting added. Back in 2017 I blanketly closed all SBARINFO related suggestions regardless on content or merit.
The SBARINFO code is in a state that I won't maintain it any longer beyond keeping it operable.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Display System Time in SBARINFO

Postby axredneck » Wed Sep 04, 2019 8:12 am

GZDoom has it's HUD in SBARINFO so i thought it is right way to make HUD. OK, i'll try to zscript something...
User avatar
axredneck
excuse me for my bad English
 
Joined: 11 Dec 2017
Location: Russia
Github ID: axredneck
Operating System: Other Linux 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Display System Time in SBARINFO

Postby Graf Zahl » Wed Sep 04, 2019 8:23 am

No, GZDoom has its HUD in ZScript. The SBARINFOS are only there for mods that use them as a base for modification.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Display System Time in SBARINFO

Postby axredneck » Wed Sep 04, 2019 10:33 am

Thank you
User avatar
axredneck
excuse me for my bad English
 
Joined: 11 Dec 2017
Location: Russia
Github ID: axredneck
Operating System: Other Linux 64-bit
Graphics Processor: nVidia with Vulkan support


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest