Advertisement
Guest User

Untitled

a guest
Jun 16th, 2011
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. // all station sprite sets are put in one single action1 set
  2. spriteset (ground_tile, "") {
  3. []
  4. }
  5. spriteset (cargo_pile, "") {
  6. [] //empty
  7. [] //small pile of coal
  8. [] //larger pile of coal
  9. [] //very large pile
  10. }
  11.  
  12. // I'm not sure about the extent to which passing parameters is already possible
  13. spritelayout my_layout(amount) {
  14. ground {
  15. sprite: ground_tile;
  16. }
  17. building {
  18. sprite: cargo_pile(amount)
  19. }
  20. }
  21.  
  22. switch(FEAT_STATIONS, SELF, coal_pile_amount, cargo_amount(COAL)) {
  23. 0.. 50: my_layout(0);
  24. 50.. 150: my_layout(1);
  25. 150 .. 300: my_layout(2);
  26. my_layout(3);
  27. }
  28.  
  29. switch(FEAT_STATIONS, SELF, coal_pile_cb, current_callback) {
  30. 0x14: coal_pile_amount;
  31. CB_FAILED:
  32. }
  33.  
  34. item(FEAT_STATIONS, coal_pile, 0) {
  35. property {
  36. class: "NML\0";
  37. //when defining the class, layouts are automatically added as well
  38. }
  39. graphics {
  40. //no cargo stuff here, do that via varaction2
  41. //automatically add a varaction2 that checks for CB 0 and branches to the action1/2 containing all sprites
  42. //i.e. 1 single action1/realaction2 per grf
  43. coal_pile_cb;
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement