-
Savvy ? 🐒
Originally Posted by
gjuz
What's so twisted?
Why not 'if (NumberOfAttempts <1 || NumberOfAttempts > 5) return;'?
PHP Code:
private HashSet<int> Attempts = new HashSet<int> { 1, 2, 3, 4, 5 };
...
if (!Attempts.Contains(NumberOfAttempts)) return;
Code duplication :
PHP Code:
if (item.SnoItem.Sno == 3249876973 && jewelRank == 100 || // 3249876973 - Esoteric Alteration
item.SnoItem.Sno == 3249984784 && jewelRank == 100 || // 3249984784 - Mutilation Guard
item.SnoItem.Sno == 3248762926 && jewelRank == 150 || // 3248762926 - Gogok of Swiftness
item.SnoItem.Sno == 3250883209 && jewelRank == 50 || // 3250883209 - Iceblink
item.SnoItem.Sno == 3249805099 && jewelRank == 50) // 3249805099 - Boon of the Hoarder
{
=>
PHP Code:
private bool IsMaxedGem(IItem item, int jewelRank)
{
switch (item.SnoItem.Sno)
{
case 3248762926: // 3248762926 - Gogok of Swiftness
return jewelRank == 150;
case 3249876973: // 3249876973 - Esoteric Alteration
case 3249984784: // 3249984784 - Mutilation Guard
return jewelRank == 100;
case 3250883209: // 3250883209 - Iceblink
case 3249805099: // 3249805099 - Boon of the Hoarder
return jewelRank == 50;
default:
return false;
}
}
Why test GR level and adapt positionning when you can align right instead of left with 'layout.Metrics.Width'?
PHP Code:
if (GRlevel < 100)
{
var layout = GRupgradeChanceFont.GetTextLayout(text);
GRupgradeChanceFont.DrawText(layout, rect.X + 33, rect.Y + 33);
}
else if (GRlevel >= 100)
{
var layout = GRupgradeChanceFont.GetTextLayout(text);
GRupgradeChanceFont.DrawText(layout, rect.X + 27, rect.Y + 33);
}
=>
PHP Code:
var layout = GRupgradeChanceFont.GetTextLayout(text);
GRupgradeChanceFont.DrawText(layout, rect.Right - layout.Metrics.Width, rect.Y + 33);
Just scratching the surface there ;p
-
Contributor
Originally Posted by
JackCeparou
Why not 'if (NumberOfAttempts <1 || NumberOfAttempts > 5) return;'?
PHP Code:
private HashSet<int> Attempts = new HashSet<int> { 1, 2, 3, 4, 5 };
whoa, i had this, and don' t know why i changed it.... phew i must have been very tired
greetz gjuz
-
First Dev On The Internet
Originally Posted by
JackCeparou
Code duplication :
PHP Code:
if (item.SnoItem.Sno == 3249876973 && jewelRank == 100 || // 3249876973 - Esoteric Alteration
item.SnoItem.Sno == 3249984784 && jewelRank == 100 || // 3249984784 - Mutilation Guard
item.SnoItem.Sno == 3248762926 && jewelRank == 150 || // 3248762926 - Gogok of Swiftness
item.SnoItem.Sno == 3250883209 && jewelRank == 50 || // 3250883209 - Iceblink
item.SnoItem.Sno == 3249805099 && jewelRank == 50) // 3249805099 - Boon of the Hoarder
{
=>
PHP Code:
private bool IsMaxedGem(IItem item, int jewelRank)
{
switch (item.SnoItem.Sno)
{
case 3248762926: // 3248762926 - Gogok of Swiftness
return jewelRank == 150;
case 3249876973: // 3249876973 - Esoteric Alteration
case 3249984784: // 3249984784 - Mutilation Guard
return jewelRank == 100;
case 3250883209: // 3250883209 - Iceblink
case 3249805099: // 3249805099 - Boon of the Hoarder
return jewelRank == 50;
default:
return false;
}
}
How to use this ?
edit : I got it, thanks !
Originally Posted by
JackCeparou
Why test GR level and adapt positionning when you can align right instead of left with 'layout.Metrics.Width'?
Just scratching the surface there ;p
Now I know we can do this
Code updated.
Last edited by User5981; 09-13-2017 at 03:36 AM.
-
Contributor
-
Post Thanks / Like - 1 Thanks
cherouvim13 (1 members gave Thanks to Stormreaver for this useful post)
-
Member
-
First Dev On The Internet
Originally Posted by
ADV2015
Hello everyone,
I have a problem that I can not find the solution ...
when the gems are in the trunk, the text is shifted upward
Someone will have an idea?
Gemm in stack
Same gemm in inventory.
I don't understand....
I have it good in stash and too bottom / right in the inventory.
probably a TurboHUD display bug...
what is your screen resolution ?
-
Member
Hi,
My resolution --> 1920x1080
maybe another plugin creates a bug !!! Edit: NO, I tested it alone...
Last edited by ADV2015; 09-17-2017 at 09:56 AM.
-
First Dev On The Internet
Originally Posted by
ADV2015
Hi,
My resolution --> 1920x1080
it only happens on square 1*1 items.
if the same happens with the DrawItemLooksGood option it's a TurboHUD display bug and there is nothing I can do.
if you want to test it :
PluginEnablerOrDisablerPlugin :
PHP Code:
Hud.GetPlugin<InventoryAndStashPlugin>().LooksGoodDisplayEnabled = true;
Originally Posted by
ADV2015
maybe another plugin creates a bug !!!
The chance is low...
Last edited by User5981; 09-17-2017 at 10:00 AM.
-
Member
-
First Dev On The Internet
Originally Posted by
ADV2015
Tested but nothing !!!
inventory :
stash :
I will look at this when I have time.
-
Post Thanks / Like - 1 Thanks
ADV2015 (1 members gave Thanks to User5981 for this useful post)
-
Member
For information, my D3 is in French...
-
Contributor
Hi,
PHP Code:
bool Max = IsMaxedGem(item, jewelRank);
if (Max) {...}
else {...}
Max is only used here, you can change to
PHP Code:
if (IsMaxedGem(item, jewelRank)) {...}
else {...}
Originally Posted by
ADV2015
Gemm in stack
Same gemm in inventory.
i use:
PHP Code:
GRupgradeChanceFont.DrawText(layout, rect.Right - layout.Metrics.Width - 8, rect.Y + 33);
for 1920x1080 relosution. u can set a public variable to set 8 via "PluginEnablerOrDisablerPlugin"
greetz gjuz
-
First Dev On The Internet
Updated!
This version probably fixes the display bug for every resolution, please report, thanks !
for gjuz : I only changed that :
PHP Code:
GRupgradeChanceFont.DrawText(layout, rect.Right - layout.Metrics.Width, rect.Bottom - layout.Metrics.Height);
Last edited by User5981; 09-18-2017 at 09:58 AM.
-
Contributor
Originally Posted by
User5981
Updated!
This version probably fixes the display bug for every resolution, please report, thanks !
for gjuz : I only changed that :
PHP Code:
GRupgradeChanceFont.DrawText(layout, rect.Right - layout.Metrics.Width, rect.Bottom - layout.Metrics.Height);
yes this is bottom right corner, i like a little border
greetz gjuz
-
Member
Yes, fixed, all good !
Thanks a lot !