Summary: [Patch] Game scenario properties in property editor
                 Project: Freeciv
            Submitted by: mbook
            Submitted on: Thursday 05/21/2009 at 06:04
                Category: editor
                Severity: 3 - Normal
                Priority: 1 - Later
                  Status: Ready For Test
             Assigned to: mbook
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
        Operating System: None



Attached patch implements the 4 new scenario fields
of the game struct as editable properties of the
game object in the property editor, and a few other
small changes I did not feel like splitting into
separate patches. Depends on RT#40229, GNA#13540.

The main novelty is that the extviewer property
widget is augmented so that the 'description'
property can be edited in a full, multi-line textview.

Some small improvements/changes in nearby code:
- Removed the 'is_scenario' if-test in handle_scenario
  _info(), on both the client side and the server side
  (this is because the property editor expects that
  fields can be set individually).
- Added editable gtktextviews to the types of widgets
  allowed to grab keyboard events in toplevel_handler()
  in gui_main.c (man was this annoying to track down).
- Updated network capstring due to new packet fields.
- Added error message for missing handler in
- Split up propval_free() into itself and propval_free
  _data() (I thought this would be needed, but then it
  turned out not to be; I left it anyway for posterity).
- Factored out some common code in extviewer_clear
  _widgets() switch cases.
- Fixed typo "extviwer" (twice).

I'm not sure if the duplicated work in handle_scenario
_info() and handle_edit_game() is ideal. Sure if there
were a specialized gui widget for setting scenario
parameters it would have to use the scenario info
packet, but I think the property editor is enough (I
will fix it up soon so that it is less annoying to

I also noticed that I am basically reimplementing the
delta code in the edit handlers... it would be great
if the handler functions could access the delta
bitfields so that the if-checks would not need to
be run twice, but I suppose the delta compression
could also just be turned off with the 'no-delta'
flag in the packet definitions. I'll check which
solution would be best later.



File Attachments:

Date: Thursday 05/21/2009 at 06:04  Name: game_scenario_properties.patch 
Size: 21kB   By: mbook



Reply to this item at:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to