Classes

Concepts

Libraries

Objects

contractor »

conversationAnswerData »

engineStatData »

issueData »

playerPlatformSpecialistData »

projectReviewConclusion »

projectReviewRemark »

randomEventData »

statusIcon »

fillInteractionComboBox

Description

Abstract. Called when clicking on the UI element that displays this data.

Arguments

1 guiElementInstance combobox

the combobox element which can be filled up via :addOption.

2 guiElementInstance uiElement

the clicked event box UI element.

Example

-- taken from game/studio/studio.lua


function studio.financeReportCallback()
	game.createFinancesPopup()
end

eventBoxText:registerNew({
	id = "monthly_expenses",
	getText = function(self, data)
		if data.employeeCosts > 0 and data.monthlyCosts > 0 then
			local employeeText = data.employeeCount > 1 and _T("EMPLOYEES_LOWERCASE", "employees") or _T("EMPLOYEE_LOWERCASE", "employee")
			
			return _format(_T("MONTHLY_EXPENSES_EMPLOYEES_AND_OFFICE", "New month, paid $TOTAL_SALARIES to EMPLOYEE_COUNT EMPLOYEES and $MONTHLY_COST for various office expenses."), "TOTAL_SALARIES", string.roundtobignumber(data.employeeCosts), "EMPLOYEE_COUNT", data.employeeCount, "EMPLOYEES", employeeText, "MONTHLY_COST", string.roundtobignumber(data.monthlyCosts))
		elseif data.employeeCosts > 0 then
			local employeeText = data.employeeCount > 1 and _T("EMPLOYEES_LOWERCASE", "employees") or _T("EMPLOYEE_LOWERCASE", "employee")
			
			return _format(_T("MONTHLY_EXPENSES_EMPLOYEES", "New month, paid $TOTAL_SALARIES to EMPLOYEE_COUNT EMPLOYEES."), "TOTAL_SALARIES", string.roundtobignumber(data.employeeCosts), "EMPLOYEE_COUNT", data.employeeCount, "EMPLOYEES", employeeText)
		elseif data.monthlyCosts > 0 then
			return _format(_T("MONTHLY_EXPENSES_OFFICE", "New month, paid $MONTHLY_COST for various office expenses."), "MONTHLY_COST", string.roundtobignumber(data.monthlyCosts))
		end
	end,
	fillInteractionComboBox = function(self, comboBox, uiElement)		
		comboBox:addOption(0, 0, 0, 20, _T("FINANCES_REPORT", "Finance report"), fonts.get("pix20"), studio.financeReportCallback)
	end
})