Skip to content

Commit

Permalink
fixes #17
Browse files Browse the repository at this point in the history
  • Loading branch information
Trylobot committed Jul 3, 2017
1 parent 59732a5 commit 266a80b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
9 changes: 9 additions & 0 deletions release/changes.log
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
______________________________________________________________________________

editor version 2.7.2 (starsector 0.8.1a)
______________________________________________________________________________

CHANGES

- Fixed bug #16 ""
- Added goalVariant, permaMods fields to TStarfarerVariant.type.bmx
______________________________________________________________________________

editor version 2.7.1 (starsector 0.8.1a)
______________________________________________________________________________

Expand Down
2 changes: 2 additions & 0 deletions sf-ship-ed.bmx
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ json.add_transform( "stringify_ship", "$weaponSlots:array/:object/$position:arra
json.add_transform( "stringify_ship", "$builtInWeapons:object", json.XJ_DELETE,, predicate_omit_if_empty_object )
json.add_transform( "stringify_ship", "$builtInMods:array", json.XJ_DELETE,, predicate_omit_if_empty_array )
json.add_transform( "stringify_ship", "$coversColor:string", json.XJ_DELETE,, predicate_omit_if_empty_string )
'TStarfarerVariant
json.add_transform( "stringify_variant", "$goalVariant", json.XJ_CONVERT, "boolean" )
'TStarfarerCustomEngineStyleSpec
json.add_transform( "parse_ship", "$engineSlots:array/:object/$styleSpec:object/$type:string", json.XJ_RENAME, "type_" )
json.add_transform( "stringify_ship", "$engineSlots:array/:object/$styleSpec:object/$type_:string", json.XJ_RENAME, "type" )
Expand Down
6 changes: 0 additions & 6 deletions src/TData.type.bmx
Original file line number Diff line number Diff line change
Expand Up @@ -746,19 +746,13 @@ Type TData
'requires subsequent call to update_variant()
Method unassign_weapon_from_slot( ship_weapon_slot_id$ )
'remove a slot assignment
'DebugLog "unassign_weapon_from_slot "+ship_weapon_slot_id
'Local i% = 0
For Local group:TStarfarerVariantWeaponGroup = EachIn variant.weaponGroups
'DebugLog " variant.weaponGroup "+i
For Local existing_ship_weapon_slot_id$ = EachIn group.weapons.Keys()
'DebugLog " existing_ship_weapon_slot_id => "+existing_ship_weapon_slot_id
If ship_weapon_slot_id = existing_ship_weapon_slot_id
'DebugLog " removed!"
group.weapons.Remove( ship_weapon_slot_id )
'TODO: if the group is empty, remove it (??) -- empty groups aren't visible in-game anyhow
EndIf
Next
'i :+ 1
Next
EndMethod

Expand Down
6 changes: 1 addition & 5 deletions src/TModalSetVariant.type.bmx
Original file line number Diff line number Diff line change
Expand Up @@ -480,16 +480,12 @@ Type TModalSetVariant Extends TSubroutine
ed.group_field_i = (ed.group_field_i Mod (count ) + (count ) ) Mod (count )
modified = True
Case KEY_LEFT, KEY_RIGHT
'DebugLog "group_offsets[ed.group_field_i] => "+group_offsets[ed.group_field_i]
Local j% = group_offsets[ed.group_field_i]
If EventData() = KEY_RIGHT Then j :+ 1 Else j :- 1
'DebugLog "j0 => "+j
j = (j Mod MAX_VARIANT_WEAPON_GROUPS + MAX_VARIANT_WEAPON_GROUPS) Mod MAX_VARIANT_WEAPON_GROUPS
'DebugLog "j1 => "+j
data.unassign_weapon_from_slot( weapon_slot_ids[ed.group_field_i] )
'DebugLog "weapon_slot_id => "+weapon_slot_ids[ed.group_field_i]
'DebugLog "weapon_id => "+weapon_ids[ed.group_field_i]
data.assign_weapon_to_slot( weapon_slot_ids[ed.group_field_i], weapon_ids[ed.group_field_i], j )
data.update_variant()
modified = True
Case KEY_A
data.toggle_weapon_group_autofire( group_offsets[ed.group_field_i] )
Expand Down
4 changes: 4 additions & 0 deletions src/TStarfarerVariant.type.bmx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
Type TStarfarerVariant
Field displayName$
Field goalVariant%
Field hullId$
Field variantId$
Field fluxVents%
Field fluxCapacitors%
Field hullMods$[]
Field permaMods$[]
Field weaponGroups:TStarfarerVariantWeaponGroup[]
Field quality#

Expand All @@ -31,11 +33,13 @@ Type TStarfarerVariant
Method clone:TStarfarerVariant ()
Local c:TStarfarerVariant = New TStarfarerVariant
c.displayName = displayName + " Copy"
c.goalVariant = goalVariant
c.hullId = hullId
c.variantId = variantId + "_copy"
c.fluxVents = fluxVents
c.fluxCapacitors = fluxCapacitors
c.hullMods = hullMods
c.permaMods = permaMods
c.weaponGroups = weaponGroups[..]
Return c
End Method
Expand Down

0 comments on commit 266a80b

Please sign in to comment.