-
Member
Memory error cannot be fixed?
I ask that because the timer still disappears or appears negative if I am ahead of time in party, not solo.
-
Contributor
Originally Posted by
cherouvim13
Memory error cannot be fixed?
I ask that because the timer still disappears or appears negative if I am ahead of time in party, not solo.
Only KJ can fix it
-
Member
Originally Posted by
JackCeparou
Ill take a look.
Ps: THANKS, with this i can remove GR from RiftInfoPlugin
Jack please update yours RiftInfoPlugin into 7.6, plugin very good and needed.
-
Member
Does it still work on the May 2018 version? It doesn't seem to appear on the newest version.
-
Contributor
Originally Posted by
2003VB12
Does it still work on the May 2018 version? It doesn't seem to appear on the newest version.
It doesn't work on 18.5.7.0. I think it'is a BUG of TurboHUD, waiting for KJ to fix interface.
-
Contributor
Originally Posted by
2003VB12
Does it still work on the May 2018 version? It doesn't seem to appear on the newest version.
18.5.7.1 has fixed it
-
Member
Its not working for me, since last update
-
Contributor
Originally Posted by
Magu
Its not working for me, since last update
Wait for KJ to fix it
-
Member
Alright, waiting for the boss then thx for quick reply tho
-
Member
You may try to replace the old version one as below:
Code:
using Turbo.Plugins.Default;
using System.Linq;
using System;
using System.Globalization;
namespace Turbo.Plugins.glq
{
public class GLQ_GRProgressionToTime : BasePlugin, IInGameTopPainter, IAfterCollectHandler
{
public IFont BonusTimeFont { get; set; }
public IFont MalusTimeFont { get; set; }
public string SecondsFormat { get; set; }
public string MinutesSecondsFormat { get; set; }
private IFont currentFont;
public bool IsGreaterRift
{
get
{
return riftQuest != null &&
(riftQuest.QuestStepId == 13 || riftQuest.QuestStepId == 16 || riftQuest.QuestStepId == 34 ||
riftQuest.QuestStepId == 46);
}
}
private IQuest riftQuest
{
get
{
return Hud.Game.Quests.FirstOrDefault(q => q.SnoQuest.Sno == 337492) ?? // rift
Hud.Game.Quests.FirstOrDefault(q => q.SnoQuest.Sno == 382695); // gr
}
}
private const uint greaterriftMaxTimeMilliseconds = 900000;
private IWatch pauseTimer; //for solo
public GLQ_GRProgressionToTime()
{
Enabled = true;
}
public override void Load(IController hud)
{
base.Load(hud);
MalusTimeFont = Hud.Render.CreateFont("tahoma", 7, 255, 250, 100, 100, true, false, 160, 0, 0, 0, true);
BonusTimeFont = Hud.Render.CreateFont("tahoma", 7, 255, 128, 255, 0, true, false, 160, 0, 0, 0, true);
MinutesSecondsFormat = "{0:%m}m {0:ss}s";
pauseTimer = Hud.Time.CreateWatch(); //solo
}
//pauseTimer handling for GR-Solos
public void AfterCollect()
{
if (ResetTimers()) return;
if (GamePauseTimers()) return;
RestartStopTimers();
}
private void RestartStopTimers()
{
// (re)start/stop timers if needed
if (pauseTimer.IsRunning)
pauseTimer.Stop();
}
private bool GamePauseTimers()
{
// game pause
if (Hud.Game.IsPaused || (IsGreaterRift && Hud.Game.NumberOfPlayersInGame == 1 && Hud.Game.IsLoading))
{
if (!pauseTimer.IsRunning)
pauseTimer.Start();
return true;
}
return false;
}
private bool ResetTimers()
{
// reset states if needed
if (riftQuest == null || (riftQuest != null && riftQuest.State == QuestState.none))
{
if (pauseTimer.IsRunning || pauseTimer.ElapsedMilliseconds > 0)
{
pauseTimer.Reset();
}
return true;
}
return false;
}
public void PaintTopInGame(ClipState clipState)
{
if (clipState != ClipState.BeforeClip) return;
if (!IsGreaterRift) return;
var ui = Hud.Render.GreaterRiftBarUiElement;
if (ui == null || !ui.Visible) return;
var secondsElapsed = riftQuest.StartedOn.ElapsedMilliseconds;
var percent = (float)Hud.Game.RiftPercentage;
if (secondsElapsed > greaterriftMaxTimeMilliseconds) return;
string text;
var _myTime_ms = percent*9000f - secondsElapsed - pauseTimer.ElapsedMilliseconds;
var _myTime_span = TimeSpan.FromMilliseconds(_myTime_ms);
if (_myTime_ms <= 0)
{
text = "- " + String.Format(CultureInfo.InvariantCulture, MinutesSecondsFormat, _myTime_span);
currentFont = MalusTimeFont;
}
else
{
text = "+ " + String.Format(CultureInfo.InvariantCulture, MinutesSecondsFormat, _myTime_span);
currentFont = BonusTimeFont;
}
var textLayout = currentFont.GetTextLayout(text);
var x = ui.Rectangle.Left + ui.Rectangle.Width / 100.0f * percent - textLayout.Metrics.Width / 2;
var y = ui.Rectangle.Top - ui.Rectangle.Height * 0.1f - textLayout.Metrics.Height;
currentFont.DrawText(textLayout, x, y);
}
}
}
-
Post Thanks / Like - 1 Thanks
Magu (1 members gave Thanks to ibushk for this useful post)
-
Contributor
Originally Posted by
ibushk
You may try to replace the old version one as below:
Code:
using Turbo.Plugins.Default;
using System.Linq;
using System;
using System.Globalization;
namespace Turbo.Plugins.glq
{
public class GLQ_GRProgressionToTime : BasePlugin, IInGameTopPainter, IAfterCollectHandler
{
public IFont BonusTimeFont { get; set; }
public IFont MalusTimeFont { get; set; }
public string SecondsFormat { get; set; }
public string MinutesSecondsFormat { get; set; }
private IFont currentFont;
public bool IsGreaterRift
{
get
{
return riftQuest != null &&
(riftQuest.QuestStepId == 13 || riftQuest.QuestStepId == 16 || riftQuest.QuestStepId == 34 ||
riftQuest.QuestStepId == 46);
}
}
private IQuest riftQuest
{
get
{
return Hud.Game.Quests.FirstOrDefault(q => q.SnoQuest.Sno == 337492) ?? // rift
Hud.Game.Quests.FirstOrDefault(q => q.SnoQuest.Sno == 382695); // gr
}
}
private const uint greaterriftMaxTimeMilliseconds = 900000;
private IWatch pauseTimer; //for solo
public GLQ_GRProgressionToTime()
{
Enabled = true;
}
public override void Load(IController hud)
{
base.Load(hud);
MalusTimeFont = Hud.Render.CreateFont("tahoma", 7, 255, 250, 100, 100, true, false, 160, 0, 0, 0, true);
BonusTimeFont = Hud.Render.CreateFont("tahoma", 7, 255, 128, 255, 0, true, false, 160, 0, 0, 0, true);
MinutesSecondsFormat = "{0:%m}m {0:ss}s";
pauseTimer = Hud.Time.CreateWatch(); //solo
}
//pauseTimer handling for GR-Solos
public void AfterCollect()
{
if (ResetTimers()) return;
if (GamePauseTimers()) return;
RestartStopTimers();
}
private void RestartStopTimers()
{
// (re)start/stop timers if needed
if (pauseTimer.IsRunning)
pauseTimer.Stop();
}
private bool GamePauseTimers()
{
// game pause
if (Hud.Game.IsPaused || (IsGreaterRift && Hud.Game.NumberOfPlayersInGame == 1 && Hud.Game.IsLoading))
{
if (!pauseTimer.IsRunning)
pauseTimer.Start();
return true;
}
return false;
}
private bool ResetTimers()
{
// reset states if needed
if (riftQuest == null || (riftQuest != null && riftQuest.State == QuestState.none))
{
if (pauseTimer.IsRunning || pauseTimer.ElapsedMilliseconds > 0)
{
pauseTimer.Reset();
}
return true;
}
return false;
}
public void PaintTopInGame(ClipState clipState)
{
if (clipState != ClipState.BeforeClip) return;
if (!IsGreaterRift) return;
var ui = Hud.Render.GreaterRiftBarUiElement;
if (ui == null || !ui.Visible) return;
var secondsElapsed = riftQuest.StartedOn.ElapsedMilliseconds;
var percent = (float)Hud.Game.RiftPercentage;
if (secondsElapsed > greaterriftMaxTimeMilliseconds) return;
string text;
var _myTime_ms = percent*9000f - secondsElapsed - pauseTimer.ElapsedMilliseconds;
var _myTime_span = TimeSpan.FromMilliseconds(_myTime_ms);
if (_myTime_ms <= 0)
{
text = "- " + String.Format(CultureInfo.InvariantCulture, MinutesSecondsFormat, _myTime_span);
currentFont = MalusTimeFont;
}
else
{
text = "+ " + String.Format(CultureInfo.InvariantCulture, MinutesSecondsFormat, _myTime_span);
currentFont = BonusTimeFont;
}
var textLayout = currentFont.GetTextLayout(text);
var x = ui.Rectangle.Left + ui.Rectangle.Width / 100.0f * percent - textLayout.Metrics.Width / 2;
var y = ui.Rectangle.Top - ui.Rectangle.Height * 0.1f - textLayout.Metrics.Height;
currentFont.DrawText(textLayout, x, y);
}
}
}
@gjuz ‘s code code is implemented in another way, but it has a problem. It will be inaccurate after death in solo.
As shown in the picture1.jpg
-
Post Thanks / Like - 1 Thanks
ADV2015 (1 members gave Thanks to SeaDragon for this useful post)
-
Member
seems to work so far, thx ibushk !
-
Active Member
Can somebody explain the difference in calculating the time between SeaDragon and gjuz? What are the pros for each Version? Sometimes the version of SeaDragon didn't show something, but then the rift plugin stopped, top. But this only happened in a few rifts.
-
Member
Originally Posted by
ibushk
You may try to replace the old version one as below:
Code:
using Turbo.Plugins.Default;
using System.Linq;
using System;
using System.Globalization;
namespace Turbo.Plugins.glq
{
public class GLQ_GRProgressionToTime : BasePlugin, IInGameTopPainter, IAfterCollectHandler
{
public IFont BonusTimeFont { get; set; }
public IFont MalusTimeFont { get; set; }
public string SecondsFormat { get; set; }
public string MinutesSecondsFormat { get; set; }
private IFont currentFont;
public bool IsGreaterRift
{
get
{
return riftQuest != null &&
(riftQuest.QuestStepId == 13 || riftQuest.QuestStepId == 16 || riftQuest.QuestStepId == 34 ||
riftQuest.QuestStepId == 46);
}
}
private IQuest riftQuest
{
get
{
return Hud.Game.Quests.FirstOrDefault(q => q.SnoQuest.Sno == 337492) ?? // rift
Hud.Game.Quests.FirstOrDefault(q => q.SnoQuest.Sno == 382695); // gr
}
}
private const uint greaterriftMaxTimeMilliseconds = 900000;
private IWatch pauseTimer; //for solo
public GLQ_GRProgressionToTime()
{
Enabled = true;
}
public override void Load(IController hud)
{
base.Load(hud);
MalusTimeFont = Hud.Render.CreateFont("tahoma", 7, 255, 250, 100, 100, true, false, 160, 0, 0, 0, true);
BonusTimeFont = Hud.Render.CreateFont("tahoma", 7, 255, 128, 255, 0, true, false, 160, 0, 0, 0, true);
MinutesSecondsFormat = "{0:%m}m {0:ss}s";
pauseTimer = Hud.Time.CreateWatch(); //solo
}
//pauseTimer handling for GR-Solos
public void AfterCollect()
{
if (ResetTimers()) return;
if (GamePauseTimers()) return;
RestartStopTimers();
}
private void RestartStopTimers()
{
// (re)start/stop timers if needed
if (pauseTimer.IsRunning)
pauseTimer.Stop();
}
private bool GamePauseTimers()
{
// game pause
if (Hud.Game.IsPaused || (IsGreaterRift && Hud.Game.NumberOfPlayersInGame == 1 && Hud.Game.IsLoading))
{
if (!pauseTimer.IsRunning)
pauseTimer.Start();
return true;
}
return false;
}
private bool ResetTimers()
{
// reset states if needed
if (riftQuest == null || (riftQuest != null && riftQuest.State == QuestState.none))
{
if (pauseTimer.IsRunning || pauseTimer.ElapsedMilliseconds > 0)
{
pauseTimer.Reset();
}
return true;
}
return false;
}
public void PaintTopInGame(ClipState clipState)
{
if (clipState != ClipState.BeforeClip) return;
if (!IsGreaterRift) return;
var ui = Hud.Render.GreaterRiftBarUiElement;
if (ui == null || !ui.Visible) return;
var secondsElapsed = riftQuest.StartedOn.ElapsedMilliseconds;
var percent = (float)Hud.Game.RiftPercentage;
if (secondsElapsed > greaterriftMaxTimeMilliseconds) return;
string text;
var _myTime_ms = percent*9000f - secondsElapsed - pauseTimer.ElapsedMilliseconds;
var _myTime_span = TimeSpan.FromMilliseconds(_myTime_ms);
if (_myTime_ms <= 0)
{
text = "- " + String.Format(CultureInfo.InvariantCulture, MinutesSecondsFormat, _myTime_span);
currentFont = MalusTimeFont;
}
else
{
text = "+ " + String.Format(CultureInfo.InvariantCulture, MinutesSecondsFormat, _myTime_span);
currentFont = BonusTimeFont;
}
var textLayout = currentFont.GetTextLayout(text);
var x = ui.Rectangle.Left + ui.Rectangle.Width / 100.0f * percent - textLayout.Metrics.Width / 2;
var y = ui.Rectangle.Top - ui.Rectangle.Height * 0.1f - textLayout.Metrics.Height;
currentFont.DrawText(textLayout, x, y);
}
}
}
I found a bug of this version: when I am in solo GR and put the game on hold by pressing ESC, the game is paused but the plugin time is not paused.
-
Member
Last edited by Bs4237; 11-27-2020 at 09:12 PM.