Skip to content

Commit

Permalink
Add staff levels and pon changes edit pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Alberth289346 committed Sep 7, 2023
1 parent 6869416 commit b0e80b3
Show file tree
Hide file tree
Showing 2 changed files with 162 additions and 2 deletions.
115 changes: 113 additions & 2 deletions CorsixTH/Lua/dialogs/resizables/level_editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,35 @@ function UILevelEditor:_makeTownLevelssEditPage()
})
end

function UILevelEditor:_makePopulationEditPage()
local popn_col1 = {
_makeValue({level_cfg_path = "gbv.popn[0].Month"}),
_makeValue({level_cfg_path = "gbc.popn[1].Month"}),
_makeValue({level_cfg_path = "gbc.popn[2].Month"}),
}
local popn_col2 = {
_makeValue({level_cfg_path = "gbv.popn[0].Change"}),
_makeValue({level_cfg_path = "gbc.popn[1].Change"}),
_makeValue({level_cfg_path = "gbc.popn[2].Change"}),
}
local popn_row_names = {
"level_editor.popn.row_names.gbv.popn[0]",
"level_editor.popn.row_names.gbv.popn[1]",
"level_editor.popn.row_names.gbv.popn[2]",
}
local popn_col_names = {
"level_editor.popn.col_names.gbv.popn.month",
"level_editor.popn.col_names.gbv.popn.change",
}

return _makeTableSection({
title_path = "level_editor.titles.popn",
row_names = popn_row_names,
col_values = {popn_col1, popn_col2},
col_names = popn_col_names
})
end

function UILevelEditor:_makeHospitalEditPage1()
local research_section = _makeValuesSection({
title_path = "level_editor.titles.research",
Expand Down Expand Up @@ -347,7 +376,7 @@ function UILevelEditor:_makeHospitalEditPage2()
})
end

function UILevelEditor:_makeStaffEditPage1()
function UILevelEditor:_makeStaffEditPage()
local min_salaries_section = _makeValuesSection({
title_path = "level_editor.titles.min_salaries",
title_size = _TITLE_SIZE,
Expand Down Expand Up @@ -378,6 +407,85 @@ function UILevelEditor:_makeStaffEditPage1()
})
end

function UILevelEditor:_makeStaffLevelsEditPage12()
local staff_levels_row_names = {}
local staff_levels_col_month = {}
local staff_levels_col_nurses = {}
local staff_levels_col_doctors = {}
local staff_levels_col_handymen = {}
local staff_levels_col_receptionist = {}
local staff_levels_col_psychs_rate = {}
local staff_levels_col_surgs_rate = {}
local staff_levels_col_researchs_rate = {}
local staff_levels_col_consults_rate = {}
local staff_levels_col_juniors_rate = {}

for i = 0, 8 do
staff_levels_row_names[i + 1] = "level_editor.staff_levels.row_names[" .. i .. "]"

staff_levels_col_month[i + 1] =
_makeValue({level_cfg_path = "staff_levels[" .. i .. "].Month"})
staff_levels_col_nurses[i + 1] =
_makeValue({level_cfg_path = "staff_levels[" .. i .. "].Nurses"})
staff_levels_col_doctors[i + 1] =
_makeValue({level_cfg_path = "staff_levels[" .. i .. "].Doctors"})
staff_levels_col_handymen[i + 1] =
_makeValue({level_cfg_path = "staff_levels[" .. i .. "].Handymen"})
staff_levels_col_receptionist[i + 1] =
_makeValue({level_cfg_path = "staff_levels[" .. i .. "].Receptionists"})
staff_levels_col_psychs_rate[i + 1] =
_makeValue({level_cfg_path = "staff_levels[" .. i .. "].ShrkRate"})
staff_levels_col_surgs_rate[i + 1] =
_makeValue({level_cfg_path = "staff_levels[" .. i .. "].SurgRate"})
staff_levels_col_researchs_rate[i +
1] = _makeValue({level_cfg_path = "staff_levels[" .. i .. "].RschRate"})
staff_levels_col_consults_rate[i +
1] = _makeValue({level_cfg_path = "staff_levels[" .. i .. "].ConsRate"})
staff_levels_col_juniors_rate[i +
1] = _makeValue({level_cfg_path = "staff_levels[" .. i .. "].JrRate"})
end

local staff_levels1 = _makeTableSection({
title_path = "level_editor.titles.staff_level1",
col_names = {
"level_editor.staff_levels.col_names.Month",
"level_editor.staff_levels.col_names.Nurses",
"level_editor.staff_levels.col_names.Doctors",
"level_editor.staff_levels.col_names.Handymen",
"level_editor.staff_levels.col_names.Receptionists"
},
row_names = staff_levels_row_names,
col_values = {staff_levels_col_month, staff_levels_col_nurses,
staff_levels_col_doctors, staff_levels_col_handymen,
staff_levels_col_receptionist}
})
staff_levels1 = _makeEditPageSection({
tab_name_path = "level_editor.tab_names.staff_level1",
staff_levels1
})

local staff_levels2 = _makeTableSection({
title_path = "level_editor.titles.staff_level2",
col_names = {
"level_editor.staff_levels.col_names.ShrkRate",
"level_editor.staff_levels.col_names.SurgRate",
"level_editor.staff_levels.col_names.RschRate",
"level_editor.staff_levels.col_names.ConsRate",
"level_editor.staff_levels.col_names.JrRate"
},
row_names = staff_levels_row_names,
col_values = {staff_levels_col_psychs_rate, staff_levels_col_surgs_rate,
staff_levels_col_researchs_rate, staff_levels_col_consults_rate,
staff_levels_col_juniors_rate}
})
staff_levels2 = _makeEditPageSection({
tab_name_path = "level_editor.tab_names.staff_level2",
staff_levels2
})

return staff_levels1, staff_levels2
end

function UILevelEditor:_makeRoomsCostEditPage()
local rooms_cost_edit_section = _makeValuesSection({
title_path = "level_editor.titles.rooms_cost",
Expand Down Expand Up @@ -444,11 +552,14 @@ function UILevelEditor:_makeGlobalAwardsTrophiesEditPage()
end

function UILevelEditor:_makeMainTabPage()
local staff_levels1, staff_levels2 = self:_makeStaffLevelsEditPage12()

return _makeTabPageSection({
self:_makeTownEditPage(),
self:_makeTownLevelssEditPage(),
self:_makePopulationEditPage(),
self:_makeHospitalEditPage1(), self:_makeHospitalEditPage2(),
self:_makeStaffEditPage1(),
self:_makeStaffEditPage(), staff_levels1, staff_levels2,
self:_makeRoomsCostEditPage(),
self:_makeGlobalAwardsTrophiesEditPage(),
})
Expand Down
49 changes: 49 additions & 0 deletions CorsixTH/Lua/languages/english.lua
Original file line number Diff line number Diff line change
Expand Up @@ -917,13 +917,59 @@ map_editor_window = {
}

level_editor = {
popn = {
col_names = {
gbv = {
popn = {
change = "Rate of change",
month = "Start month"
}
}
},
row_names = {
gbv = {
popn = {
[0] = "Change 1",
[1] = "Change 2",
[2] = "Change 3"
}
}
}
},
staff_levels = {
col_names = {
ConsRate = "Rate of consultants",
Doctors = "Nr doctors",
Handymen = "Nr handymen",
JrRate = "Rate of juniors",
Month = "Month",
Nurses = "Nr nurses",
Receptionists = "Nr receptionists",
RschRate = "Rate of researchers",
ShrkRate = "Rate of psychiatrists",
SurgRate = "Rate of surgeons"
},
row_names = {
[0] = "Period 1",
[1] = "Period 2",
[2] = "Period 3",
[3] = "Period 4",
[4] = "Period 5",
[5] = "Period 6",
[6] = "Period 7",
[7] = "Period 8",
[8] = "Period 9"
}
},
tab_names = {
global_awards_trophies = "Global prizes",
hospital1 = "Hospital 1",
hospital2 = "Hospital 2",
local_town = "Town",
rooms_cost = "Rooms cost",
staff1 = "Staff-1",
staff_level1 = "Staff levels",
staff_level2 = "Rates of specialists",
town_levels = "Town levels"
},
titles = {
Expand All @@ -933,8 +979,11 @@ level_editor = {
local_town = "Local Town section",
medical_bonuses = "Additional salaries for medical staff",
min_salaries = "Minimum staff salaries",
popn = "Population changes",
research = "Research settings",
rooms_cost = "Rooms cost",
staff_level1 = "Staff levels",
staff_level2 = "Specialist rates",
town_levels = "Town levels",
training = "Training settings"
},
Expand Down

0 comments on commit b0e80b3

Please sign in to comment.