Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
2e6a659
preparations
Johannes-callidus Nov 11, 2025
6d06035
I don't know what it did but it did smth
Johannes-callidus Nov 12, 2025
2516181
enable parameter type
Johannes-callidus Nov 12, 2025
8828b1f
make latrines water model & fix display string
Johannes-callidus Nov 13, 2025
b0deaa9
Merge branch 'master' into flexible-house-models
Johannes-callidus Nov 14, 2025
de49862
luckily there is no way to see this mess of window yet; refactoring
Johannes-callidus Nov 15, 2025
2fa1c73
Merge branch 'flexible-house-models' of https://github.com/johannes-c…
Johannes-callidus Nov 15, 2025
43b553f
oops
Johannes-callidus Nov 15, 2025
4d49a3b
further refactoring
Johannes-callidus Nov 15, 2025
b586eb8
fix crash, refactoring
Johannes-callidus Nov 15, 2025
c2a2e5f
create window in theory
Johannes-callidus Nov 15, 2025
0fd0628
make window accessible
Johannes-callidus Nov 15, 2025
9fa40c4
a
Johannes-callidus Nov 16, 2025
31f6c46
stick to 640 x 480
Johannes-callidus Nov 17, 2025
eff3e25
difficult but fun
Johannes-callidus Nov 17, 2025
e9170e5
center it
Johannes-callidus Nov 18, 2025
d153c2f
center it the right way
Johannes-callidus Nov 18, 2025
e485062
new function text_draw_centered_without_bounds
Johannes-callidus Nov 18, 2025
7e4c916
only tooltips left
Johannes-callidus Nov 18, 2025
19a8d14
restrict model values1
Johannes-callidus Nov 18, 2025
bb96107
clamping the values
Johannes-callidus Nov 18, 2025
9c5fc1a
also clamp when executing
Johannes-callidus Nov 18, 2025
1c80869
formatting
Johannes-callidus Nov 18, 2025
cf99fe8
tooltips
Johannes-callidus Nov 18, 2025
5445dfd
display string
Johannes-callidus Nov 18, 2025
9dbbb5e
refactor and prepare
Johannes-callidus Nov 22, 2025
de70ee5
weird button in the middle of the screen
Johannes-callidus Nov 22, 2025
beb1885
use map_point
Johannes-callidus Nov 22, 2025
a43aefc
fix that anoying button being in the wrong place
Johannes-callidus Nov 22, 2025
627a720
mint and barracks rate & bugfixes
Johannes-callidus Nov 27, 2025
93a2e85
fix bug
Johannes-callidus Nov 27, 2025
a061112
repair cost now adjustable via model data
Johannes-callidus Dec 1, 2025
197ecd2
theory
Johannes-callidus Dec 3, 2025
cc02885
practice
Johannes-callidus Dec 3, 2025
4ea0171
fix acedental asset edit
Johannes-callidus Dec 4, 2025
5047151
fix wrong temple models again
Johannes-callidus Dec 15, 2025
a817a45
fix #1640
Johannes-callidus Dec 22, 2025
a3fab45
Merge branch 'Keriew:master' into flexible-house-models
Johannes-callidus Jan 21, 2026
6c15bb0
Merge branch 'master' into flexible-house-models
Johannes-callidus Jan 22, 2026
a86cc3b
Merge branch 'master' into flexible-house-models
Johannes-callidus Jan 25, 2026
f9f27f0
fix build
Johannes-callidus Jan 25, 2026
22da630
Merge branch 'master' into flexible-house-models
Johannes-callidus Feb 6, 2026
a1a8492
extend price and demand change cap to what it is in the events
Johannes-callidus Feb 20, 2026
17e2d8a
change goals
Johannes-callidus Feb 20, 2026
64f52ab
standartise tooltip display of actions and conditions
Johannes-callidus Feb 21, 2026
2bfe59b
whitespace
Johannes-callidus Feb 21, 2026
01a4868
Bugfix & tidy up
Johannes-callidus Feb 21, 2026
112df14
copying events (only actions yet)
Johannes-callidus Feb 22, 2026
794c345
copy events
Johannes-callidus Feb 22, 2026
eed8487
commit
Johannes-callidus Feb 27, 2026
6ce56f4
Merge branch 'master' into flexible-house-models
Johannes-callidus Mar 12, 2026
886738d
prep refactor
Johannes-callidus Mar 14, 2026
6ecdd92
Merge branch 'flexible-house-models' of https://github.com/johannes-c…
Johannes-callidus Mar 14, 2026
3a1297e
beginn refactor
Johannes-callidus Mar 17, 2026
b559eb2
Merge branch 'master' into flexible-house-models
Johannes-callidus Mar 17, 2026
6426d97
Merge branch 'master' into flexible-house-models
Johannes-callidus Mar 25, 2026
5da83a0
refactor continue
Johannes-callidus Mar 27, 2026
09553dd
Merge branch 'flexible-house-models' of https://github.com/johannes-c…
Johannes-callidus Mar 27, 2026
0feb9a6
infinte copies
Johannes-callidus Mar 29, 2026
38eb578
Merge branch 'master' into flexible-house-models
Johannes-callidus Mar 29, 2026
56497a5
Merge branch 'master' into flexible-house-models
Johannes-callidus Mar 30, 2026
e2e4882
fix saveversion
Johannes-callidus Mar 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,7 @@ set(WINDOW_FILES
${PROJECT_SOURCE_DIR}/src/window/editor/invasions.c
${PROJECT_SOURCE_DIR}/src/window/editor/map.c
${PROJECT_SOURCE_DIR}/src/window/editor/model_data.c
${PROJECT_SOURCE_DIR}/src/window/editor/house_model_data.c
${PROJECT_SOURCE_DIR}/src/window/editor/price_changes.c
${PROJECT_SOURCE_DIR}/src/window/editor/requests.c
${PROJECT_SOURCE_DIR}/src/window/editor/scenario_events.c
Expand Down
Binary file added res/assets/Graphics/UI/abstract_caret_symbol.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 10 additions & 9 deletions res/assets/Graphics/ui.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1419,13 +1419,14 @@
<image id="rightbracket_white_l" src="rightbracket_white_l"/>
<image id="curlybracket_white_left" src="curlybracket_white_left"/>
<image id="curlybracket_white_right" src="curlybracket_white_right"/>
<image src="Plus_Button_Idle" id="Plus_Button_Idle"/>
<image group="this" image="Plus_Button_Idle"/>
<image src="Plus_Button_Click"/>
<image src="Edit_Button_Idle" id="Edit_Button_Idle"/>
<image group="this" image="Edit_Button_Idle"/>
<image src="Edit_Button_Click"/>
<image src="LandWaypoint" id="LandWaypoint"/>
<image src="SeaWaypoint" id="SeaWaypoint"/>
<image src="LandWaypoint" id="BorderWaypoint"/>
<image id="abstract_caret_symbol" src="abstract_caret_symbol"/>
<image src="Plus_Button_Idle" id="Plus_Button_Idle"/>
<image group="this" image="Plus_Button_Idle"/>
<image src="Plus_Button_Click"/>
<image src="Edit_Button_Idle" id="Edit_Button_Idle"/>
<image group="this" image="Edit_Button_Idle"/>
<image src="Edit_Button_Click"/>
<image src="LandWaypoint" id="LandWaypoint"/>
<image src="SeaWaypoint" id="SeaWaypoint"/>
<image src="LandWaypoint" id="BorderWaypoint"/>
</assetlist>
1 change: 1 addition & 0 deletions src/assets/assets.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ void assets_init(int force_reload, color_t **main_images, int *main_image_widths
data.font_lookup[ASSET_FONT_SQ_BRACKET_RIGHT] = assets_get_image_id("UI", "rightbracket_white_l");
data.font_lookup[ASSET_FONT_CRLY_BRACKET_LEFT] = assets_get_image_id("UI", "curlybracket_white_left");
data.font_lookup[ASSET_FONT_CRLY_BRACKET_RIGHT] = assets_get_image_id("UI", "curlybracket_white_right");
data.font_lookup[ASSET_FONT_ABSTRACT_CARET_SYMBOL] = assets_get_image_id("UI", "abstract_caret_symbol");

}

Expand Down
1 change: 1 addition & 0 deletions src/assets/assets.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ typedef enum {
ASSET_FONT_SQ_BRACKET_RIGHT,
ASSET_FONT_CRLY_BRACKET_LEFT,
ASSET_FONT_CRLY_BRACKET_RIGHT,
ASSET_FONT_ABSTRACT_CARET_SYMBOL,
ASSET_FONT_MAX_KEY
} asset_font_id;

Expand Down
2 changes: 1 addition & 1 deletion src/building/building.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ int building_repair_cost(building *b)

if (building_is_house(og_type)) {
grid_slice *house_slice = map_grid_get_grid_slice_house(b->id, 1);
int clear_cost = house_slice->size * (11 + 3); // 10.5 per new house tile + 3 per rubble tile to clear
int clear_cost = house_slice->size * (11 + model_get_building(BUILDING_REPAIR_LAND)->cost); // 10.5 per new house tile + cost of repair land per rubble tile to clear
return clear_cost;
}
if (b->type == BUILDING_WAREHOUSE_SPACE) {
Expand Down
2 changes: 1 addition & 1 deletion src/building/construction_building.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ int building_construction_prepare_terrain(grid_slice *grid_slice, clear_mode cle
break;
}
if (map_terrain_is(g_offset, terrain_mask_to_remove)) {
total_cost += (cost == COST_FREE) ? 0 : 3; // base cost per tile is 50% more than regular clear
total_cost += (cost == COST_FREE) ? 0 : model_get_building(BUILDING_REPAIR_LAND)->cost; // base cost per tile is the cost of repair land
if (cost != COST_MEASURE) {
map_terrain_remove(g_offset, terrain_mask_to_remove);
}
Expand Down
4 changes: 1 addition & 3 deletions src/building/construction_building.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ typedef enum {
COST_FREE = -1, // perform operation for free
COST_MEASURE = 0, // measure cost only, do not perform operation
COST_PROCESS = 1 // perform operation for a cost
}cost_calculation;
} cost_calculation;
/**
* @brief Places a building of the specified type at the given coordinates
* CAREFUL: x and y are offset depending on city orientation, can cause problems with exact coordinates given
Expand Down Expand Up @@ -47,5 +47,3 @@ int building_construction_fill_vacant_lots(grid_slice *area);
int building_construction_prepare_terrain(grid_slice *grid_slice, clear_mode clear_mode, cost_calculation cost);

#endif // BUILDING_CONSTRUCTION_BUILDING_H


2 changes: 2 additions & 0 deletions src/building/figure.c
Original file line number Diff line number Diff line change
Expand Up @@ -1611,6 +1611,8 @@ static void spawn_figure_barracks(building *b)
if (city_data.mess_hall.food_stress_cumulative > 20) {
spawn_delay += city_data.mess_hall.food_stress_cumulative - 20;
}

spawn_delay = calc_adjust_with_percentage(spawn_delay, resource_get_data(RESOURCE_TROOPS)->production_per_month);

b->figure_spawn_delay++;
if (b->figure_spawn_delay > spawn_delay) {
Expand Down
40 changes: 18 additions & 22 deletions src/building/house_evolution.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,12 @@ static int has_required_goods_and_services(building *house, int for_upgrade, int
// water
int water = model->water;
if (!house->has_water_access) {
if (water >= 2) {
if (level > HOUSE_SMALL_CASA) {
++demands->missing.fountain;
return 0;
} else if (!house->has_well_access) {
++demands->missing.well;
return 0;
} else if (level > HOUSE_LARGE_SHACK && !house->has_latrines_access) {
return 0;
}
}
if (water == 1 && !house->has_well_access) {
if (water > 2) {
++demands->missing.fountain;
return 0;
} else if (water > 1 && !house->has_latrines_access) {
return 0;
} if (water == 1 && !house->has_well_access) {
++demands->missing.well;
return 0;
}
Expand Down Expand Up @@ -628,21 +622,19 @@ void building_house_determine_evolve_text(building *house, int worst_desirabilit
if (!house->has_well_access) {
house->data.house.evolve_text_id = 1;
return;
} else if (!house->has_latrines_access) {
house->data.house.evolve_text_id = 68;
return;
}
}

if (water == 2 && !house->has_water_access) {
if (!house->has_latrines_access) {
house->data.house.evolve_text_id = 67;
return;
} else if (level >= HOUSE_LARGE_CASA) {
house->data.house.evolve_text_id = 2;
return;
}
}

if (water == 3 && !house->has_water_access) {
house->data.house.evolve_text_id = 2;
}

// entertainment
int entertainment = model->entertainment;
Expand Down Expand Up @@ -788,14 +780,18 @@ void building_house_determine_evolve_text(building *house, int worst_desirabilit
if (!house->has_well_access) {
house->data.house.evolve_text_id = 31;
return;
} else if (!house->has_latrines_access) {
house->data.house.evolve_text_id = 68;
return;
}
}

if (water == 2 && !house->has_water_access) {
if (level >= HOUSE_LARGE_CASA && house->has_well_access && house->has_latrines_access) {
if (!house->has_latrines_access || !house->has_well_access) {
house->data.house.evolve_text_id = 68;
return;
}
}

if (water == 3 && !house->has_water_access) {
if (house->has_well_access && house->has_latrines_access) {
house->data.house.evolve_text_id = 32;
return;
}
Expand Down
Loading
Loading