MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / CmdSetCompanyManagerFace

Function CmdSetCompanyManagerFace

src/company_cmd.cpp:1057–1070  ·  view source on GitHub ↗

* Change the company manager's face. * @param flags operation to perform * @param style The style of the company manager face. * @param bits The bits of company manager face. * @return the cost of this operation or an error */

Source from the content-addressed store, hash-verified

1055 * @return the cost of this operation or an error
1056 */
1057CommandCost CmdSetCompanyManagerFace(DoCommandFlags flags, uint style, uint32_t bits)
1058{
1059 CompanyManagerFace tmp_face{style, bits, {}};
1060 if (!IsValidCompanyManagerFace(tmp_face)) return CMD_ERROR;
1061
1062 if (flags.Test(DoCommandFlag::Execute)) {
1063 CompanyManagerFace &cmf = Company::Get(_current_company)->face;
1064 SetCompanyManagerFaceStyle(cmf, style);
1065 cmf.bits = tmp_face.bits;
1066
1067 MarkWholeScreenDirty();
1068 }
1069 return CommandCost();
1070}
1071
1072/**
1073 * Update liveries for a company. This is called when the LS_DEFAULT scheme is changed, to update schemes with colours

Callers

nothing calls this directly

Calls 5

MarkWholeScreenDirtyFunction · 0.85
CommandCostClass · 0.85
TestMethod · 0.80

Tested by

no test coverage detected