2016-05-04 19:24:41 +02:00
|
|
|
/*****************************************************************************
|
2020-07-21 15:04:34 +02:00
|
|
|
* Copyright (c) 2014-2020 OpenRCT2 developers
|
2016-05-04 19:24:41 +02:00
|
|
|
*
|
2018-06-15 14:07:34 +02:00
|
|
|
* For a complete list of all authors, please refer to contributors.md
|
|
|
|
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
2016-05-04 19:24:41 +02:00
|
|
|
*
|
2018-06-15 14:07:34 +02:00
|
|
|
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
2016-05-04 19:24:41 +02:00
|
|
|
*****************************************************************************/
|
2014-10-07 20:39:52 +02:00
|
|
|
|
2017-10-16 00:13:22 +02:00
|
|
|
#include <limits>
|
2018-06-22 23:21:44 +02:00
|
|
|
#include <openrct2-ui/interface/Dropdown.h>
|
|
|
|
#include <openrct2-ui/interface/Viewport.h>
|
|
|
|
#include <openrct2-ui/interface/Widget.h>
|
2017-08-12 23:06:12 +02:00
|
|
|
#include <openrct2-ui/windows/Window.h>
|
2017-09-06 16:09:35 +02:00
|
|
|
#include <openrct2/Context.h>
|
2017-11-30 18:17:06 +01:00
|
|
|
#include <openrct2/Game.h>
|
2017-12-12 14:52:57 +01:00
|
|
|
#include <openrct2/Input.h>
|
Split actions hpp files into separate h and cpp files (#13548)
* Split up SmallSceneryPlace/Remove
Added undo function for Remove Scenery
* Refactor: Balloon and Banner actions hpp=>h/cpp
* Refactor: rename all action *.hpp files to *.cpp
This is preparation for separation in later commits. Note that without
the complete set of commits in this branch, the code will not build.
* Refactor Clear, Climate, Custom, and Footpath actions hpp=>h/cpp
* VSCode: add src subdirectories to includePath
* Refactor Guest actions hpp=>h/cpp
* Refactor Land actions hpp=>h/cpp
* Refactor LargeScenery actions hpp=>h/cpp
* Refactor Load, Maze, Network actions hpp=>h/cpp
* Refactor Park actions hpp=>h/cpp
* Refactor/style: move private function declarations in actions *.h
Previous action .h files included private function declarations with
private member variables, before public function declarations. This
commit re-orders the header files to the following order:
- public member variables
- private member variables
- public functions
- private functions
* Refactor Pause action hpp=>h/cpp
* Refactor Peep, Place, Player actions hpp=>h/cpp
* Refactor Ride actions hpp=>h/cpp
* Refactor Scenario, Set*, Sign* actions hpp=>h/cpp
* Refactor SmallScenerySetColourAction hpp=>h/cpp
* Refactor Staff actions hpp=>h/cpp
* Refactor Surface, Tile, Track* actions hpp=>h/cpp
* Refactor Wall and Water actions hpp=>h/cpp
* Fix various includes and other compile errors
Update includes for tests.
Move static function declarations to .h files
Add explicit includes to various files that were previously implicit
(the required header was a nested include in an action hpp file, and the
action .h file does not include that header)
Move RideSetStatus string enum to the cpp file to avoid unused imports
* Xcode: modify project file for actions refactor
* Cleanup whitespace and end-of-file newlines
Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2020-12-10 07:39:10 +01:00
|
|
|
#include <openrct2/actions/StaffFireAction.h>
|
|
|
|
#include <openrct2/actions/StaffSetColourAction.h>
|
2018-06-22 23:21:44 +02:00
|
|
|
#include <openrct2/config/Config.h>
|
|
|
|
#include <openrct2/drawing/Drawing.h>
|
2018-01-06 18:32:25 +01:00
|
|
|
#include <openrct2/localisation/Localisation.h>
|
2018-06-22 23:21:44 +02:00
|
|
|
#include <openrct2/management/Finance.h>
|
2017-10-13 10:06:36 +02:00
|
|
|
#include <openrct2/peep/Staff.h>
|
2017-09-18 17:05:28 +02:00
|
|
|
#include <openrct2/sprites.h>
|
2017-12-13 13:02:24 +01:00
|
|
|
#include <openrct2/util/Util.h>
|
2018-06-22 23:21:44 +02:00
|
|
|
#include <openrct2/windows/Intent.h>
|
2018-01-11 10:59:26 +01:00
|
|
|
#include <openrct2/world/Footpath.h>
|
2018-03-19 23:28:40 +01:00
|
|
|
#include <openrct2/world/Park.h>
|
2018-06-22 23:21:44 +02:00
|
|
|
#include <openrct2/world/Sprite.h>
|
2020-03-28 13:12:53 +01:00
|
|
|
#include <vector>
|
2014-10-07 20:39:52 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
enum
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
WINDOW_STAFF_LIST_TAB_HANDYMEN,
|
|
|
|
WINDOW_STAFF_LIST_TAB_MECHANICS,
|
|
|
|
WINDOW_STAFF_LIST_TAB_SECURITY,
|
|
|
|
WINDOW_STAFF_LIST_TAB_ENTERTAINERS
|
2017-08-02 00:20:32 +02:00
|
|
|
};
|
2014-10-07 20:39:52 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
enum WINDOW_STAFF_LIST_WIDGET_IDX
|
2020-09-28 20:36:15 +02:00
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
WIDX_STAFF_LIST_BACKGROUND,
|
|
|
|
WIDX_STAFF_LIST_TITLE,
|
|
|
|
WIDX_STAFF_LIST_CLOSE,
|
|
|
|
WIDX_STAFF_LIST_TAB_CONTENT_PANEL,
|
|
|
|
WIDX_STAFF_LIST_HANDYMEN_TAB,
|
|
|
|
WIDX_STAFF_LIST_MECHANICS_TAB,
|
|
|
|
WIDX_STAFF_LIST_SECURITY_TAB,
|
|
|
|
WIDX_STAFF_LIST_ENTERTAINERS_TAB,
|
|
|
|
WIDX_STAFF_LIST_LIST,
|
|
|
|
WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER,
|
|
|
|
WIDX_STAFF_LIST_HIRE_BUTTON,
|
|
|
|
WIDX_STAFF_LIST_QUICK_FIRE,
|
|
|
|
WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON,
|
|
|
|
WIDX_STAFF_LIST_MAP,
|
2014-10-07 20:39:52 +02:00
|
|
|
};
|
|
|
|
|
2020-05-05 22:26:14 +02:00
|
|
|
static constexpr const rct_string_id WINDOW_TITLE = STR_STAFF;
|
2020-05-09 17:05:01 +02:00
|
|
|
static constexpr const int32_t WW = 320;
|
|
|
|
static constexpr const int32_t WH = 270;
|
2019-10-24 05:38:13 +02:00
|
|
|
constexpr int32_t MAX_WW = 500;
|
|
|
|
constexpr int32_t MAX_WH = 450;
|
2016-01-09 11:32:28 +01:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
// clang-format off
|
2014-10-07 20:39:52 +02:00
|
|
|
static rct_widget window_staff_list_widgets[] = {
|
2020-05-09 16:44:21 +02:00
|
|
|
WINDOW_SHIM(WINDOW_TITLE, WW, WH),
|
2020-11-27 04:14:20 +01:00
|
|
|
MakeWidget({ 0, 43}, { WW, WH - 43}, WindowWidgetType::Resize, WindowColour::Secondary ), // tab content panel
|
2020-08-29 04:31:31 +02:00
|
|
|
MakeTab ({ 3, 17}, STR_STAFF_HANDYMEN_TAB_TIP ), // handymen tab
|
|
|
|
MakeTab ({ 34, 17}, STR_STAFF_MECHANICS_TAB_TIP ), // mechanics tab
|
|
|
|
MakeTab ({ 65, 17}, STR_STAFF_SECURITY_TAB_TIP ), // security guards tab
|
|
|
|
MakeTab ({ 96, 17}, STR_STAFF_ENTERTAINERS_TAB_TIP), // entertainers tab
|
2020-11-27 04:14:20 +01:00
|
|
|
MakeWidget({ 3, 72}, {WW - 6, 195}, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_VERTICAL ), // staff list
|
|
|
|
MakeWidget({130, 58}, { 12, 12}, WindowWidgetType::ColourBtn, WindowColour::Secondary, STR_NONE, STR_UNIFORM_COLOUR_TIP ), // uniform colour picker
|
|
|
|
MakeWidget({165, 17}, { 145, 13}, WindowWidgetType::Button, WindowColour::Primary , STR_NONE, STR_HIRE_STAFF_TIP ), // hire button
|
|
|
|
MakeWidget({243, 46}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_DEMOLISH, STR_QUICK_FIRE_STAFF ), // quick fire staff
|
|
|
|
MakeWidget({267, 46}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_PATROL_BTN, STR_SHOW_PATROL_AREA_TIP ), // show staff patrol area tool
|
|
|
|
MakeWidget({291, 46}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_MAP, STR_SHOW_STAFF_ON_MAP_TIP ), // show staff on map button
|
2017-06-06 23:24:18 +02:00
|
|
|
{ WIDGETS_END },
|
2014-10-07 20:39:52 +02:00
|
|
|
};
|
2018-05-16 20:41:29 +02:00
|
|
|
// clang-format on
|
2016-07-14 14:07:49 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
class StaffListWindow final : public Window
|
2014-10-07 20:39:52 +02:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
private:
|
|
|
|
struct StaffNamingConvention
|
|
|
|
{
|
|
|
|
rct_string_id Plural;
|
|
|
|
rct_string_id Singular;
|
|
|
|
rct_string_id ActionHire;
|
|
|
|
};
|
|
|
|
|
|
|
|
std::vector<uint16_t> _staffList;
|
|
|
|
bool _quickFireMode{};
|
|
|
|
std::optional<size_t> _highlightedIndex{};
|
|
|
|
int32_t _selectedTab{};
|
|
|
|
uint32_t _tabAnimationIndex{};
|
|
|
|
|
|
|
|
public:
|
|
|
|
void OnOpen() override
|
|
|
|
{
|
|
|
|
widgets = window_staff_list_widgets;
|
|
|
|
enabled_widgets = (1 << WIDX_STAFF_LIST_CLOSE) | (1 << WIDX_STAFF_LIST_HANDYMEN_TAB)
|
|
|
|
| (1 << WIDX_STAFF_LIST_MECHANICS_TAB) | (1 << WIDX_STAFF_LIST_SECURITY_TAB)
|
|
|
|
| (1 << WIDX_STAFF_LIST_ENTERTAINERS_TAB) | (1 << WIDX_STAFF_LIST_HIRE_BUTTON)
|
|
|
|
| (1 << WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER) | (1 << WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON)
|
|
|
|
| (1 << WIDX_STAFF_LIST_MAP) | (1 << WIDX_STAFF_LIST_QUICK_FIRE);
|
|
|
|
WindowInitScrollWidgets(this);
|
|
|
|
|
|
|
|
widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].type = WindowWidgetType::Empty;
|
|
|
|
min_width = WW;
|
|
|
|
min_height = WH;
|
|
|
|
max_width = MAX_WW;
|
|
|
|
max_height = MAX_WH;
|
|
|
|
|
|
|
|
RefreshList();
|
|
|
|
}
|
2014-10-07 20:39:52 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
void OnClose() override
|
2020-03-28 13:12:53 +01:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
CancelTools();
|
2020-03-28 13:12:53 +01:00
|
|
|
}
|
2020-06-10 18:54:34 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
void OnMouseUp(rct_widgetindex widgetIndex) override
|
2020-03-28 13:12:53 +01:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
switch (widgetIndex)
|
|
|
|
{
|
|
|
|
case WIDX_STAFF_LIST_CLOSE:
|
|
|
|
Close();
|
|
|
|
break;
|
|
|
|
case WIDX_STAFF_LIST_HIRE_BUTTON:
|
|
|
|
{
|
|
|
|
auto staffType = GetSelectedStaffType();
|
|
|
|
auto costume = EntertainerCostume::Count;
|
|
|
|
if (staffType == StaffType::Entertainer)
|
|
|
|
{
|
|
|
|
costume = GetRandomEntertainerCostume();
|
|
|
|
}
|
|
|
|
staff_hire_new_member(staffType, costume);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON:
|
|
|
|
if (!tool_set(this, WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON, Tool::Crosshair))
|
|
|
|
{
|
|
|
|
show_gridlines();
|
|
|
|
gStaffDrawPatrolAreas = _selectedTab | 0x8000;
|
|
|
|
gfx_invalidate_screen();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WIDX_STAFF_LIST_MAP:
|
|
|
|
context_open_window(WC_MAP);
|
|
|
|
break;
|
|
|
|
case WIDX_STAFF_LIST_QUICK_FIRE:
|
|
|
|
_quickFireMode = !_quickFireMode;
|
|
|
|
Invalidate();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2020-03-28 13:12:53 +01:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
void OnResize() override
|
|
|
|
{
|
|
|
|
min_width = WW;
|
|
|
|
min_height = WH;
|
|
|
|
if (width < min_width)
|
|
|
|
{
|
|
|
|
width = min_width;
|
|
|
|
Invalidate();
|
|
|
|
}
|
|
|
|
if (height < min_height)
|
|
|
|
{
|
|
|
|
height = min_height;
|
|
|
|
Invalidate();
|
|
|
|
}
|
2020-03-28 13:12:53 +01:00
|
|
|
}
|
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
void OnUpdate() override
|
|
|
|
{
|
|
|
|
_tabAnimationIndex++;
|
|
|
|
if (_tabAnimationIndex >= 24)
|
|
|
|
{
|
|
|
|
_tabAnimationIndex = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
InvalidateWidget(WIDX_STAFF_LIST_HANDYMEN_TAB + _selectedTab);
|
2020-03-28 13:12:53 +01:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
// Enable highlighting of these staff members in map window
|
|
|
|
if (window_find_by_class(WC_MAP) != nullptr)
|
|
|
|
{
|
|
|
|
gWindowMapFlashingFlags |= MapFlashingFlags::StaffListOpen;
|
|
|
|
for (auto peep : EntityList<Staff>(EntityListId::Peep))
|
|
|
|
{
|
|
|
|
sprite_set_flashing(peep, false);
|
|
|
|
if (peep->AssignedStaffType == GetSelectedStaffType())
|
|
|
|
{
|
|
|
|
sprite_set_flashing(peep, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-10-07 20:39:52 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
// Note this may be slow if number of staff increases a large amount.
|
|
|
|
// See GuestList for fix (more intents) if required.
|
|
|
|
RefreshList();
|
|
|
|
}
|
2014-10-07 20:39:52 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
void OnMouseDown(rct_widgetindex widgetIndex) override
|
2017-06-06 23:24:18 +02:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
switch (widgetIndex)
|
2017-06-06 23:24:18 +02:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
case WIDX_STAFF_LIST_HANDYMEN_TAB:
|
|
|
|
case WIDX_STAFF_LIST_MECHANICS_TAB:
|
|
|
|
case WIDX_STAFF_LIST_SECURITY_TAB:
|
|
|
|
case WIDX_STAFF_LIST_ENTERTAINERS_TAB:
|
2018-06-22 23:21:44 +02:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
auto newSelectedTab = widgetIndex - WIDX_STAFF_LIST_HANDYMEN_TAB;
|
|
|
|
if (_selectedTab != newSelectedTab)
|
|
|
|
{
|
|
|
|
_selectedTab = static_cast<uint8_t>(newSelectedTab);
|
|
|
|
Invalidate();
|
|
|
|
scrolls[0].v_top = 0;
|
|
|
|
CancelTools();
|
|
|
|
}
|
|
|
|
break;
|
2018-06-22 23:21:44 +02:00
|
|
|
}
|
2021-01-25 22:57:06 +01:00
|
|
|
case WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER:
|
|
|
|
WindowDropdownShowColour(this, &widgets[widgetIndex], colours[1], staff_get_colour(GetSelectedStaffType()));
|
|
|
|
break;
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
}
|
2014-10-07 20:39:52 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
void OnDropdown(rct_widgetindex widgetIndex, int32_t dropdownIndex) override
|
2018-06-22 23:21:44 +02:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
if (widgetIndex == WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER)
|
|
|
|
{
|
|
|
|
auto action = StaffSetColourAction(GetSelectedStaffType(), dropdownIndex);
|
|
|
|
GameActions::Execute(&action);
|
|
|
|
}
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2021-01-25 22:57:06 +01:00
|
|
|
|
|
|
|
void OnPrepareDraw() override
|
2018-06-22 23:21:44 +02:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
// Set selected tab
|
|
|
|
SetWidgetPressed(WIDX_STAFF_LIST_HANDYMEN_TAB, false);
|
|
|
|
SetWidgetPressed(WIDX_STAFF_LIST_MECHANICS_TAB, false);
|
|
|
|
SetWidgetPressed(WIDX_STAFF_LIST_SECURITY_TAB, false);
|
|
|
|
SetWidgetPressed(WIDX_STAFF_LIST_ENTERTAINERS_TAB, false);
|
|
|
|
SetWidgetPressed(_selectedTab + WIDX_STAFF_LIST_HANDYMEN_TAB, true);
|
2014-10-07 20:39:52 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
widgets[WIDX_STAFF_LIST_HIRE_BUTTON].text = GetStaffNamingConvention(GetSelectedStaffType()).ActionHire;
|
|
|
|
widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].type = WindowWidgetType::Empty;
|
2017-06-06 23:24:18 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
if (GetSelectedStaffType() != StaffType::Entertainer)
|
|
|
|
{
|
|
|
|
widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].type = WindowWidgetType::ColourBtn;
|
|
|
|
auto spriteIdPalette = SPRITE_ID_PALETTE_COLOUR_1(static_cast<uint32_t>(staff_get_colour(GetSelectedStaffType())));
|
|
|
|
widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].image = spriteIdPalette | IMAGE_TYPE_TRANSPARENT | SPR_PALETTE_BTN;
|
|
|
|
}
|
|
|
|
SetWidgetPressed(WIDX_STAFF_LIST_QUICK_FIRE, _quickFireMode);
|
|
|
|
|
|
|
|
widgets[WIDX_STAFF_LIST_BACKGROUND].right = width - 1;
|
|
|
|
widgets[WIDX_STAFF_LIST_BACKGROUND].bottom = height - 1;
|
|
|
|
widgets[WIDX_STAFF_LIST_TAB_CONTENT_PANEL].right = width - 1;
|
|
|
|
widgets[WIDX_STAFF_LIST_TAB_CONTENT_PANEL].bottom = height - 1;
|
|
|
|
widgets[WIDX_STAFF_LIST_TITLE].right = width - 2;
|
|
|
|
widgets[WIDX_STAFF_LIST_CLOSE].left = width - 2 - 11;
|
|
|
|
widgets[WIDX_STAFF_LIST_CLOSE].right = width - 2 - 11 + 10;
|
|
|
|
widgets[WIDX_STAFF_LIST_LIST].right = width - 4;
|
|
|
|
widgets[WIDX_STAFF_LIST_LIST].bottom = height - 15;
|
|
|
|
widgets[WIDX_STAFF_LIST_QUICK_FIRE].left = width - 77;
|
|
|
|
widgets[WIDX_STAFF_LIST_QUICK_FIRE].right = width - 54;
|
|
|
|
widgets[WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON].left = width - 53;
|
|
|
|
widgets[WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON].right = width - 30;
|
|
|
|
widgets[WIDX_STAFF_LIST_MAP].left = width - 29;
|
|
|
|
widgets[WIDX_STAFF_LIST_MAP].right = width - 6;
|
|
|
|
widgets[WIDX_STAFF_LIST_HIRE_BUTTON].left = width - 155;
|
|
|
|
widgets[WIDX_STAFF_LIST_HIRE_BUTTON].right = width - 11;
|
|
|
|
}
|
|
|
|
|
|
|
|
void OnDraw(rct_drawpixelinfo& dpi) override
|
2018-06-22 23:21:44 +02:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
DrawWidgets(dpi);
|
|
|
|
DrawTabImages(dpi);
|
2018-08-13 14:05:52 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
if (!(gParkFlags & PARK_FLAGS_NO_MONEY))
|
|
|
|
{
|
|
|
|
auto ft = Formatter();
|
|
|
|
ft.Add<money32>(GetStaffWage(GetSelectedStaffType()));
|
|
|
|
gfx_draw_string_left(
|
|
|
|
&dpi, STR_COST_PER_MONTH, ft.Data(), COLOUR_BLACK, windowPos + ScreenCoordsXY{ width - 155, 32 });
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GetSelectedStaffType() != StaffType::Entertainer)
|
|
|
|
{
|
|
|
|
gfx_draw_string_left(
|
|
|
|
&dpi, STR_UNIFORM_COLOUR, nullptr, COLOUR_BLACK,
|
|
|
|
windowPos + ScreenCoordsXY{ 6, widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].top + 1 });
|
|
|
|
}
|
|
|
|
|
|
|
|
auto namingConvention = GetStaffNamingConvention(GetSelectedStaffType());
|
|
|
|
auto staffTypeStringId = _staffList.size() == 1 ? namingConvention.Singular : namingConvention.Plural;
|
|
|
|
|
|
|
|
auto ft = Formatter();
|
|
|
|
ft.Add<uint16_t>(_staffList.size());
|
|
|
|
ft.Add<rct_string_id>(staffTypeStringId);
|
|
|
|
|
|
|
|
gfx_draw_string_left(
|
|
|
|
&dpi, STR_STAFF_LIST_COUNTER, ft.Data(), COLOUR_BLACK,
|
|
|
|
windowPos + ScreenCoordsXY{ 4, widgets[WIDX_STAFF_LIST_LIST].bottom + 2 });
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2014-10-07 20:39:52 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
ScreenSize OnScrollGetSize(int32_t scrollIndex) override
|
2018-03-16 13:56:15 +01:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
if (_highlightedIndex)
|
|
|
|
{
|
|
|
|
_highlightedIndex = {};
|
|
|
|
Invalidate();
|
|
|
|
}
|
|
|
|
|
|
|
|
auto scrollHeight = static_cast<int16_t>(_staffList.size()) * SCROLLABLE_ROW_HEIGHT;
|
|
|
|
auto i = scrollHeight - widgets[WIDX_STAFF_LIST_LIST].bottom + widgets[WIDX_STAFF_LIST_LIST].top + 21;
|
|
|
|
if (i < 0)
|
|
|
|
i = 0;
|
|
|
|
if (i < scrolls[0].v_top)
|
|
|
|
{
|
|
|
|
scrolls[0].v_top = i;
|
|
|
|
Invalidate();
|
|
|
|
}
|
|
|
|
|
|
|
|
auto scrollWidth = widgets[WIDX_STAFF_LIST_LIST].width() - 15;
|
|
|
|
return { scrollWidth, scrollHeight };
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2014-10-07 20:39:52 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override
|
2018-06-22 23:21:44 +02:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
auto i = static_cast<size_t>(screenCoords.y / SCROLLABLE_ROW_HEIGHT);
|
|
|
|
if (i != _highlightedIndex)
|
|
|
|
{
|
|
|
|
_highlightedIndex = static_cast<size_t>(i);
|
|
|
|
Invalidate();
|
|
|
|
}
|
2018-06-22 23:21:44 +02:00
|
|
|
}
|
2017-06-06 23:24:18 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override
|
|
|
|
{
|
|
|
|
int32_t i = screenCoords.y / SCROLLABLE_ROW_HEIGHT;
|
|
|
|
for (auto spriteIndex : _staffList)
|
2018-06-22 23:21:44 +02:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
if (i == 0)
|
2018-06-22 23:21:44 +02:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
if (_quickFireMode)
|
2018-06-22 23:21:44 +02:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
auto staffFireAction = StaffFireAction(spriteIndex);
|
|
|
|
GameActions::Execute(&staffFireAction);
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2021-01-25 22:57:06 +01:00
|
|
|
else
|
|
|
|
{
|
|
|
|
auto peep = GetEntity<Staff>(spriteIndex);
|
|
|
|
if (peep != nullptr)
|
|
|
|
{
|
|
|
|
auto intent = Intent(WC_PEEP);
|
|
|
|
intent.putExtra(INTENT_EXTRA_PEEP, peep);
|
|
|
|
context_open_intent(&intent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2021-01-25 22:57:06 +01:00
|
|
|
|
|
|
|
i--;
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
}
|
2020-03-28 13:12:53 +01:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
void OnScrollDraw(int32_t scrollIndex, rct_drawpixelinfo& dpi) override
|
2018-06-22 23:21:44 +02:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
auto dpiCoords = ScreenCoordsXY{ dpi.x, dpi.y };
|
|
|
|
gfx_fill_rect(
|
|
|
|
&dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width - 1, dpi.height - 1 } }, ColourMapA[colours[1]].mid_light);
|
|
|
|
|
|
|
|
// How much space do we have for the name and action columns? (Discount scroll area and icons.)
|
|
|
|
const int32_t nonIconSpace = widgets[WIDX_STAFF_LIST_LIST].width() - 15 - 68;
|
|
|
|
const int32_t nameColumnSize = nonIconSpace * 0.42;
|
|
|
|
const int32_t actionColumnSize = nonIconSpace * 0.58;
|
|
|
|
const int32_t actionOffset = widgets[WIDX_STAFF_LIST_LIST].right - actionColumnSize - 15;
|
|
|
|
|
|
|
|
auto y = 0;
|
|
|
|
size_t i = 0;
|
|
|
|
for (auto spriteIndex : _staffList)
|
|
|
|
{
|
|
|
|
if (y > dpi.y + dpi.height)
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
2017-06-06 23:24:18 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
if (y + 11 >= dpi.y)
|
|
|
|
{
|
|
|
|
auto peep = GetEntity<Staff>(spriteIndex);
|
|
|
|
if (peep == nullptr)
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
int32_t format = (_quickFireMode ? STR_RED_STRINGID : STR_BLACK_STRING);
|
2017-06-06 23:24:18 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
if (i == _highlightedIndex)
|
|
|
|
{
|
|
|
|
gfx_filter_rect(&dpi, 0, y, 800, y + (SCROLLABLE_ROW_HEIGHT - 1), FilterPaletteID::PaletteDarken1);
|
|
|
|
format = (_quickFireMode ? STR_LIGHTPINK_STRINGID : STR_WINDOW_COLOUR_2_STRINGID);
|
|
|
|
}
|
2017-06-06 23:24:18 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
auto ft = Formatter();
|
|
|
|
peep->FormatNameTo(ft);
|
|
|
|
DrawTextEllipsised(&dpi, { 0, y }, nameColumnSize, format, ft, COLOUR_BLACK);
|
2020-06-10 18:54:34 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
ft = Formatter();
|
|
|
|
peep->FormatActionTo(ft);
|
|
|
|
DrawTextEllipsised(&dpi, { actionOffset, y }, actionColumnSize, format, ft, COLOUR_BLACK);
|
2017-06-06 23:24:18 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
// True if a patrol path is set for the worker
|
|
|
|
if (gStaffModes[peep->StaffId] == StaffMode::Patrol)
|
2018-06-22 23:21:44 +02:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
gfx_draw_sprite(&dpi, SPR_STAFF_PATROL_PATH, { nameColumnSize + 5, y }, 0);
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2021-01-25 22:57:06 +01:00
|
|
|
|
|
|
|
auto staffOrderIcon_x = nameColumnSize + 20;
|
|
|
|
if (peep->AssignedStaffType != StaffType::Entertainer)
|
2018-06-22 23:21:44 +02:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
auto staffOrders = peep->StaffOrders;
|
|
|
|
auto staffOrderSprite = GetStaffOrderBaseSprite(GetSelectedStaffType());
|
|
|
|
|
|
|
|
while (staffOrders != 0)
|
|
|
|
{
|
|
|
|
if (staffOrders & 1)
|
|
|
|
{
|
|
|
|
gfx_draw_sprite(&dpi, staffOrderSprite, { staffOrderIcon_x, y }, 0);
|
|
|
|
}
|
|
|
|
staffOrders = staffOrders >> 1;
|
|
|
|
staffOrderIcon_x += 9;
|
|
|
|
// TODO: Remove sprite ID addition
|
|
|
|
staffOrderSprite++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gfx_draw_sprite(&dpi, GetEntertainerCostumeSprite(peep->SpriteType), { staffOrderIcon_x, y }, 0);
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
y += SCROLLABLE_ROW_HEIGHT;
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void OnToolDown(rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords) override
|
|
|
|
{
|
|
|
|
if (widgetIndex == WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON)
|
|
|
|
{
|
|
|
|
auto closestStaffMember = GetClosestStaffMemberTo(screenCoords);
|
|
|
|
if (closestStaffMember != nullptr)
|
2018-06-22 23:21:44 +02:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
tool_cancel();
|
|
|
|
auto* staffWindow = window_staff_open(closestStaffMember);
|
|
|
|
window_event_dropdown_call(staffWindow, WC_PEEP__WIDX_PATROL, 0);
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2021-01-25 22:57:06 +01:00
|
|
|
else
|
2018-06-22 23:21:44 +02:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
auto ft = Formatter();
|
|
|
|
ft.Add<rct_string_id>(GetStaffNamingConvention(GetSelectedStaffType()).Plural);
|
|
|
|
context_show_error(STR_NO_THING_IN_PARK_YET, STR_NONE, ft);
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
}
|
2021-01-25 22:57:06 +01:00
|
|
|
}
|
2017-06-06 23:24:18 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
void OnToolAbort(rct_widgetindex widgetIndex) override
|
|
|
|
{
|
|
|
|
if (widgetIndex == WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON)
|
2018-06-22 23:21:44 +02:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
hide_gridlines();
|
2017-06-06 23:24:18 +02:00
|
|
|
tool_cancel();
|
2021-01-25 22:57:06 +01:00
|
|
|
gStaffDrawPatrolAreas = 0xFFFF;
|
|
|
|
gfx_invalidate_screen();
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
}
|
2015-07-10 02:39:16 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
void RefreshList()
|
2018-06-22 23:21:44 +02:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
_staffList.clear();
|
2017-06-06 23:24:18 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
for (auto peep : EntityList<Staff>(EntityListId::Peep))
|
2018-06-22 23:21:44 +02:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
sprite_set_flashing(peep, false);
|
|
|
|
if (peep->AssignedStaffType == GetSelectedStaffType())
|
2019-03-16 21:45:52 +01:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
sprite_set_flashing(peep, true);
|
|
|
|
_staffList.push_back(peep->sprite_index);
|
2019-03-16 21:45:52 +01:00
|
|
|
}
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
std::sort(
|
|
|
|
_staffList.begin(), _staffList.end(), [](const uint16_t a, const uint16_t b) { return peep_compare(a, b) < 0; });
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2014-10-07 20:39:52 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
private:
|
|
|
|
StaffType GetSelectedStaffType() const
|
2018-06-22 23:21:44 +02:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
return static_cast<StaffType>(_selectedTab);
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2014-10-07 20:39:52 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
void DrawTabImages(rct_drawpixelinfo& dpi) const
|
2018-06-22 23:21:44 +02:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
DrawTabImage(dpi, WINDOW_STAFF_LIST_TAB_HANDYMEN, PeepSpriteType::Handyman, gStaffHandymanColour);
|
|
|
|
DrawTabImage(dpi, WINDOW_STAFF_LIST_TAB_MECHANICS, PeepSpriteType::Mechanic, gStaffMechanicColour);
|
|
|
|
DrawTabImage(dpi, WINDOW_STAFF_LIST_TAB_SECURITY, PeepSpriteType::Security, gStaffSecurityColour);
|
|
|
|
DrawTabImage(dpi, WINDOW_STAFF_LIST_TAB_ENTERTAINERS, PeepSpriteType::EntertainerElephant);
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2014-10-07 20:39:52 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
void DrawTabImage(rct_drawpixelinfo& dpi, int32_t tabIndex, PeepSpriteType type, colour_t colour) const
|
2018-06-22 23:21:44 +02:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
auto widgetIndex = WIDX_STAFF_LIST_HANDYMEN_TAB + tabIndex;
|
|
|
|
const auto& widget = widgets[widgetIndex];
|
|
|
|
auto imageId = (_selectedTab == tabIndex ? (_tabAnimationIndex & ~3) : 0);
|
|
|
|
imageId += GetPeepAnimation(type).base_image + 1;
|
|
|
|
imageId |= SPRITE_ID_PALETTE_COLOUR_1(colour);
|
|
|
|
gfx_draw_sprite(&dpi, imageId, windowPos + ScreenCoordsXY{ (widget.left + widget.right) / 2, widget.bottom - 6 }, 0);
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
void DrawTabImage(rct_drawpixelinfo& dpi, int32_t tabIndex, PeepSpriteType type) const
|
2018-06-22 23:21:44 +02:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
auto widgetIndex = WIDX_STAFF_LIST_HANDYMEN_TAB + tabIndex;
|
|
|
|
const auto& widget = widgets[widgetIndex];
|
|
|
|
rct_drawpixelinfo clippedDpi;
|
|
|
|
if (clip_drawpixelinfo(
|
|
|
|
&clippedDpi, &dpi, windowPos + ScreenCoordsXY{ widget.left + 1, widget.top + 1 },
|
|
|
|
widget.right - widget.left - 1, widget.bottom - widget.top - 1))
|
|
|
|
{
|
|
|
|
auto imageId = (_selectedTab == 3 ? (_tabAnimationIndex & ~3) : 0);
|
|
|
|
imageId += GetPeepAnimation(type).base_image + 1;
|
|
|
|
gfx_draw_sprite(&clippedDpi, imageId, { 15, 23 }, 0);
|
|
|
|
}
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
void CancelTools()
|
2018-06-22 23:21:44 +02:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE))
|
|
|
|
{
|
|
|
|
if (classification == gCurrentToolWidget.window_classification && number == gCurrentToolWidget.window_number)
|
|
|
|
{
|
|
|
|
tool_cancel();
|
|
|
|
}
|
|
|
|
}
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
Peep* GetClosestStaffMemberTo(const ScreenCoordsXY& screenCoords)
|
2018-06-22 23:21:44 +02:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
int32_t direction{};
|
|
|
|
TileElement* tileElement{};
|
|
|
|
auto footpathCoords = footpath_get_coordinates_from_pos(screenCoords, &direction, &tileElement);
|
|
|
|
if (footpathCoords.isNull())
|
|
|
|
return nullptr;
|
2016-07-28 23:21:01 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
auto isPatrolAreaSet = staff_is_patrol_area_set_for_type(GetSelectedStaffType(), footpathCoords);
|
2016-07-28 23:21:01 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
Peep* closestPeep = nullptr;
|
|
|
|
auto closestPeepDistance = std::numeric_limits<int32_t>::max();
|
|
|
|
for (auto peep : EntityList<Staff>(EntityListId::Peep))
|
2018-06-02 13:06:38 +02:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
if (peep->AssignedStaffType != GetSelectedStaffType())
|
|
|
|
continue;
|
2017-06-06 23:24:18 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
if (isPatrolAreaSet)
|
2020-07-26 18:42:02 +02:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
if (gStaffModes[peep->StaffId] != StaffMode::Patrol)
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
2021-02-21 13:23:31 +01:00
|
|
|
if (!peep->IsLocationInPatrol(footpathCoords))
|
2021-01-25 22:57:06 +01:00
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
2020-07-26 18:42:02 +02:00
|
|
|
}
|
2020-03-29 23:00:28 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
if (peep->x == LOCATION_NULL)
|
2018-06-02 13:06:38 +02:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
continue;
|
2020-03-29 23:00:28 +02:00
|
|
|
}
|
2017-06-06 23:24:18 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
auto distance = std::abs(footpathCoords.x - peep->x) + std::abs(footpathCoords.y - peep->y);
|
|
|
|
if (distance < closestPeepDistance)
|
2020-03-29 23:00:28 +02:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
closestPeepDistance = distance;
|
|
|
|
closestPeep = peep;
|
2020-03-29 23:00:28 +02:00
|
|
|
}
|
2021-01-25 22:57:06 +01:00
|
|
|
}
|
|
|
|
return closestPeep;
|
|
|
|
}
|
2017-06-06 23:24:18 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
static EntertainerCostume GetRandomEntertainerCostume()
|
|
|
|
{
|
|
|
|
auto result = EntertainerCostume::Panda;
|
|
|
|
EntertainerCostume costumeList[static_cast<uint8_t>(EntertainerCostume::Count)];
|
|
|
|
int32_t numCostumes = staff_get_available_entertainer_costume_list(costumeList);
|
|
|
|
if (numCostumes > 0)
|
|
|
|
{
|
|
|
|
int32_t index = util_rand() % numCostumes;
|
|
|
|
result = costumeList[index];
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
2017-06-06 23:24:18 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
static constexpr StaffNamingConvention GetStaffNamingConvention(StaffType type)
|
|
|
|
{
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
default:
|
|
|
|
case StaffType::Handyman:
|
|
|
|
return { STR_HANDYMAN_PLURAL, STR_HANDYMAN_SINGULAR, STR_HIRE_HANDYMAN };
|
|
|
|
case StaffType::Mechanic:
|
|
|
|
return { STR_MECHANIC_PLURAL, STR_MECHANIC_SINGULAR, STR_HIRE_MECHANIC };
|
|
|
|
case StaffType::Security:
|
|
|
|
return { STR_SECURITY_GUARD_PLURAL, STR_SECURITY_GUARD_SINGULAR, STR_HIRE_SECURITY_GUARD };
|
|
|
|
case StaffType::Entertainer:
|
|
|
|
return { STR_ENTERTAINER_PLURAL, STR_ENTERTAINER_SINGULAR, STR_HIRE_ENTERTAINER };
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2021-01-25 22:57:06 +01:00
|
|
|
}
|
2020-03-29 23:00:28 +02:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
static uint32_t GetStaffOrderBaseSprite(StaffType type)
|
|
|
|
{
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case StaffType::Handyman:
|
|
|
|
return SPR_STAFF_ORDERS_SWEEPING;
|
|
|
|
case StaffType::Mechanic:
|
|
|
|
return SPR_STAFF_ORDERS_INSPECT_RIDES;
|
|
|
|
default:
|
|
|
|
return 0;
|
|
|
|
}
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2021-01-25 22:57:06 +01:00
|
|
|
|
|
|
|
static uint32_t GetEntertainerCostumeSprite(PeepSpriteType type)
|
|
|
|
{
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
default:
|
|
|
|
case PeepSpriteType::EntertainerPanda:
|
|
|
|
return SPR_STAFF_COSTUME_PANDA;
|
|
|
|
case PeepSpriteType::EntertainerTiger:
|
|
|
|
return SPR_STAFF_COSTUME_TIGER;
|
|
|
|
case PeepSpriteType::EntertainerElephant:
|
|
|
|
return SPR_STAFF_COSTUME_ELEPHANT;
|
|
|
|
case PeepSpriteType::EntertainerRoman:
|
|
|
|
return SPR_STAFF_COSTUME_ROMAN;
|
|
|
|
case PeepSpriteType::EntertainerGorilla:
|
|
|
|
return SPR_STAFF_COSTUME_GORILLA;
|
|
|
|
case PeepSpriteType::EntertainerSnowman:
|
|
|
|
return SPR_STAFF_COSTUME_SNOWMAN;
|
|
|
|
case PeepSpriteType::EntertainerKnight:
|
|
|
|
return SPR_STAFF_COSTUME_KNIGHT;
|
|
|
|
case PeepSpriteType::EntertainerAstronaut:
|
|
|
|
return SPR_STAFF_COSTUME_ASTRONAUT;
|
|
|
|
case PeepSpriteType::EntertainerBandit:
|
|
|
|
return SPR_STAFF_COSTUME_BANDIT;
|
|
|
|
case PeepSpriteType::EntertainerSheriff:
|
|
|
|
return SPR_STAFF_COSTUME_SHERIFF;
|
|
|
|
case PeepSpriteType::EntertainerPirate:
|
|
|
|
return SPR_STAFF_COSTUME_PIRATE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
rct_window* window_staff_list_open()
|
|
|
|
{
|
|
|
|
return WindowFocusOrCreate<StaffListWindow>(WC_STAFF_LIST, WW, WH, WF_10 | WF_RESIZABLE);
|
2015-05-12 16:13:30 +02:00
|
|
|
}
|
2017-01-24 13:48:46 +01:00
|
|
|
|
2021-01-25 22:57:06 +01:00
|
|
|
void WindowStaffListRefresh()
|
2017-01-24 13:48:46 +01:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
auto* window = window_find_by_class(WC_STAFF_LIST);
|
2021-01-26 01:17:34 +01:00
|
|
|
if (window != nullptr)
|
2017-06-06 23:24:18 +02:00
|
|
|
{
|
2021-01-25 22:57:06 +01:00
|
|
|
static_cast<StaffListWindow*>(window)->RefreshList();
|
2017-06-06 23:24:18 +02:00
|
|
|
}
|
2017-01-24 13:48:46 +01:00
|
|
|
}
|