Skip to content

Commit b5ff5ca

Browse files
committed
release version 2.7.4
1 parent 41f645a commit b5ff5ca

11 files changed

+437
-157
lines changed

release/ENG.ini

+5
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ m_function_preview = "Preview"
6767
m_function_show_more = "Show More Details"
6868
;Functions sub menu, Variant editor functions
6969
m_function_WeaponGroups = "Set Weapon Groups"
70+
m_function_wings = "Set Variant Wings"
7071
m_function_vent = "Flux Vents"
7172
m_function_vent_add = "Add Flux Vent"
7273
m_function_vent_remove = "Remove Flux Vent"
@@ -212,8 +213,12 @@ h_function_launchBays_remove = "Remove Nearest Port"
212213
h_function_ship_builtInWings_addWing = "Add Fighter Wing"
213214
h_function_ship_builtInWings_removeWing = "Remove Fighter Wing"
214215

216+
h_function_ship_variantWings_addWing = "Add Fighter Wing"
217+
h_function_ship_variantWings_removeWing = "Remove Fighter Wing"
218+
215219
h_function_variant_assignWeapon = "Assign Weapon"
216220
h_function_variant_weaponGroups = "Weapon Groups"
221+
h_function_variant_wings = "Wings"
217222
h_function_variant_autofire = "Toggle Autofire"
218223
h_function_variant_addVents = "Add Flux Vent"
219224
h_function_variant_removeVents = "Remove Flux Vent"

release/changes.log

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
______________________________________________________________________________
2-
editor version 2.7.4-beta.1 (starsector 0.8.1a) [Trylobot]
2+
editor version 2.7.4 (starsector 0.8.1a) [Deathfly & Trylobot]
33

44
FEATURES
5-
- Ship: renders built-in wings and wing slots
6-
- Ship: prevents adding more wings than ship has capacity for
5+
- Variant: added "wings" mode (add/remove fighter wings from variant)
6+
- Ship/Variant: renders fighter wing sprites and available slots
7+
- Ship/Variant: prevents adding more wings than ship has capacity for
8+
- Variant: warns if adding more variant wings than variant has OPs for
79
- Variant: added "goalVariant", "quality" to details (strings) editor
810

911
BUGFIXES
10-
- Now saves Ship / Details / coversColor properly
11-
12-
12+
- Ship: saves coversColor
1313

1414
______________________________________________________________________________
1515
editor version 2.7.3 (starsector 0.8.1a) [Trylobot]
@@ -42,7 +42,7 @@ BUGFIXES
4242
- In variant edit mode it will now try to create an empty new variant called "New" for edit.
4343
- In weapon edit mode, it will create an new weapon file.
4444
______________________________________________________________________________
45-
editor version 2.7.0 (starsector 0.7.2a)
45+
editor version 2.7.0 (starsector 0.7.2a) [Deathfly]
4646

4747
MAXGUI MIGRATION
4848
- Add menu bar.
@@ -113,12 +113,12 @@ BUGFIXES
113113
- Fixed a issue that the rjson core will mistakenly discard "0" for integer output.
114114

115115
______________________________________________________________________________
116-
editor version 2.6.4 (starsector 0.7.1a)
116+
editor version 2.6.4 (starsector 0.7.1a) [Trylobot]
117117
- credit to zaphide for pull request!
118118
- support for HYBRID weapon types
119119
- support for longer weapon lists
120120
______________________________________________________________________________
121-
editor version 2.6.3 (starsector 0.7a RC1)
121+
editor version 2.6.3 (starsector 0.7a RC1) [Trylobot]
122122
- ship variants will no longer assign DECORATIVE, SYSTEM or LAUNCH_BAY weapons
123123
______________________________________________________________________________
124124
editor version 2.6.2 (starsector 0.6.1a)

sf-ship-ed.bmx

+73-64
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ Include "src/TModalSetEngineSlots.type.bmx"
8484
Include "src/TModalSetStringData.type.bmx"
8585
Include "src/TModalLaunchBays.type.bmx"
8686
Include "src/TModalSetVariant.type.bmx"
87+
Include "src/TModalSetVariantWings.type.bmx"
8788
Include "src/TModalSetSkin.type.bmx"
8889
Include "src/TModalSetShipCSV.type.bmx"
8990
Include "src/TModalSetWingCSV.type.bmx"
@@ -234,6 +235,7 @@ Global sub_set_engine_slots:TModalSetEngineSlots = New TModalSetEngineSlots
234235
Global sub_string_data:TModalSetStringData = New TModalSetStringData
235236
Global sub_launchbays:TModalLaunchBays = New TModalLaunchBays
236237
Global sub_set_variant:TModalSetVariant = New TModalSetVariant
238+
Global sub_set_variant_wings:TModalSetVariantWings = New TModalSetVariantWings
237239
Global sub_set_skin:TModalSetSkin = New TModalSetSkin
238240
Global sub_ship_csv:TModalSetShipCSV = New TModalSetShipCSV
239241
Global sub_wing_csv:TModalSetWingCSV = New TModalSetWingCSV
@@ -274,7 +276,7 @@ Repeat
274276
'TODO adding Events
275277
WaitEvent()
276278
'instaquit
277-
escape_key_update( data )
279+
escape_key_update()
278280

279281
'If EventID() <> EVENT_GADGETPAINT And EventID() <> EVENT_TIMERTICK Then Print CurrentEvent.ToString()
280282
If Not Apprunning And EventID() <> EVENT_APPRESUME Then Continue
@@ -431,16 +433,18 @@ Repeat
431433
sub_set_engine_slots.Draw( ed, data, sprite )
432434
Case "launch_bays"
433435
sub_launchbays.Draw( ed, data, sprite )
434-
'Case "string_data"
435-
'performed below
436436
Case "preview_all"
437437
sub_preview_all.Draw( ed, data, sprite )
438+
'Case "string_data"
439+
'performed below
438440
End Select
439441

440442
Case "variant"
441443
Select ed.mode
442444
Case "normal"
443445
sub_set_variant.Draw( ed, data, sprite )
446+
Case "variant_wings"
447+
sub_set_variant_wings.Draw( ed, data, sprite )
444448
'Case "string_data"
445449
'performed below
446450
EndSelect
@@ -513,6 +517,70 @@ End
513517

514518
'////////////////////////////////////////////////
515519
'MARK Function set
520+
521+
Function check_sub_routines% ( ed:TEditor, data:TData, sprite:TSprite )
522+
Local hit% = True
523+
Select ed.program_mode
524+
Case "ship"
525+
Select ed.mode
526+
Case "center"
527+
sub_set_ship_center.Update( ed, data, sprite )
528+
Case "bounds"
529+
sub_set_bounds.Update( ed, data, sprite )
530+
Case "shield_center"
531+
sub_set_shield_center.Update( ed, data, sprite )
532+
Case "weapon_slots"
533+
sub_set_weapon_slots.Update( ed, data, sprite )
534+
Case "built_in_weapons"
535+
sub_set_built_in_weapons.Update( ed, data, sprite )
536+
Case "built_in_hullmods"
537+
sub_set_built_in_hullmods.Update( ed, data, sprite )
538+
Case "built_in_wings"
539+
sub_set_built_in_wings.Update( ed, data, sprite )
540+
Case "engine_slots"
541+
sub_set_engine_slots.Update( ed, data, sprite )
542+
Case "launch_bays"
543+
sub_launchbays.Update( ed, data, sprite )
544+
Case "string_data"
545+
sub_string_data.Update( ed, data, sprite )
546+
Case "preview_all"
547+
sub_preview_all.Update( ed, data, sprite )
548+
End Select
549+
Case "variant"
550+
Select ed.mode
551+
Case "normal"
552+
sub_set_variant.Update( ed, data, sprite )
553+
Case "variant_wings"
554+
sub_set_variant_wings.Update( ed, data, sprite )
555+
Case "string_data"
556+
sub_string_data.Update( ed, data, sprite )
557+
EndSelect
558+
Case "skin"
559+
Select ed.mode
560+
Case "normal"
561+
sub_set_skin.Update( ed, data, sprite )
562+
Case "string_data"
563+
sub_string_data.Update( ed, data, sprite )
564+
EndSelect
565+
Case "csv"
566+
sub_ship_csv.Update( ed, data, sprite )
567+
Case "csv_wing"
568+
sub_wing_csv.Update( ed, data, sprite )
569+
Case "weapon"
570+
Select ed.mode
571+
Case "string_data"
572+
sub_string_data.Update( ed, data, sprite )
573+
Default
574+
sub_weapon.Update( ed, data, sprite )
575+
EndSelect
576+
Case "csv_weapon"
577+
sub_weapon_csv.Update( ed, data, sprite )
578+
Default
579+
hit = False
580+
End Select
581+
Return hit
582+
End Function
583+
516584
'MARK GAlist check
517585
'-----------------------
518586
' Return true if the input EventSource(Object) hit the checkes, so we can skip the rest
@@ -802,6 +870,8 @@ Function check_function_menu% ( ed:TEditor, data:TData, sprite:TSprite )
802870

803871
Case "variant"
804872
Select EventSource()
873+
Case functionMenuSub[MENU_MODE_VARIANT][MENU_SUBFUNCTION_VARIANT_WINGS] 'variant wings
874+
sub_set_variant_wings.Activate( ed, data, sprite )
805875
Case functionMenuSub[MENU_MODE_VARIANT][MENU_SUBFUNCTION_VARIANT_STRIPALL]
806876
load_variant_data( ed, data, sprite, True ) 'strip all
807877
Case functionMenu[MENU_FUNCTION_DETAILS]
@@ -829,67 +899,6 @@ Function check_function_menu% ( ed:TEditor, data:TData, sprite:TSprite )
829899
Return hit
830900
End Function
831901

832-
Function check_sub_routines% ( ed:TEditor, data:TData, sprite:TSprite )
833-
Local hit% = True
834-
Select ed.program_mode
835-
Case "ship"
836-
Select ed.mode
837-
Case "center"
838-
sub_set_ship_center.Update( ed, data, sprite )
839-
Case "bounds"
840-
sub_set_bounds.Update( ed, data, sprite )
841-
Case "shield_center"
842-
sub_set_shield_center.Update( ed, data, sprite )
843-
Case "weapon_slots"
844-
sub_set_weapon_slots.Update( ed, data, sprite )
845-
Case "built_in_weapons"
846-
sub_set_built_in_weapons.Update( ed, data, sprite )
847-
Case "built_in_hullmods"
848-
sub_set_built_in_hullmods.Update( ed, data, sprite )
849-
Case "built_in_wings"
850-
sub_set_built_in_wings.Update( ed, data, sprite )
851-
Case "engine_slots"
852-
sub_set_engine_slots.Update( ed, data, sprite )
853-
Case "launch_bays"
854-
sub_launchbays.Update( ed, data, sprite )
855-
Case "string_data"
856-
sub_string_data.Update( ed, data, sprite )
857-
Case "preview_all"
858-
sub_preview_all.Update( ed, data, sprite )
859-
End Select
860-
Case "variant"
861-
Select ed.mode
862-
Case "normal"
863-
sub_set_variant.Update( ed, data, sprite )
864-
Case "string_data"
865-
sub_string_data.Update( ed, data, sprite )
866-
EndSelect
867-
Case "skin"
868-
Select ed.mode
869-
Case "normal"
870-
sub_set_skin.Update( ed, data, sprite )
871-
Case "string_data"
872-
sub_string_data.Update( ed, data, sprite )
873-
EndSelect
874-
Case "csv"
875-
sub_ship_csv.Update( ed, data, sprite )
876-
Case "csv_wing"
877-
sub_wing_csv.Update( ed, data, sprite )
878-
Case "weapon"
879-
Select ed.mode
880-
Case "string_data"
881-
sub_string_data.Update( ed, data, sprite )
882-
Default
883-
sub_weapon.Update( ed, data, sprite )
884-
EndSelect
885-
Case "csv_weapon"
886-
sub_weapon_csv.Update( ed, data, sprite )
887-
Default
888-
hit = False
889-
End Select
890-
Return hit
891-
End Function
892-
893902
'Function check_mode( ed:TEditor, data:TData, sprite:TSprite )
894903
' If ed.program_mode = "ship"
895904
' 'If not selecting a weapon for a built-in slot, check ESCAPE key

src/TData.type.bmx

+108
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,22 @@ Type TData
860860
EndIf
861861
EndMethod
862862

863+
'requires subsequent call to update_variant()
864+
Method add_variant_wing( wing_id$ )
865+
Local current_wing_count% = variant.wings.length + ship.builtInWings.length
866+
If current_wing_count < get_fighterbays_count()
867+
variant.wings = variant.wings[..variant.wings.length + 1]
868+
variant.wings[variant.wings.length - 1] = wing_id
869+
EndIf
870+
EndMethod
871+
872+
'requires subsequent call to update_variant()
873+
Method remove_last_variant_wing()
874+
If variant.wings.length > 0
875+
variant.wings = variant.wings[..variant.wings.length-1]
876+
EndIf
877+
EndMethod
878+
863879
'////////////////
864880

865881
'requires subsequent call to update_weapon()
@@ -912,6 +928,7 @@ Type TData
912928

913929
'////////////////
914930

931+
' counts the number of matching wings are equipped on the loaded .ship
915932
Method count_builtin_wings%( search_wing_id$ )
916933
Local count% = 0
917934
For Local wing_id$ = EachIn ship.builtInWings
@@ -920,6 +937,97 @@ Type TData
920937
Return count
921938
EndMethod
922939

940+
' counts the number of matching wings are equipped on the loaded .variant
941+
Method count_variant_wings%( search_wing_id$ )
942+
Local count% = 0
943+
For Local wing_id$ = EachIn variant.wings
944+
If wing_id = search_wing_id Then count :+ 1
945+
Next
946+
Return count
947+
EndMethod
948+
949+
Method get_wing_op_cost%( wing_id$ )
950+
Local wing:TMap = TMap( ed.stock_wing_stats.ValueForKey( wing_id ))
951+
Return String( wing.ValueForKey( "op cost" )).ToInt()
952+
EndMethod
953+
954+
'-----------------------------------------
955+
956+
Method get_ship_csv_ordnance_points%()
957+
Local ship_stats:TMap = csv_row
958+
Local value$ = String( ship_stats.ValueForKey( "ordnance points" ))
959+
If Not value Then Return 0 'csv row found, but did not contain column
960+
Return value.ToInt()
961+
EndMethod
962+
963+
Method calc_variant_used_ordnance_points%()
964+
Local op% = 0
965+
'flux vents, flux capacitors, weapons, hullmods, wings
966+
op :+ variant.fluxVents
967+
op :+ variant.fluxCapacitors
968+
For Local group:TStarfarerVariantWeaponGroup = EachIn variant.weaponGroups
969+
For Local weapon_slot_id$ = EachIn group.weapons.Keys()
970+
Local weapon_id$ = String( group.weapons.ValueForKey( weapon_slot_id ))
971+
If weapon_id
972+
Local weapon_op% = get_weapon_csv_ordnance_points( weapon_id )
973+
If Not is_weapon_assigned_to_builtin_weapon_slot( weapon_slot_id )
974+
op :+ weapon_op
975+
EndIf
976+
End If
977+
Next
978+
Next
979+
For Local hullMod_id$ = EachIn variant.hullMods
980+
Local hullMod_op% = get_hullmod_csv_ordnance_points( hullMod_id )
981+
op :+ hullMod_op
982+
Next
983+
For Local wing_id$ = EachIn variant.wings
984+
Local wing_op% = get_wing_op_cost( wing_id )
985+
op :+ wing_op
986+
Next
987+
Return op
988+
EndMethod
989+
990+
Method is_weapon_assigned_to_builtin_weapon_slot%( weapon_slot_id$ )
991+
For Local weapon_slot:TStarfarerShipWeapon = EachIn ship.weaponSlots
992+
If weapon_slot.id = weapon_slot_id And weapon_slot.is_builtin()
993+
Return True
994+
EndIf
995+
Next
996+
Return False
997+
EndMethod
998+
999+
Method get_weapon_csv_ordnance_points%( weapon_id$ )
1000+
Local weapon_stats:TMap = TMap( ed.stock_weapon_stats.ValueForKey( weapon_id ))
1001+
If Not weapon_stats Then Return 0 'ID not found in csv data
1002+
Local value$ = String( weapon_stats.ValueForKey( "OPs" ))
1003+
If Not value Then Return 0 'csv row found, but did not contain column
1004+
Return value.ToInt()
1005+
EndMethod
1006+
1007+
Method get_hullmod_csv_ordnance_points%( hullMod_id$ )
1008+
'uses ship size and hullmod data
1009+
Local hullMod_stats:TMap = TMap( ed.stock_hullmod_stats.ValueForKey( hullMod_id ))
1010+
If Not hullMod_stats Then Return 0 'ID not found in csv data
1011+
Local column_key$ = ""
1012+
Select ship.hullSize
1013+
Case "FRIGATE"
1014+
column_key = "cost_frigate"
1015+
Case "DESTROYER"
1016+
column_key = "cost_dest"
1017+
Case "CRUISER"
1018+
column_key = "cost_cruiser"
1019+
Case "CAPITAL_SHIP"
1020+
column_key = "cost_capital"
1021+
Default
1022+
Return 0 'hullMod cost cannot be found
1023+
EndSelect
1024+
Local value$ = String( hullMod_stats.ValueForKey( column_key ))
1025+
If Not value Then Return 0 'csv row found, but did not contain column
1026+
Return value.ToInt()
1027+
EndMethod
1028+
1029+
'-----------------------------------------
1030+
9231031
Method find_assigned_slot_parent_group:TStarfarerVariantWeaponGroup( ship_weapon_slot_id$ )
9241032
For Local group:TStarfarerVariantWeaponGroup = EachIn variant.weaponGroups
9251033
For Local assigned_slot_id$ = EachIn group.weapons.Keys()

src/TEditor.type.bmx

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Type TEditor
1717
Field builtIn_hullMod_i%
1818
Field builtIn_wing_i%
1919
Field variant_hullMod_i%
20+
Field variant_wing_i%
2021
Field group_field_i%
2122
'mouse states
2223
Field mouse_1%

0 commit comments

Comments
 (0)