Skip to content

Commit f666a63

Browse files
Merge branch 'browncoat-mission' of https://github.com/cortex-command-community/Cortex-Command-Community-Project into browncoat-mission
2 parents 351897f + 0ddeadb commit f666a63

File tree

16 files changed

+447
-9
lines changed

16 files changed

+447
-9
lines changed

CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5252

5353
- New `MOSprite` INI and Lua (R/W) integer property `ForcedHFlip` which forces a certain flippedness and disallows anything else from ever changing it without clearing the forced value first. 0 is forced not flipped, 1 forced flipped, and -1 is no force.
5454

55+
- New hotkey bindings.
56+
On Mouse+KB PC the defaults are: Weapon Primary Hotkey on V, Weapon Auxiliary Hotkey on H, Actor Primary Hotkey on X, Actor Auxiliary Hotkey on O.
57+
Added new `Controller` states `WEAPON_PRIMARY_HOTKEYSTART`, `WEAPON_AUXILIARY_HOTKEYSTART`, `ACTOR_PRIMARY_HOTKEYSTART`, `ACTOR_AUXILIARY_HOTKEYSTART`, `WEAPON_PRIMARY_HOTKEY`, `WEAPON_AUXILIARY_HOTKEY`, `ACTOR_PRIMARY_HOTKEY`, `ACTOR_AUXILIARY_HOTKEY`
58+
59+
- New hotkey system for `Actor` and `HeldDevice`.
60+
Pressing a certain new hotkey will mark it as activated on `Actor` and `HeldDevice`, letting scripts make use of the new bindings easily.
61+
`Enum` binding for `HeldDevice.HeldDeviceHotkeyType`: `PRIMARY = 0, AUXILIARY = 1, HELDDEVICEHOTKEYTYPECOUNT = 2`.
62+
`Enum` binding for `Actor.ActorHotkeyType`: `PRIMARY = 0, AUXILIARY = 1, ACTORHOTKEYTYPECOUNT = 2`.
63+
Both `Actor` and `HeldDevice` have the following functions:
64+
`HotkeyActionIsActivated(hotkeyType)` returns whether a certain hotkey action is being activated or not.
65+
`ActivateHotkeyAction(hotkeyType)` activates a certain hotkey action.
66+
`DeactivateHotkeyAction(hotkeyType)` deactivates a certain hotkey action.
67+
5568
- Allow lua scripts to use LuaJIT's BitOp module (see https://bitop.luajit.org/api.html)
5669

5770
</details>
@@ -61,7 +74,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6174
- Improved navigation, making running and fast walkpaths much more consistent.
6275

6376
- Increased fog-of-war resolution in all vanilla activities, and conquest, from 20x20 to 4x4.
64-
The Ronin Scrambler, the basic scanner, and `SceneMan:CastUnseenRay` have been changed to accomodate fog-of-war resolutions as fine as 1x1 and as course as 20x20.
77+
The Ronin Scrambler, the basic scanner, and `SceneMan:CastUnseenRay` have been changed to accomodate fog-of-war resolutions as fine as 1x1 and as coarse as 20x20.
6578
The fog-of-war revealing code is now multithreaded to increase performance.
6679

6780
- All vanilla scenario activities have had their settings polished, respecting settings which make sense and disabling settings which don't.

Data/Base.rte/GUIs/SettingsGUI.ini

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2522,6 +2522,126 @@ Anchor = Left, Top
25222522
ToolTip = None
25232523
Text = [InputKey]
25242524

2525+
[LabelInputName31]
2526+
ControlType = LABEL
2527+
Parent = CollectionBoxScrollingMappingBox
2528+
X = 215
2529+
Y = 380
2530+
Width = 110
2531+
Height = 20
2532+
Visible = True
2533+
Enabled = True
2534+
Name = LabelInputName31
2535+
Anchor = Left, Top
2536+
ToolTip = None
2537+
Text = InputName
2538+
HAlignment = right
2539+
VAlignment = middle
2540+
2541+
[ButtonInputKey31]
2542+
ControlType = BUTTON
2543+
Parent = CollectionBoxScrollingMappingBox
2544+
X = 330
2545+
Y = 380
2546+
Width = 95
2547+
Height = 20
2548+
Visible = True
2549+
Enabled = True
2550+
Name = ButtonInputKey31
2551+
Anchor = Left, Top
2552+
ToolTip = None
2553+
Text = [InputKey]
2554+
2555+
[LabelInputName32]
2556+
ControlType = LABEL
2557+
Parent = CollectionBoxScrollingMappingBox
2558+
X = 215
2559+
Y = 380
2560+
Width = 110
2561+
Height = 20
2562+
Visible = True
2563+
Enabled = True
2564+
Name = LabelInputName32
2565+
Anchor = Left, Top
2566+
ToolTip = None
2567+
Text = InputName
2568+
HAlignment = right
2569+
VAlignment = middle
2570+
2571+
[ButtonInputKey32]
2572+
ControlType = BUTTON
2573+
Parent = CollectionBoxScrollingMappingBox
2574+
X = 330
2575+
Y = 380
2576+
Width = 95
2577+
Height = 20
2578+
Visible = True
2579+
Enabled = True
2580+
Name = ButtonInputKey32
2581+
Anchor = Left, Top
2582+
ToolTip = None
2583+
Text = [InputKey]
2584+
2585+
[LabelInputName33]
2586+
ControlType = LABEL
2587+
Parent = CollectionBoxScrollingMappingBox
2588+
X = 215
2589+
Y = 380
2590+
Width = 110
2591+
Height = 20
2592+
Visible = True
2593+
Enabled = True
2594+
Name = LabelInputName33
2595+
Anchor = Left, Top
2596+
ToolTip = None
2597+
Text = InputName
2598+
HAlignment = right
2599+
VAlignment = middle
2600+
2601+
[ButtonInputKey33]
2602+
ControlType = BUTTON
2603+
Parent = CollectionBoxScrollingMappingBox
2604+
X = 330
2605+
Y = 380
2606+
Width = 95
2607+
Height = 20
2608+
Visible = True
2609+
Enabled = True
2610+
Name = ButtonInputKey33
2611+
Anchor = Left, Top
2612+
ToolTip = None
2613+
Text = [InputKey]
2614+
2615+
[LabelInputName34]
2616+
ControlType = LABEL
2617+
Parent = CollectionBoxScrollingMappingBox
2618+
X = 215
2619+
Y = 380
2620+
Width = 110
2621+
Height = 20
2622+
Visible = True
2623+
Enabled = True
2624+
Name = LabelInputName34
2625+
Anchor = Left, Top
2626+
ToolTip = None
2627+
Text = InputName
2628+
HAlignment = right
2629+
VAlignment = middle
2630+
2631+
[ButtonInputKey34]
2632+
ControlType = BUTTON
2633+
Parent = CollectionBoxScrollingMappingBox
2634+
X = 330
2635+
Y = 380
2636+
Width = 95
2637+
Height = 20
2638+
Visible = True
2639+
Enabled = True
2640+
Name = ButtonInputKey34
2641+
Anchor = Left, Top
2642+
ToolTip = None
2643+
Text = [InputKey]
2644+
25252645
[CollectionBoxInputCapture]
25262646
ControlType = COLLECTIONBOX
25272647
Parent = root

Data/Base.rte/GUIs/SettingsPauseGUI.ini

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2523,6 +2523,126 @@ Anchor = Left, Top
25232523
ToolTip = None
25242524
Text = [InputKey]
25252525

2526+
[LabelInputName31]
2527+
ControlType = LABEL
2528+
Parent = CollectionBoxScrollingMappingBox
2529+
X = 215
2530+
Y = 380
2531+
Width = 110
2532+
Height = 20
2533+
Visible = True
2534+
Enabled = True
2535+
Name = LabelInputName31
2536+
Anchor = Left, Top
2537+
ToolTip = None
2538+
Text = InputName
2539+
HAlignment = right
2540+
VAlignment = middle
2541+
2542+
[ButtonInputKey31]
2543+
ControlType = BUTTON
2544+
Parent = CollectionBoxScrollingMappingBox
2545+
X = 330
2546+
Y = 380
2547+
Width = 95
2548+
Height = 20
2549+
Visible = True
2550+
Enabled = True
2551+
Name = ButtonInputKey31
2552+
Anchor = Left, Top
2553+
ToolTip = None
2554+
Text = [InputKey]
2555+
2556+
[LabelInputName32]
2557+
ControlType = LABEL
2558+
Parent = CollectionBoxScrollingMappingBox
2559+
X = 215
2560+
Y = 380
2561+
Width = 110
2562+
Height = 20
2563+
Visible = True
2564+
Enabled = True
2565+
Name = LabelInputName32
2566+
Anchor = Left, Top
2567+
ToolTip = None
2568+
Text = InputName
2569+
HAlignment = right
2570+
VAlignment = middle
2571+
2572+
[ButtonInputKey32]
2573+
ControlType = BUTTON
2574+
Parent = CollectionBoxScrollingMappingBox
2575+
X = 330
2576+
Y = 380
2577+
Width = 95
2578+
Height = 20
2579+
Visible = True
2580+
Enabled = True
2581+
Name = ButtonInputKey32
2582+
Anchor = Left, Top
2583+
ToolTip = None
2584+
Text = [InputKey]
2585+
2586+
[LabelInputName33]
2587+
ControlType = LABEL
2588+
Parent = CollectionBoxScrollingMappingBox
2589+
X = 215
2590+
Y = 380
2591+
Width = 110
2592+
Height = 20
2593+
Visible = True
2594+
Enabled = True
2595+
Name = LabelInputName33
2596+
Anchor = Left, Top
2597+
ToolTip = None
2598+
Text = InputName
2599+
HAlignment = right
2600+
VAlignment = middle
2601+
2602+
[ButtonInputKey33]
2603+
ControlType = BUTTON
2604+
Parent = CollectionBoxScrollingMappingBox
2605+
X = 330
2606+
Y = 380
2607+
Width = 95
2608+
Height = 20
2609+
Visible = True
2610+
Enabled = True
2611+
Name = ButtonInputKey33
2612+
Anchor = Left, Top
2613+
ToolTip = None
2614+
Text = [InputKey]
2615+
2616+
[LabelInputName34]
2617+
ControlType = LABEL
2618+
Parent = CollectionBoxScrollingMappingBox
2619+
X = 215
2620+
Y = 380
2621+
Width = 110
2622+
Height = 20
2623+
Visible = True
2624+
Enabled = True
2625+
Name = LabelInputName34
2626+
Anchor = Left, Top
2627+
ToolTip = None
2628+
Text = InputName
2629+
HAlignment = right
2630+
VAlignment = middle
2631+
2632+
[ButtonInputKey34]
2633+
ControlType = BUTTON
2634+
Parent = CollectionBoxScrollingMappingBox
2635+
X = 330
2636+
Y = 380
2637+
Width = 95
2638+
Height = 20
2639+
Visible = True
2640+
Enabled = True
2641+
Name = ButtonInputKey34
2642+
Anchor = Left, Top
2643+
ToolTip = None
2644+
Text = [InputKey]
2645+
25262646
[CollectionBoxInputCapture]
25272647
ControlType = COLLECTIONBOX
25282648
Parent = root

Data/Browncoats.rte/Actors/Turrets/Thunderer/ThundererGun.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function OnFire(self)
2-
CameraMan:AddScreenShake(7, self.Pos);
2+
CameraMan:AddScreenShake(12, self.Pos);
33

44
local shot = self.Shot:Clone();
55
shot.Pos = self.MuzzlePos;

Source/Entities/ACrab.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -963,6 +963,11 @@ void ACrab::PreControllerUpdate() {
963963
} else {
964964
mountedDevice->Deactivate();
965965
}
966+
if (m_Controller.IsState(WEAPON_PRIMARY_HOTKEY)) {
967+
mountedDevice->ActivateHotkeyAction(HeldDeviceHotkeyType::PRIMARYHOTKEY);
968+
} else {
969+
mountedDevice->DeactivateHotkeyAction(HeldDeviceHotkeyType::PRIMARYHOTKEY);
970+
}
966971
}
967972
}
968973

Source/Entities/AHuman.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1824,6 +1824,17 @@ void AHuman::PreControllerUpdate() {
18241824
m_pFGArm->AddHandTarget("Adjusted Aim Angle", m_Pos + Vector(m_pFGArm->GetMaxLength() * GetFlipFactor(), -m_pFGArm->GetMaxLength() * 0.5F).RadRotate(adjustedAimAngle));
18251825
}
18261826
}
1827+
// Hotkey activations
1828+
if (m_Controller.IsState(WEAPON_PRIMARY_HOTKEY)) {
1829+
device->ActivateHotkeyAction(HeldDeviceHotkeyType::PRIMARYHOTKEY);
1830+
} else {
1831+
device->DeactivateHotkeyAction(HeldDeviceHotkeyType::PRIMARYHOTKEY);
1832+
}
1833+
if (m_Controller.IsState(WEAPON_AUXILIARY_HOTKEY)) {
1834+
device->ActivateHotkeyAction(HeldDeviceHotkeyType::AUXILIARYHOTKEY);
1835+
} else {
1836+
device->DeactivateHotkeyAction(HeldDeviceHotkeyType::AUXILIARYHOTKEY);
1837+
}
18271838
} else if (m_ArmsState == THROWING_RELEASE && m_ThrowTmr.GetElapsedSimTimeMS() > 100) {
18281839
if (m_pFGArm) {
18291840
m_pFGArm->SetHeldDevice(dynamic_cast<HeldDevice*>(SwapNextInventory()));
@@ -1873,6 +1884,17 @@ void AHuman::PreControllerUpdate() {
18731884
m_SharpAimProgress = 0;
18741885
device->SetSharpAim(m_SharpAimProgress);
18751886
}
1887+
// Hotkey activations
1888+
if (m_Controller.IsState(WEAPON_PRIMARY_HOTKEY)) {
1889+
device->ActivateHotkeyAction(HeldDeviceHotkeyType::PRIMARYHOTKEY);
1890+
} else {
1891+
device->DeactivateHotkeyAction(HeldDeviceHotkeyType::PRIMARYHOTKEY);
1892+
}
1893+
if (m_Controller.IsState(WEAPON_AUXILIARY_HOTKEY)) {
1894+
device->ActivateHotkeyAction(HeldDeviceHotkeyType::AUXILIARYHOTKEY);
1895+
} else {
1896+
device->DeactivateHotkeyAction(HeldDeviceHotkeyType::AUXILIARYHOTKEY);
1897+
}
18761898
} else {
18771899
m_CanActivateBGItem = false;
18781900
}

Source/Entities/Actor.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ void Actor::Clear() {
9999
m_Inventory.clear();
100100
m_MaxInventoryMass = -1.0F;
101101
m_pItemInReach = nullptr;
102+
m_HotkeyActivated.fill(false);
102103
m_HUDStack = 0;
103104
m_DeploymentID = 0;
104105
m_PassengerSlots = 1;
@@ -258,6 +259,7 @@ int Actor::Create(const Actor& reference) {
258259

259260
m_sIconsLoaded = true;
260261
}
262+
m_HotkeyActivated = reference.m_HotkeyActivated;
261263
m_DeploymentID = reference.m_DeploymentID;
262264
m_PassengerSlots = reference.m_PassengerSlots;
263265

@@ -1278,6 +1280,18 @@ void Actor::Update() {
12781280
g_FrameMan.FlashScreen(g_ActivityMan.GetActivity()->ScreenOfPlayer(brainOfPlayer), g_WhiteColor, 500);
12791281
}
12801282
}
1283+
1284+
if (m_Controller.IsState(ACTOR_PRIMARY_HOTKEY)) {
1285+
ActivateHotkeyAction(PRIMARYHOTKEY);
1286+
} else {
1287+
DeactivateHotkeyAction(PRIMARYHOTKEY);
1288+
}
1289+
1290+
if (m_Controller.IsState(ACTOR_AUXILIARY_HOTKEY)) {
1291+
ActivateHotkeyAction(AUXILIARYHOTKEY);
1292+
} else {
1293+
DeactivateHotkeyAction(AUXILIARYHOTKEY);
1294+
}
12811295
}
12821296

12831297
void RTE::Actor::CastSeeRays() {

0 commit comments

Comments
 (0)