Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions LongWarOfTheChosen/Config/XComLW_UI.ini
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,6 @@ RECRUIT_FONT_SIZE_CTRL = 22 ; Recruit screen font size for controller users.
RECRUIT_Y_OFFSET_CTRL = -3 ; Moves the stats up/down; negative numbers move up / positive numbers move down.
RECRUIT_FONT_SIZE_MK = 20 ; Recruit screen font size for mouse & keyboard users.
RECRUIT_Y_OFFSET_MK = -2; ; Moves the stats up/down; negative numbers move up / positive numbers move down.

[NewPromotionScreenByDefault_Integrated.NPSBDP_UIArmory_PromotionHero]
USE_SHORTER_PROMOTION_SCREEN = false ; Use a slightly shorter promotion screen; this removes the panel tearing seen when cycling soldiers.
7 changes: 7 additions & 0 deletions LongWarOfTheChosen/LongWarOfTheChosen.x2proj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<Folder Include="Content\LW_Toolbox_Integrated\" />
<Folder Include="Content\Maps\" />
<Folder Include="Content\Missions\" />
<Folder Include="Content\NPSBD_Integrated" />
<Folder Include="Content\Parcels\" />
<Folder Include="Content\PCPs\" />
<Folder Include="Content\Plots\" />
Expand Down Expand Up @@ -162,6 +163,12 @@
<Content Include="Content\Missions\UMS_LWCommon.umap" />
<Content Include="Content\Missions\UMS_LWContinuousReinforcements.umap" />
<Content Include="Content\Missions\UMS_LWMissionTimer.umap" />
<Content Include="Content\NPSBD_Integrated\3DUIBP_Armory_Promotion_Hero.umap">
<SubType>Content</SubType>
</Content>
<Content Include="Content\NPSBD_Integrated\Readme.txt">
<SubType>Content</SubType>
</Content>
<Content Include="Content\Plots\Plot_ALB_AlienBase_01_LW.umap" />
<Content Include="Content\Plots\Plot_ALB_AlienBase_02_LW.umap" />
<Content Include="Content\Plots\Plot_ALB_AlienBase_03_LW.umap" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@ var config array<int> FactionAbilityCosts;
var config float BaseAbilityCostModifier;

var config int ScrollbarPositionX;
var config(LW_UI) bool USE_SHORTER_PROMOTION_SCREEN;

// Position is the number by which we offset all ability indices.
// 0 <= Position <= MaxPosition
var int Position, MaxPosition;

var int AdjustXOffset;

simulated function ChangeSelectedColumn(int oldIndex, int newIndex)
{
local int i, NewColumnAbilityIndex, NewColumnAbilities, OldColumnAbilityIndex;
Expand Down Expand Up @@ -125,20 +124,30 @@ simulated function InitPromotion(StateObjectReference UnitRef, optional bool bIn

PopulateData();

// Only set position and animate in the scrollbar once after data population. Prevents scrollbar flicker on scrolling.
// NPSBD : Set the scrollbar's position, and animate it in, after data population. This prevents scrollbar
// flicker on scrolling.
//
// KDM : When the scrollbar was anchored, it would move around when switching from 'fullscreen' mode
// to 'windowed' mode. Consequently, anchoring has been removed, and its X location has been updated
// so that it remains on the right side of the promotion screen.
if (default.ScrollbarPositionX > 0)
{
Scrollbar.SetPosition(default.ScrollbarPositionX, 310);
}
else if (HasBrigadierRank())
{
// KDM : The X position was originally set to -465; however, I am perplexed as to why, since the scrollbar was much too far to the right.
// In fact it was nearly always blocked by the soldier pawn.
Scrollbar.SetPosition(-475, 310);
if (!USE_SHORTER_PROMOTION_SCREEN)
{
Scrollbar.SetPosition(1350, 310);
}
else
{
Scrollbar.SetPosition(1505, 310);
}
}
else
{
Scrollbar.SetPosition(-550, 310);
Scrollbar.SetPosition(1275, 310);
}

Scrollbar.MC.SetNum("_alpha", 0);
Expand Down Expand Up @@ -453,7 +462,6 @@ simulated function RealizeScrollbar()
if(Scrollbar == none)
{
Scrollbar = Spawn(class'UIScrollbar', self).InitScrollbar();
Scrollbar.SetAnchor(class'UIUtilities'.const.ANCHOR_TOP_RIGHT);
Scrollbar.SetHeight(450);
}
Scrollbar.NotifyValueChange(OnScrollBarChange, 0.0, MaxPosition);
Expand Down Expand Up @@ -1148,60 +1156,101 @@ function int GetCustomAbilityCost(name ClassName, name AbilityName)

function ResizeScreenForBrigadierRank()
{
local int ScreenX, ScreenXOffset, ScreenWidth, RankColumnWidth;

// Fix width and position of elements to make space for the 8th column
//
Width = int(MC.GetNum("_width"));
AdjustXOffset = MC.GetNum("rankColumn6._x") - MC.GetNum("rankColumn5._x");
SetWidth(Width + AdjustXOffset);

// Widths
MC.ChildSetNum("bg", "_width", MC.GetNum("bg._width") + AdjustXOffset);
MC.ChildSetNum("topDivider", "_width", MC.GetNum("topDivider._width") + AdjustXOffset);
MC.ChildSetNum("bottomDivider", "_width", MC.GetNum("bottomDivider._width") + AdjustXOffset);
MC.ChildSetNum("headerLines", "_width", MC.GetNum("headerLines._width") + AdjustXOffset);
MC.ChildSetNum("columnGradients", "_width", MC.GetNum("columnGradients._width") + AdjustXOffset);

// X Positions
MC.SetNum("_x", MC.GetNum("_x") + 50);
MC.ChildSetNum("topDivider", "_x", MC.GetNum("topDivider._x") - AdjustXOffset);
MC.ChildSetNum("bottomDivider", "_x", MC.GetNum("bottomDivider._x") - AdjustXOffset);
MC.ChildSetNum("headerLines", "_x", MC.GetNum("headerLines._x") - AdjustXOffset);
MC.ChildSetNum("columnGradients", "_x", MC.GetNum("columnGradients._x") - AdjustXOffset);
MC.ChildSetNum("factionLogoLarge", "_x", MC.GetNum("factionLogoLarge._x") - AdjustXOffset);
MC.ChildSetNum("factionLogo", "_x", MC.GetNum("factionLogo._x") - AdjustXOffset);
MC.ChildSetNum("classIcon", "_x", MC.GetNum("classIcon._x") - AdjustXOffset);
MC.ChildSetNum("rankIcon", "_x", MC.GetNum("rankIcon._x") - AdjustXOffset);
MC.ChildSetNum("factionName", "_x", MC.GetNum("factionName._x") - AdjustXOffset);
MC.ChildSetNum("abilityLabel", "_x", MC.GetNum("abilityLabel._x") - AdjustXOffset);
//MC.ChildSetNum("soldierAPLabel", "_x", MC.GetNum("soldierAPLabel._x") - AdjustXOffset);
//MC.ChildSetNum("soldierAPValue", "_x", MC.GetNum("soldierAPValue._x") - AdjustXOffset);
//MC.ChildSetNum("teamAPLabel", "_x", MC.GetNum("teamAPLabel._x") - AdjustXOffset);
//MC.ChildSetNum("teamAPValue", "_x", MC.GetNum("teamAPValue._x") - AdjustXOffset);
//MC.ChildSetNum("combatIntelLabel", "_x", MC.GetNum("combatIntelLabel._x") - AdjustXOffset);
//MC.ChildSetNum("combatIntelValue", "_x", MC.GetNum("combatIntelValue._x") - AdjustXOffset);
MC.ChildSetNum("unitName", "_x", MC.GetNum("unitName._x") - AdjustXOffset);
MC.ChildSetNum("descriptionTitle", "_x", MC.GetNum("descriptionTitle._x") - AdjustXOffset);
MC.ChildSetNum("descriptionBody", "_x", MC.GetNum("descriptionBody._x") - AdjustXOffset);
MC.ChildSetNum("descriptionDetail", "_x", MC.GetNum("descriptionDetail._x") - AdjustXOffset);
MC.ChildSetNum("descriptionIcon", "_x", MC.GetNum("descriptionIcon._x") - AdjustXOffset);
MC.ChildSetNum("costLabel", "_x", MC.GetNum("costLabel._x") - AdjustXOffset);
MC.ChildSetNum("costValue", "_x", MC.GetNum("costValue._x") - AdjustXOffset);
MC.ChildSetNum("apLabel", "_x", MC.GetNum("apLabel._x") - AdjustXOffset);
MC.ChildSetNum("abilityPathHeader", "_x", MC.GetNum("abilityPathHeader._x") - AdjustXOffset);
MC.ChildSetNum("pathLabel0", "_x", MC.GetNum("pathLabel0._x") - AdjustXOffset);
MC.ChildSetNum("pathLabel1", "_x", MC.GetNum("pathLabel1._x") - AdjustXOffset);
MC.ChildSetNum("pathLabel2", "_x", MC.GetNum("pathLabel2._x") - AdjustXOffset);
MC.ChildSetNum("pathLabel3", "_x", MC.GetNum("pathLabel3._x") - AdjustXOffset);
MC.ChildSetNum("rankColumn0", "_x", MC.GetNum("rankColumn0._x") - AdjustXOffset);
MC.ChildSetNum("rankColumn1", "_x", MC.GetNum("rankColumn1._x") - AdjustXOffset);
MC.ChildSetNum("rankColumn2", "_x", MC.GetNum("rankColumn2._x") - AdjustXOffset);
MC.ChildSetNum("rankColumn3", "_x", MC.GetNum("rankColumn3._x") - AdjustXOffset);
MC.ChildSetNum("rankColumn4", "_x", MC.GetNum("rankColumn4._x") - AdjustXOffset);
MC.ChildSetNum("rankColumn5", "_x", MC.GetNum("rankColumn5._x") - AdjustXOffset);
MC.ChildSetNum("rankColumn6", "_x", MC.GetNum("rankColumn6._x") - AdjustXOffset);
MC.ChildSetNum("rankColumn7", "_x", MC.GetNum("rankColumn6._x"));
MC.ChildSetNum("rankColumn7", "_y", MC.GetNum("rankColumn6._y"));
// KDM : Get the screen's location and width via Flash since they aren't updated in UnrealScript yet.
ScreenX = MC.GetNum("_x");
ScreenXOffset = (!USE_SHORTER_PROMOTION_SCREEN) ? 50 : -10;
ScreenWidth = MC.GetNum("_width");

// KDM : Determine the width of our 8th rank column based on the distance between 2 rank columns
// which already exist.
RankColumnWidth = MC.GetNum("rankColumn6._x") - MC.GetNum("rankColumn5._x");

if (!USE_SHORTER_PROMOTION_SCREEN)
{
// KDM : NPSBD increases the width of the promotion screen; however, I don't think this is the 'normal'
// way to do things since :
// 1.] The screen, located within the Flash movie, is already over 1700 pixels and need not be wider.
// 2.] Widening a UIScreen seems to stretch the panels placed upon it.
// I remove this width change for my 'shorter' promotion screen, but will leave it in for the
// 'normal' promotion screen so its size and UI placement remain intact.
SetWidth(ScreenWidth + RankColumnWidth);
}
SetX(ScreenX + ScreenXOffset);

// KDM : Increase the width of a number of background UI elements since we are adding an extra rank column.
MC.ChildSetNum("bg", "_width", MC.GetNum("bg._width") + RankColumnWidth);
MC.ChildSetNum("topDivider", "_width", MC.GetNum("topDivider._width") + RankColumnWidth);
MC.ChildSetNum("bottomDivider", "_width", MC.GetNum("bottomDivider._width") + RankColumnWidth);
MC.ChildSetNum("headerLines", "_width", MC.GetNum("headerLines._width") + RankColumnWidth);
MC.ChildSetNum("columnGradients", "_width", MC.GetNum("columnGradients._width") + RankColumnWidth);

if (!USE_SHORTER_PROMOTION_SCREEN)
{
// KDM : The promotion screen, as a whole, is shifted to the right; therefore, a variety of panels
// are shifted left, back into place.
MC.ChildSetNum("topDivider", "_x", MC.GetNum("topDivider._x") - RankColumnWidth);
MC.ChildSetNum("bottomDivider", "_x", MC.GetNum("bottomDivider._x") - RankColumnWidth);
MC.ChildSetNum("headerLines", "_x", MC.GetNum("headerLines._x") - RankColumnWidth);
MC.ChildSetNum("columnGradients", "_x", MC.GetNum("columnGradients._x") - RankColumnWidth);
MC.ChildSetNum("factionLogoLarge", "_x", MC.GetNum("factionLogoLarge._x") - RankColumnWidth);
MC.ChildSetNum("factionLogo", "_x", MC.GetNum("factionLogo._x") - RankColumnWidth);
MC.ChildSetNum("classIcon", "_x", MC.GetNum("classIcon._x") - RankColumnWidth);
MC.ChildSetNum("rankIcon", "_x", MC.GetNum("rankIcon._x") - RankColumnWidth);
MC.ChildSetNum("factionName", "_x", MC.GetNum("factionName._x") - RankColumnWidth);
MC.ChildSetNum("abilityLabel", "_x", MC.GetNum("abilityLabel._x") - RankColumnWidth);
MC.ChildSetNum("unitName", "_x", MC.GetNum("unitName._x") - RankColumnWidth);
MC.ChildSetNum("descriptionTitle", "_x", MC.GetNum("descriptionTitle._x") - RankColumnWidth);
MC.ChildSetNum("descriptionBody", "_x", MC.GetNum("descriptionBody._x") - RankColumnWidth);
MC.ChildSetNum("descriptionDetail", "_x", MC.GetNum("descriptionDetail._x") - RankColumnWidth);
MC.ChildSetNum("descriptionIcon", "_x", MC.GetNum("descriptionIcon._x") - RankColumnWidth);
MC.ChildSetNum("costLabel", "_x", MC.GetNum("costLabel._x") - RankColumnWidth);
MC.ChildSetNum("costValue", "_x", MC.GetNum("costValue._x") - RankColumnWidth);
MC.ChildSetNum("apLabel", "_x", MC.GetNum("apLabel._x") - RankColumnWidth);
MC.ChildSetNum("abilityPathHeader", "_x", MC.GetNum("abilityPathHeader._x") - RankColumnWidth);
MC.ChildSetNum("pathLabel0", "_x", MC.GetNum("pathLabel0._x") - RankColumnWidth);
MC.ChildSetNum("pathLabel1", "_x", MC.GetNum("pathLabel1._x") - RankColumnWidth);
MC.ChildSetNum("pathLabel2", "_x", MC.GetNum("pathLabel2._x") - RankColumnWidth);
MC.ChildSetNum("pathLabel3", "_x", MC.GetNum("pathLabel3._x") - RankColumnWidth);
MC.ChildSetNum("rankColumn0", "_x", MC.GetNum("rankColumn0._x") - RankColumnWidth);
MC.ChildSetNum("rankColumn1", "_x", MC.GetNum("rankColumn1._x") - RankColumnWidth);
MC.ChildSetNum("rankColumn2", "_x", MC.GetNum("rankColumn2._x") - RankColumnWidth);
MC.ChildSetNum("rankColumn3", "_x", MC.GetNum("rankColumn3._x") - RankColumnWidth);
MC.ChildSetNum("rankColumn4", "_x", MC.GetNum("rankColumn4._x") - RankColumnWidth);
MC.ChildSetNum("rankColumn5", "_x", MC.GetNum("rankColumn5._x") - RankColumnWidth);
MC.ChildSetNum("rankColumn6", "_x", MC.GetNum("rankColumn6._x") - RankColumnWidth);
MC.ChildSetNum("rankColumn7", "_x", MC.GetNum("rankColumn6._x"));
}
else
{
// KDM : The background, 'bg', is a bit of an odd-ball since it doesn't seem to move with the rest of the
// panels when the screen X value is changed. Therefore, shift it over a bit so it fits nicely behind all of the
// other panels.
MC.ChildSetNum("bg", "_x", MC.GetNum("bg._x") + RankColumnWidth);
// KDM : Shift the soldier AP label and value to the top right corner of the background panel.
MC.ChildSetNum("soldierAPLabel", "_x", MC.GetNum("soldierAPLabel._x") + RankColumnWidth);
MC.ChildSetNum("soldierAPValue", "_x", MC.GetNum("soldierAPValue._x") + RankColumnWidth);
// KDM : Shift the XCom AP label and value so they are next to the soldier AP label and value.
MC.ChildSetNum("teamAPLabel", "_x", MC.GetNum("teamAPLabel._x") + RankColumnWidth);
MC.ChildSetNum("teamAPValue", "_x", MC.GetNum("teamAPValue._x") + RankColumnWidth);
// KDM : Shift the Combat Intelligence label and value so they are next to the XCom AP label and value.
MC.ChildSetNum("combatIntelLabel", "_x", MC.GetNum("combatIntelLabel._x") + RankColumnWidth);
MC.ChildSetNum("combatIntelValue", "_x", MC.GetNum("combatIntelValue._x") + RankColumnWidth);
// KDM : Shift the ability point label, cost label, and cost value to the bottom right corner of the background panel.
MC.ChildSetNum("apLabel", "_x", MC.GetNum("apLabel._x") + RankColumnWidth);
MC.ChildSetNum("costLabel", "_x", MC.GetNum("costLabel._x") + RankColumnWidth);
MC.ChildSetNum("costValue", "_x", MC.GetNum("costValue._x") + RankColumnWidth);
// KDM : Place the 8th rank column to the right of the 7th rank column.
MC.ChildSetNum("rankColumn7", "_x", MC.GetNum("rankColumn6._x") + RankColumnWidth);
// KDM : Increase the width of the soldier's name container; unitName is an XComScrollingTextField,
// within Flash, so get and set its width appropriately.
MC.ChildFunctionNum("unitName", "setWidth", MC.GetNum("unitName.maskWidth") + RankColumnWidth);
// KDM : Increase the width of the ability description container; descriptionBody is a textField,
// within Flash, so set its width appropriately.
MC.ChildSetNum("descriptionBody", "_width", MC.GetNum("descriptionBody._width") + RankColumnWidth);
}
MC.ChildSetNum("rankColumn7", "_y", MC.GetNum("rankColumn6._y"));
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,85 @@
class NPSBDP_UIArmory_PromotionHeroColumn extends UIArmory_PromotionHeroColumn;

var int Offset;
var UIText RankLabelLine1, RankLabelLine2;

function UIArmory_PromotionHeroColumn InitPromotionHeroColumn(int InitRank)
{
super.InitPromotionHeroColumn(InitRank);

// KDM : Create the UIText's which will display the rank labels.
RankLabelLine1 = Spawn(class'UIText', self);
RankLabelLine1.InitText('RankLabelLine1', "");
RankLabelLine2 = Spawn(class'UIText', self);
RankLabelLine2.InitText('RankLabelLine2', "");

UpdateSizeAndPosition();

return self;
}

function UpdateSizeAndPosition()
{
// KDM : The rank icon.
MC.ChildSetNum("rankMC", "_x", 41);
MC.ChildSetNum("rankMC", "_y", -8);

// KDM : The 'rank up' highlight.
MC.ChildSetNum("rankHighlight", "_x", 0);
MC.ChildSetNum("rankHighlight", "_y", -31);

// KDM : Rank label line 1.
RankLabelLine1.SetPosition(2, 52);
RankLabelLine1.SetWidth(145);

// KDM : Rank label line 2.
RankLabelLine2.SetPosition(2, 78);
RankLabelLine2.SetWidth(145);
}

function AS_SetData(bool ShowHighlight, string HighlightText, string RankIcon, string RankLabel)
{
MC.BeginFunctionOp("SetData");
MC.QueueBoolean(ShowHighlight);
MC.QueueString(HighlightText);
MC.QueueString(RankIcon);
// KDM : We no longer want to set rankLabel, within Flash, since we will be dealing with
// multi-line rank labels by ourself.
MC.QueueString("");
MC.EndOp();

SetRankLabel(RankLabel);
}

function SetRankLabel(string RankLabel)
{
local int i;
local string ConcatenatedString;
local array<string> RankLabelComponents;

RankLabelComponents = SplitString(RankLabel, " ", true);
if (RankLabelComponents.Length >= 1)
{
RankLabelLine1.SetHtmlText(class'UIUtilities_Text'.static.GetColoredText(
RankLabelComponents[0], eUIState_Normal, 24, "CENTER"));

i = 1;
ConcatenatedString = "";
// KDM : Normally, a rank label will consist of 1 or 2 words; if it consists of more, any word after
// the 1st will be concatenated with spaces and placed in RankLabelLine2.
while (i < RankLabelComponents.Length)
{
ConcatenatedString $= RankLabelComponents[i];
if (i + 1 < RankLabelComponents.Length)
{
ConcatenatedString $= " ";
}
i++;
}
RankLabelLine2.SetHtmlText(class'UIUtilities_Text'.static.GetColoredText(
ConcatenatedString, eUIState_Normal, 24, "CENTER"));
}
}

function OnAbilityInfoClicked(UIButton Button)
{
Expand Down Expand Up @@ -113,3 +192,4 @@ simulated function bool AttemptScroll(bool Up)
{
return NPSBDP_UIArmory_PromotionHero(Screen).AttemptScroll(Up);
}