Skip to content

Commit

Permalink
Merge branch 'master' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
pledbrook committed Dec 28, 2021
2 parents ee312e3 + c05d60b commit 83455ec
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 81 deletions.
7 changes: 4 additions & 3 deletions LongWarOfTheChosen/Src/LW_Overhaul/Classes/LWTemplateMods.uc
Original file line number Diff line number Diff line change
Expand Up @@ -1704,9 +1704,7 @@ function ModifyAbilitiesGeneral(X2AbilityTemplate Template, int Difficulty)
break;
}

// that isn't available with X2WOTCCommunityHighlander right now. I'm building against a custom
// version.
if (default.USE_ACTION_ICON_COLORS)
if (default.USE_ACTION_ICON_COLORS && !class'Helpers_LW'.static.IsModInstalled("WOTC_CostBasedAbilityColors"))
{
for (k = 0; k < Template.AbilityCosts.length; k++)
{
Expand Down Expand Up @@ -3605,6 +3603,9 @@ function ReconfigFacilities(X2StrategyElementTemplate Template, int Difficulty)

// Remove the second upgrade, since there's only the one staff slot to unlock
FacilityTemplate.Upgrades.RemoveItem('ResistanceRing_UpgradeII');

// No longer mark it as being a priority/requiring attention
FacilityTemplate.bPriority = false;
}
//if (FacilityTemplate.DataName == 'Storage') Didn't work
//{
Expand Down
2 changes: 1 addition & 1 deletion LongWarOfTheChosen/Src/LW_Overhaul/Classes/LWVersion.uc
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ defaultproperties
MajorVersion = 1;
MinorVersion = 1;
PatchVersion = 0;
Classifier = "dev 29"
Classifier = "dev 30"
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ event OnInit(UIScreen Screen)

if(!Screen.IsA('UISquadSelect')) return;

`Log("UIScreenListener_SquadSelect_LW: Initializing");

SquadSelect = UISquadSelect(Screen);
if(SquadSelect == none) return;

Expand Down Expand Up @@ -244,8 +242,6 @@ event OnReceiveFocus(UIScreen Screen)
SquadSelect = UISquadSelect(Screen);
if(SquadSelect == none) return;

`Log("UIScreenListener_SquadSelect_LW: Received focus");

SquadSelect.bDirty = true; // Workaround for bug in currently published version of squad select
SquadSelect.UpdateData();
SquadSelect.UpdateNavHelp();
Expand All @@ -255,8 +251,6 @@ event OnReceiveFocus(UIScreen Screen)
InfiltrationInfo = UISquadSelect_InfiltrationPanel(SquadSelect.GetChildByName('SquadSelect_InfiltrationInfo_LW', false));
if (InfiltrationInfo != none)
{
`Log("UIScreenListener_SquadSelect_LW: Found infiltration panel");

//remove and recreate infiltration info in order to prevent issues with Flash text updates not getting processed
InfiltrationInfo.Remove();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,72 +197,9 @@ static event OnLoadedSavedGameToStrategy()
local XComGameState NewGameState;
local XComGameStateHistory History;
local XComGameState_Objective ObjectiveState;
local int i, Forcelevel, ChosenLevel;
local XComGameState_HeadquartersAlien AlienHQ;
local XComGameState_LWOutpostManager OutpostManager;
local XComGameState_WorldRegion RegionState;
local XComGameState_LWOutpost OutpostState;
local XComGameState_LWToolboxOptions ToolboxOptions;

local array<XComGameState_AdventChosen> AllChosen;
local name OldTacticalTag, NewTacticalTag;
local XComGameState_AdventChosen ChosenState;

History = `XCOMHISTORY;

// TODO: Remove these post 1.0 - START

// LWOTC beta 2: Remove the 'OnMonthlyReportAlert' listener as it's no
// longer needed (Not Created Equally is handled by the 'UnitRandomizedStats'
// event now).
ToolboxOptions = class'XComGameState_LWToolboxOptions'.static.GetToolboxOptions();
`XEVENTMGR.UnRegisterFromEvent(ToolboxOptions, 'OnMonthlyReportAlert');

// Make sure pistol abilities apply to the new pistol slot
LWMigratePistolAbilities();

// If there are rebels that have already ranked up, make sure they have some abilities
OutpostManager = `LWOUTPOSTMGR;
NewGameState = class'XComGameStateContext_ChangeContainer'.static.CreateChangeState("Patching existing campaign data");
foreach History.IterateByClassType(class'XComGameState_WorldRegion', RegionState)
{
if (RegionState.HaveMadeContact())
{
OutpostState = OutpostManager.GetOutpostForRegion(RegionState);
OutpostState.UpdateRebelAbilities(NewGameState);
}
}

//Make sure the chosen are of appropriate level
AlienHQ = XComGameState_HeadquartersAlien(History.GetSingleGameStateObjectForClass(class'XComGameState_HeadquartersAlien'));
Forcelevel = class'Utilities_LW'.static.GetLWForceLevel();
AllChosen = AlienHQ.GetAllChosen();

ChosenLevel = 3;
for (i = 0; i < class'X2StrategyElement_DefaultAlienActivities'.default.CHOSEN_LEVEL_FL_THRESHOLDS.Length; i++)
{
if (ForceLevel < class'X2StrategyElement_DefaultAlienActivities'.default.CHOSEN_LEVEL_FL_THRESHOLDS[i])
{
ChosenLevel = i;
break;
}
}

foreach AllChosen(ChosenState)
{
OldTacticalTag = ChosenState.GetMyTemplate().GetSpawningTag(ChosenState.Level);

if (ChosenState.Level != ChosenLevel)
{
ChosenState = XComGameState_AdventChosen(NewGameState.ModifyStateObject(class'XComGameState_AdventChosen', ChosenState.ObjectID));
Chosenstate.Level = ChosenLevel;
}

NewTacticalTag = ChosenState.GetMyTemplate().GetSpawningTag(ChosenState.Level);
// Replace Old Tag with new Tag in missions
ChosenState.RemoveTacticalTagFromAllMissions(NewGameState, OldTacticalTag, NewTacticalTag);
}
// Remove these post 1.0 - END

if (`LWOVERHAULOPTIONS == none)
class'XComGameState_LWOverhaulOptions'.static.CreateModSettingsState_ExistingCampaign(class'XComGameState_LWOverhaulOptions');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,22 +132,19 @@ static protected function EventListenerReturn OnOverrideItemUnequipBehavior(Obje
local XComGameState_Item ItemState;
local X2EquipmentTemplate EquipmentTemplate;

`LWTRACE("OverrideItemUnequipBehavior : Starting listener.");
OverrideTuple = XComLWTuple(EventData);
if(OverrideTuple == none)
{
`REDSCREEN("OverrideItemUnequipBehavior event triggered with invalid event data.");
return ELR_NoInterrupt;
}
`LWTRACE("OverrideItemUnequipBehavior : Parsed XComLWTuple.");

ItemState = XComGameState_Item(EventSource);
if(ItemState == none)
{
`REDSCREEN("OverrideItemUnequipBehavior event triggered with invalid source data.");
return ELR_NoInterrupt;
}
`LWTRACE("OverrideItemUnequipBehavior : EventSource valid.");

if(OverrideTuple.Id != 'OverrideItemUnequipBehavior')
return ELR_NoInterrupt;
Expand Down Expand Up @@ -367,10 +364,10 @@ static function EventListenerReturn OnOverridePersonnelStatusTime(Object EventDa

static function EventListenerReturn OnShouldShowPsi(Object EventData, Object EventSource, XComGameState NewGameState, Name InEventID, Object CallbackData)
{
local XComLWTuple Tuple;
local XComGameState_Unit UnitState;
local XComGameState_Unit UnitState;
local LWTuple Tuple;

Tuple = XComLWTuple(EventData);
Tuple = LWTuple(EventData);
if (Tuple == none)
{
`REDSCREEN("OnShouldShowPsi event triggered with invalid event data.");
Expand Down Expand Up @@ -821,8 +818,15 @@ static function EventListenerReturn OnOverrideAbilityIconColor(Object EventData,
return ELR_NoInterrupt;
}

// First check that we are colouring the action icons
if (!class'LWTemplateMods'.default.USE_ACTION_ICON_COLORS ||
class'Helpers_LW'.static.IsModInstalled("WOTC_CostBasedAbilityColors"))
{
return ELR_NoInterrupt;
}

// Easy handling of abilities that target objectives
if (OverrideTuple.Data[0].b && class'LWTemplateMods'.default.USE_ACTION_ICON_COLORS)
if (OverrideTuple.Data[0].b)
{
OverrideTuple.Data[1].s = class'LWTemplateMods'.default.ICON_COLOR_OBJECTIVE;
return ELR_NoInterrupt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,6 @@ simulated function string GetMissionIconImage(XComGameState_MissionSite MissionS

if (class'Utilities_LW'.static.GetMissionSettings(MissionSite, MissionSettings))
{
`LWTrace(" >> Mission icon path = " $ MissionSettings.MissionIconPath);
return MissionSettings.MissionIconPath;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ function bool Update(XComGameState NewGameState)

if (class'X2StrategyGameRulesetDataStructures'.static.LessThan(NextUpdateTime, `STRATEGYRULES.GameTime))
{
`LWTrace(" >>>>> Net global vigilance = " $ GetNetVigilance());
//`LOG("Alien Activity Manager : Updating, CurrentTime=" $
//class'X2StrategyGameRulesetDataStructures'.static.GetTimeString(`STRATEGYRULES.GameTime) $ ":" $ class'X2StrategyGameRulesetDataStructures'.static.GetDateString(`STRATEGYRULES.GameTime) $
//", NextUpdateTime=" $ class'X2StrategyGameRulesetDataStructures'.static.GetTimeString(NextUpdateTime) $ ":" $ class'X2StrategyGameRulesetDataStructures'.static.GetDateString(NextUpdateTime));
Expand Down

0 comments on commit 83455ec

Please sign in to comment.