Skip to content

Commit 3917113

Browse files
committed
Merge branch 'development' into multithreading-ai
2 parents 345c999 + a775233 commit 3917113

File tree

5 files changed

+3870
-9
lines changed

5 files changed

+3870
-9
lines changed

Data/Base.rte/Devices/Shared/Scripts/GrenadeBandolierAttachable.lua

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ local replenishGrenade = function(self, forceEquipGrenade)
2222
if forceEquipGrenade or self.grenadeReplenishDelay < 100 then
2323
self:modifyGrenadeCount(-1);
2424
self.rootParent.UpperBodyState = AHuman.WEAPON_READY;
25-
-- Only actually equip the grenade if the root parent was previously holding one, or we're forcing it to equip it. This avoids issues when, for example, removing a grenade from the root paren'ts inventory via Lua.
25+
-- Only actually equip the grenade if the root parent was previously holding one, or we're forcing it to equip it. This avoids issues when, for example, removing a grenade from the root parent's inventory via Lua.
2626
return (forceEquipGrenade or self.grenadePreviouslyHeldByRootParent) and self.rootParent:EquipNamedDevice(self.grenadeTech, self.grenadeName, true);
2727
else
2828
self.grenadeReplenishGUITimer:Reset();
@@ -91,7 +91,7 @@ function Create(self)
9191
end
9292

9393
function Update(self)
94-
if self.rootParent and self.rootParent.Health > 0 and MovableMan:IsActor(self.rootParent) then
94+
if self.rootParent and self.rootParent.Health > 0 and MovableMan:ValidMO(self.rootParent) then
9595
local rootParentEquippedItemModuleAndPresetName = self.rootParent.EquippedItem ~= nil and self.rootParent.EquippedItem:GetModuleAndPresetName() or nil;
9696
local rootParentIsHoldingGrenade = rootParentEquippedItemModuleAndPresetName == self.grenadeObject:GetModuleAndPresetName();
9797

@@ -154,16 +154,37 @@ function Update(self)
154154
end
155155

156156
function Destroy(self)
157-
if self.rootParent and MovableMan:IsActor(self.rootParent) then
157+
if self.rootParent and MovableMan:ValidMO(self.rootParent) then
158158
self.rootParent:RemoveNumberValue(self.bandolierKey);
159159
end
160160
if self.currentGrenadeCount > 0 then
161+
local bandolierPosition = self.Pos;
162+
local bandolierVel = self.Vel;
163+
local bandolierRotAngle = self.RotAngle;
164+
local bandolierAngularVel = self.AngularVel;
165+
161166
if self.grenadePreviouslyHeldByRootParent then
162-
self.grenadePreviouslyHeldByRootParent.ToDelete = true;
167+
if MovableMan:ValidMO(self.grenadePreviouslyHeldByRootParent) and not self.grenadePreviouslyHeldByRootParent:IsActivated() then
168+
self.grenadePreviouslyHeldByRootParent.ToDelete = true;
169+
self:modifyGrenadeCount(1);
170+
171+
bandolierPosition = self.grenadePreviouslyHeldByRootParent.Pos;
172+
bandolierVel = self.grenadePreviouslyHeldByRootParent.Vel;
173+
bandolierRotAngle = self.grenadePreviouslyHeldByRootParent.RotAngle;
174+
bandolierAngularVel = self.grenadePreviouslyHeldByRootParent.AngularVel;
175+
end
176+
end
177+
if self.currentGrenadeCount > 0 then
178+
self.bandolierObjectForDropping:SetNumberValue("GrenadesRemainingInBandolier", self.currentGrenadeCount);
179+
180+
self.bandolierObjectForDropping.Pos = bandolierPosition;
181+
self.bandolierObjectForDropping.Vel = bandolierVel;
182+
self.bandolierObjectForDropping.RotAngle = bandolierRotAngle;
183+
self.bandolierObjectForDropping.AngularVel = bandolierAngularVel;
184+
185+
self.bandolierObjectForDropping.Mass = self.bandolierMass + (self.grenadeMass * self.currentGrenadeCount);
186+
187+
MovableMan:AddItem(self.bandolierObjectForDropping);
163188
end
164-
self.bandolierObjectForDropping:SetNumberValue("GrenadesRemainingInBandolier", self.currentGrenadeCount + 1);
165-
self.bandolierObjectForDropping.Pos = self.Pos;
166-
self.bandolierObjectForDropping.Mass = self.bandolierMass + (self.grenadeMass * self.currentGrenadeCount);
167-
MovableMan:AddItem(self.bandolierObjectForDropping);
168189
end
169190
end

Data/Base.rte/GUIs/PauseMenuGUI.ini

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
[root]
2+
ControlType = COLLECTIONBOX
3+
Parent = None
4+
X = 0
5+
Y = 0
6+
Width = 640
7+
Height = 480
8+
Visible = True
9+
Enabled = True
10+
Name = root
11+
Anchor = Left, Top
12+
ToolTip =
13+
DrawBackground = False
14+
DrawType = Image
15+
DrawColor = 0
16+
17+
[PauseScreen]
18+
ControlType = COLLECTIONBOX
19+
Parent = root
20+
X = 185
21+
Y = 140
22+
Width = 300
23+
Height = 220
24+
Visible = True
25+
Enabled = True
26+
Name = PauseScreen
27+
Anchor = Right, Bottom
28+
DrawBackground = False
29+
DrawType = Color
30+
DrawColor = 62
31+
32+
[ButtonBackToMain]
33+
ControlType = BUTTON
34+
Parent = PauseScreen
35+
X = 0
36+
Y = 0
37+
Width = 224
38+
Height = 20
39+
Visible = True
40+
Enabled = True
41+
Name = ButtonBackToMain
42+
Anchor = Left, Top
43+
Text = Back to Main Menu
44+
45+
[ButtonSaveGame]
46+
ControlType = BUTTON
47+
Parent = PauseScreen
48+
X = 0
49+
Y = 40
50+
Width = 124
51+
Height = 20
52+
Visible = True
53+
Enabled = True
54+
Name = ButtonSaveGame
55+
Anchor = Left, Top
56+
Text = Save Game
57+
58+
[ButtonLoadLastSave]
59+
ControlType = BUTTON
60+
Parent = PauseScreen
61+
X = 0
62+
Y = 60
63+
Width = 190
64+
Height = 20
65+
Visible = True
66+
Enabled = True
67+
Name = ButtonLoadLastSave
68+
Anchor = Left, Top
69+
Text = Load Last Save
70+
71+
[ButtonSettings]
72+
ControlType = BUTTON
73+
Parent = PauseScreen
74+
X = 0
75+
Y = 80
76+
Width = 114
77+
Height = 20
78+
Visible = True
79+
Enabled = True
80+
Name = ButtonSettings
81+
Anchor = Left, Top
82+
Text = Settings
83+
84+
[ButtonModManager]
85+
ControlType = BUTTON
86+
Parent = PauseScreen
87+
X = 0
88+
Y = 100
89+
Width = 160
90+
Height = 20
91+
Visible = True
92+
Enabled = True
93+
Name = ButtonModManager
94+
Anchor = Left, Top
95+
Text = Mod Manager
96+
97+
[ButtonResume]
98+
ControlType = BUTTON
99+
Parent = PauseScreen
100+
X = 0
101+
Y = 140
102+
Width = 114
103+
Height = 20
104+
Visible = True
105+
Enabled = True
106+
Name = ButtonResume
107+
Anchor = Left, Top
108+
Text = Resume

0 commit comments

Comments
 (0)