OK I have put together a quick solution using the button press idea (as discussed in my last post below) to switch between item desriptions and I think it could be the way to go.
See below and let me know what you think. The code could be refactored a bit but you get the idea as a proof of concept first impresssion:
In input.settings file add the line in [RadialMenu]
// Event for user to select type of description they want displayed e.g. short description, full stats, full description event OnSwitchRadialItemTextDescription( action : SInputAction ) { KillItemTimer();
if ((!m_IsPlayerCiri) && (m_shown)) { if (IsPressed(action))
// 3 options available // 0 = short description + basic stats (default) // 1 = Full stats // 2 = Full description if (SwitchRadialItemTextDescriptionOptionFlag == 2) { SwitchRadialItemTextDescriptionOptionFlag = 0; } else { SwitchRadialItemTextDescriptionOptionFlag = SwitchRadialItemTextDescriptionOptionFlag + 1; }
SelectSlotId(); } }
Add function to get Full stats info
Spoiler:
Show
//based on GetBaseItemData function found in guiTooltipComponent.ws private function GetRadialItemFullStatsText(item: SItemUniqueId, inv: CInventoryComponent) : String {
var strStats : String; var i : int; var statsList : CScriptedFlashArray;
strStats = ""; for (i = 0; i < statsList.GetLength(); i += 1) { strStats += statsList.GetElementFlashObject(i).GetMemberFlashString("value") + " " + statsList.GetElementFlashObject(i).GetMemberFlashString("name") + "<br>"; }
return strStats;
}
Insert case to compare which option is currently in use and get the description. This should go into function SelectSlotId() before the m_fxUpdateItemIconSFF.InvokeSelfFiveArgs function is called.
Spoiler:
Show
switch (SwitchRadialItemTextDescriptionOptionFlag) { case 0: //fullDescription = "SHORT DESCRIPTION + BASIC STATS"; // we break because the methods above have already set short description and basic stats to fullDescription break;
Interesting approach. I tried looking for a way to either expand the number of lines or have different text for the middle and bottom right text display area but couldn't seem to find a way. I think the draw function is called higher up the chain in the game which Im not sure how to influence.
The limitation of 6 lines makes it difficult to include the ideal info, either the description is cut short or the stats are cut short.
Your approach is interesting as it seems to balance between the two, however it is difficult to know if cutting the description would have any negative impact for the user missing out potential useful information. On the other hand the user may find the stats info more important. Im not really sure the best way forward to be honest.
Maybe a button configuration that when you press it switches the display text between Full description and Full Stats by updating the item text displayed somehow; call SelectSlotId again with bool var changed when L Thumbstick button is pressed?
Alternatively maybe an option for the user to choose what is displayed e.g. 1. Short description + Basic stats (this could be default option) 2. Full description + No stats 3. No description + Full stats 4. Full description + Full stats (but inform the user in Mod description that some stats are cut off for long item descriptions)
On testing I did notice the text size seems to cut off the last line for Grapeshot Bomb and Superior Swallow; even though they were only showing 5 lines. I removed the Size format from the code (so it uses the default size) and it now shows all 6 lines for both. Im wondering whether the size format is useful or maybe just keep the default text size instead.
I am using the English Language version for reference so Im not sure how the text is displayed for other languages or what is cut off etc.
Yes, I think you have the right method here. I added a modification to display only the regen and duration attributes, so as not to have the whole list for all. Here it is: https://www.dropbox.com/s/xyvcu1gzkw90mxa/modQuickSelection_Standalone.zip?dl=0
I also added at the same time a new file modQuickRadialSelectionConfig.ws containing all the config values.
I am considering adding another option to have the whole list of attributes. I don't want all myself, but might as well give the option.
I think the latest method I posted is the way to go.
I meant it is a simpler way to retrieve the item stats (instead of a simplfied version of the stats).
It also retrieves the item stats including buffs (as seen in the Inventory menu); I think it is using the same method to what the inventory menu uses as far as I can tell.
This is a much better way than my previous method because there are no "hacks" to get the item stats. It will follow same process how the Inventory menu shows the stats so the code is a lot more manageable.
And if CDPR change what stats are shown, it "shouldn't" need much work (maybe none additional) to show the same stats as the Inventory menu displays.
Discussion concerning stats display (5 comments)
See below and let me know what you think. The code could be refactored a bit but you get the idea as a proof of concept first impresssion:
In input.settings file add the line in [RadialMenu]
IK_Pad_LeftThumb=(Action=SwitchRadialItemTextDescription)
In input.xml add the following line:
<Var builder="Input" id="SwitchRadialItemTextDescription" displayName="SwitchRadialItemTextDescription" displayType="INPUTPC" actions="SwitchRadialItemTextDescription" />
In hudModuleRadialMenu.ws:
Define a var to keep track of which type of description user has chosen to display.
private var SwitchRadialItemTextDescriptionOptionFlag : int;
default SwitchRadialItemTextDescriptionOptionFlag = 0;
Add lisenter
theInput.RegisterListener( this, 'OnSwitchRadialItemTextDescription', 'SwitchRadialItemTextDescription' );
Add event when button is pressed
// Event for user to select type of description they want displayed e.g. short description, full stats, full description
event OnSwitchRadialItemTextDescription( action : SInputAction )
{
KillItemTimer();
if ((!m_IsPlayerCiri) && (m_shown))
{
if (IsPressed(action))
// 3 options available
// 0 = short description + basic stats (default)
// 1 = Full stats
// 2 = Full description
if (SwitchRadialItemTextDescriptionOptionFlag == 2)
{
SwitchRadialItemTextDescriptionOptionFlag = 0;
}
else
{
SwitchRadialItemTextDescriptionOptionFlag = SwitchRadialItemTextDescriptionOptionFlag + 1;
}
SelectSlotId();
}
}
Add function to get Full stats info
//based on GetBaseItemData function found in guiTooltipComponent.ws
private function GetRadialItemFullStatsText(item: SItemUniqueId, inv: CInventoryComponent) : String
{
var strStats : String;
var i : int;
var statsList : CScriptedFlashArray;
//maxToxicity = RoundMath(thePlayer.GetStatMax( BCS_Toxicity ));
modQuickRadialSelection_tooltipComponent.initialize(inv, modQuickRadialSelection_flashValueStorage);
modQuickRadialSelection_tooltipComponent.setCurrentInventory(inv);
statsList = modQuickRadialSelection_tooltipComponent.GetBaseItemData(item, inv).GetMemberFlashArray("StatsList");
strStats = "";
for (i = 0; i < statsList.GetLength(); i += 1)
{
strStats += statsList.GetElementFlashObject(i).GetMemberFlashString("value") + " " + statsList.GetElementFlashObject(i).GetMemberFlashString("name") + "<br>";
}
return strStats;
}
Insert case to compare which option is currently in use and get the description. This should go into function SelectSlotId() before the m_fxUpdateItemIconSFF.InvokeSelfFiveArgs function is called.
switch (SwitchRadialItemTextDescriptionOptionFlag)
{
case 0:
//fullDescription = "SHORT DESCRIPTION + BASIC STATS";
// we break because the methods above have already set short description and basic stats to fullDescription
break;
case 1:
//fullDescription = "FULL STATS";
fullDescription = "<font color = '" + modQuickRadialSelectionConfig.itemStatsColor + "'>" + GetRadialItemFullStatsText(item, inv) + "</font>";
break;
case 2:
//fullDescription = "FULL DESCRIPTION";
fullDescription = itemDescription;
break;
default:
break;
}
The limitation of 6 lines makes it difficult to include the ideal info, either the description is cut short or the stats are cut short.
Your approach is interesting as it seems to balance between the two, however it is difficult to know if cutting the description would have any negative impact for the user missing out potential useful information. On the other hand the user may find the stats info more important. Im not really sure the best way forward to be honest.
Maybe a button configuration that when you press it switches the display text between Full description and Full Stats by updating the item text displayed somehow; call SelectSlotId again with bool var changed when L Thumbstick button is pressed?
Alternatively maybe an option for the user to choose what is displayed e.g.
1. Short description + Basic stats (this could be default option)
2. Full description + No stats
3. No description + Full stats
4. Full description + Full stats (but inform the user in Mod description that some stats are cut off for long item descriptions)
On testing I did notice the text size seems to cut off the last line for Grapeshot Bomb and Superior Swallow; even though they were only showing 5 lines. I removed the Size format from the code (so it uses the default size) and it now shows all 6 lines for both. Im wondering whether the size format is useful or maybe just keep the default text size instead.
I am using the English Language version for reference so Im not sure how the text is displayed for other languages or what is cut off etc.
Here it is:
https://www.dropbox.com/s/xyvcu1gzkw90mxa/modQuickSelection_Standalone.zip?dl=0
I also added at the same time a new file modQuickRadialSelectionConfig.ws containing all the config values.
I am considering adding another option to have the whole list of attributes. I don't want all myself, but might as well give the option.
I meant it is a simpler way to retrieve the item stats (instead of a simplfied version of the stats).
It also retrieves the item stats including buffs (as seen in the Inventory menu); I think it is using the same method to what the inventory menu uses as far as I can tell.
This is a much better way than my previous method because there are no "hacks" to get the item stats. It will follow same process how the Inventory menu shows the stats so the code is a lot more manageable.
And if CDPR change what stats are shown, it "shouldn't" need much work (maybe none additional) to show the same stats as the Inventory menu displays.
I create this forum to be a follow-up of the following posts:
http://forums.nexusmods.com/index.php?/topic/3252549-quick-radial-selection/?p=29480609
Here are the last posts to summarize the point: