summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2018-11-10 00:42:57 +0100
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2018-11-10 00:42:57 +0100
commit616475c22716245e4a308146d78eaea33909a0d9 (patch)
treedd2251b44264084635b33d82453960b0d914d158
parentf76ee59d32b60f2728abd1eb3ac4169c92b2b5ba (diff)
Okay, it's fixed now.
-rw-r--r--src/roster-editor/src/Struct/Character.elm97
-rw-r--r--src/roster-editor/src/Struct/Model.elm3
2 files changed, 51 insertions, 49 deletions
diff --git a/src/roster-editor/src/Struct/Character.elm b/src/roster-editor/src/Struct/Character.elm
index 796f85f..8e07ee7 100644
--- a/src/roster-editor/src/Struct/Character.elm
+++ b/src/roster-editor/src/Struct/Character.elm
@@ -110,56 +110,59 @@ new : (
Type
)
new index name m_portrait m_main_wp m_sec_wp m_armor m_board m_glyphs =
- {
- ix = index,
- name = name,
- portrait =
- (
- case m_portrait of
- (Just portrait) -> portrait
- Nothing -> (Struct.Portrait.default)
- ),
- attributes = (Struct.Attributes.default),
- statistics = (Struct.Statistics.new_raw (Struct.Attributes.default)),
- weapons =
- (Struct.WeaponSet.new
+ (refresh_omnimods
+ {
+ ix = index,
+ name = name,
+ portrait =
(
- case m_main_wp of
- (Just w) -> w
- Nothing -> (Struct.Weapon.default)
- )
+ case m_portrait of
+ (Just portrait) -> portrait
+ Nothing -> (Struct.Portrait.default)
+ ),
+ attributes = (Struct.Attributes.default),
+ statistics = (Struct.Statistics.new_raw (Struct.Attributes.default)),
+ weapons =
+ (Struct.WeaponSet.new
+ (
+ case m_main_wp of
+ (Just w) -> w
+ Nothing -> (Struct.Weapon.default)
+ )
+ (
+ case m_sec_wp of
+ (Just w) -> w
+ Nothing -> (Struct.Weapon.default)
+ )
+ ),
+ armor =
(
- case m_sec_wp of
- (Just w) -> w
- Nothing -> (Struct.Weapon.default)
- )
- ),
- armor =
- (
- case m_armor of
- (Just armor) -> armor
- Nothing -> (Struct.Armor.default)
- ),
- glyph_board =
- (
- case m_board of
- (Just board) -> board
- Nothing -> (Struct.GlyphBoard.default)
- ),
- glyphs =
- (Array.fromList
- (List.map
- (\m_g ->
- case m_g of
- (Just g) -> g
- Nothing -> (Struct.Glyph.default)
+ case m_armor of
+ (Just armor) -> armor
+ Nothing -> (Struct.Armor.default)
+ ),
+ glyph_board =
+ (
+ case m_board of
+ (Just board) -> board
+ Nothing -> (Struct.GlyphBoard.default)
+ ),
+ glyphs =
+ (Array.fromList
+ (List.map
+ (\m_g ->
+ case m_g of
+ (Just g) -> g
+ Nothing -> (Struct.Glyph.default)
+ )
+ m_glyphs
)
- m_glyphs
- )
- ),
- current_omnimods = (Struct.Omnimods.none),
- was_edited = False
- }
+ ),
+ current_omnimods = (Struct.Omnimods.none),
+ was_edited = False
+ }
+ )
+
get_index : Type -> Int
get_index c = c.ix
diff --git a/src/roster-editor/src/Struct/Model.elm b/src/roster-editor/src/Struct/Model.elm
index e796df7..0f49d2f 100644
--- a/src/roster-editor/src/Struct/Model.elm
+++ b/src/roster-editor/src/Struct/Model.elm
@@ -72,8 +72,7 @@ add_character char_rec model =
let index = (Struct.CharacterRecord.get_index char_rec) in
{model |
characters =
- (Array.set
- index
+ (Array.push
(Struct.Character.new
index
(Struct.CharacterRecord.get_name char_rec)