ArcanePariah / Night-of-the-Dead

9 stars 14 forks source link

Remaking the new_shop branch. #181

Closed NiktosNOTD closed 6 years ago

NiktosNOTD commented 6 years ago

After i messed up on merging in pull #162 this is reproducing steps made there but with v2.177 as base. Detailed changelogs ftw.

Old shop is left functional for now, despite extensive testing i'm not sure if new shop won't cause some issue so i suggest leaving them both online for one patch. I will make a pullrequest removing old shop in the future if this one won't cause any problems.

New shop uses layout template as base (similiar in structure to talent window) - Shop consists of tab control and two pages(Consumables-for one game items |Modifications- for lifelong purchases) Added triggers to create shop dialog, and dialog buttons that correspond to items in shop - said triggers feed data to layout template and store dialog references in Shops record structure. changed to 2dimm array Added usertype -'shopitems' to store shop related properties of items (name,price,icon,tooltip,type,ect) this allows for items to be individualized freely and makes adding items to shop easier. Added triggers to handle displayin/hiding shop dialog - shop requires alive marine not further than 20range from it to show. Added 'regions' to map to achieve range limiting above. Added trigger which auto-hides shop if marine walks too far away from it. It displays information about it happening/reason above marine unit. Copied and simplified triggers responsible for act of buying items, also adding information above marine unit in case of shopping failing to occur. Created custom function to disable new shop at usual times during story-lines and added call for it where applicable. Due to new shop placement modified function responsible for hiding/displaying marine details window, to prevent them displaying same time.

While adding items to new usertype changed following: 1.Added 16th color - lightpink. <- changed trigger responsible for changing marine color to accomodate 2.Removed option of buying m5 riffle. 3.Created tooltips for pet skins 4.Copied and simplified tooltips of items. 5.Tooltips of color changes now use exact hex codes correlating to colors you get, most noticeable for 'purple' 'violet' and 'darkgrey' which in old shop are simply different from what you buy. 6.Color changes buttons now visibly show what color they correspond to, using correct hex codes from point 5. - thx to JMM
[Added into 'Assets/Textures' folder of map itself, can't get it to work in 'notd assets.sc2mod' for whatever reason, after 1 hour of trying to directly pasting/importing into mod/importing into map, while closing and opening editor i gave up] - hopefully it's not that much trouble to move them over 16 buttons named 'btn-#color#.dds' referenced by first 16 instances of 'shopitems' usertype.

To sum it up: Benefits: 1.More flexibility in pricing items 2.Adding/removing items is less prone to error. 3.Usage of shop is more user friendly 4.We get 16th custom color that wasn't available due to lack of space in old shop (yay!) Negatives: 1.New shop is more memory hungry due to [8][58] record changed to array to keep track of buttons. 2.New shop adds few extra 'unit exits region' events. 3.New buttons add ~130KB to filesize.