Project

General

Profile

Actions

Feature #1836

open

re-write/improve reqtext.c

Added by Dean Brown 28 days ago. Updated 15 days ago.

Status:
In Review
Priority:
Normal
Category:
General
Target version:
Start date:
12/24/2025
Due date:
% Done:

0%

Estimated time:

Description

There's typos that need fixing -
"?good:Requires import of %s ." Extra space char
"?cityprop:Applies only to %s cities" Missing .
"?cityprop:Does not apply to %s cities" Missing .

I don't like a routine >3000 lines long, not good coding style IMO. I want to make it be like -

 switch (preq->source.kind) {
  case VUT_NONE:
    return FALSE;

  case VUT_COUNTER:
    return req_text_counter();

  case VUT_ADVANCE:
    return req_text_advance();

  case VUT_TECHFLAG:
    return req_text_techflag();

...

extracting a bunch of new routines, one for each req type.


Files

clipboard-202601040104-eid9s.png (113 KB) clipboard-202601040104-eid9s.png Marko Lindqvist, 01/04/2026 01:04 AM
clipboard-202601060115-dxyqy.png (10.9 KB) clipboard-202601060115-dxyqy.png Marko Lindqvist, 01/06/2026 01:15 AM
1836.patch (315 KB) 1836.patch Dean Brown, 01/06/2026 03:45 AM
clipboard-202601040104-eid9s.png
clipboard-202601060115-dxyqy.png

Related issues 1 (1 open0 closed)

Blocks Feature #1787: TiledefConnected requirement typeIn ReviewMarko Lindqvist11/29/2025

Actions
Actions #1

Updated by Marko Lindqvist 28 days ago

  • Tracker changed from Tasks to Feature
  • Category changed from client-common to General

Split to two tickets:
1) typofixes -> goes to all branches
2) refactoring -> goes to main branch

Actions #2

Updated by Dean Brown 27 days ago

New issue #1839 for the typos.

Actions #3

Updated by Dean Brown 26 days ago

  • File 1836.patch added

Did a bunch of testing to make sure I didn't break anything.

What a huge patch file!

Actions #4

Updated by Marko Lindqvist 17 days ago

Very bad indentation.

Actions #6

Updated by Dean Brown 16 days ago

  • File deleted (1836.patch)
Actions #7

Updated by Dean Brown 16 days ago

  • File 1836.patch added

Sigh - I can't stop my text editor from sometimes putting in tab chars, have to always remember to check for that.

Actions #8

Updated by Marko Lindqvist 15 days ago

clipboard-202601060115-dxyqy.png

req_text_player_flag(), req_text_nation(), req_text_style(), req_text_nationality(), req_text_uclass(), req_text_unit_state(), req_text_ai_level(), and req_text_city_tile() have parameters with bad indentation.

So does req_text_max_tile_total_units(), but in that case it's likely better than to introduce overlong lines.

Actions #9

Updated by Dean Brown 15 days ago

  • File deleted (1836.patch)
Actions #10

Updated by Dean Brown 15 days ago

One more try.

For req_text_max_tile_total_units(), proper alignment pushes longest line to col 74, OK per the guidelines.

Actions #11

Updated by Marko Lindqvist 15 days ago

  • Status changed from New to In Review
  • Assignee set to Marko Lindqvist
  • Target version set to 3.4.0
Actions #12

Updated by Marko Lindqvist 15 days ago

Actions

Also available in: Atom PDF