@IconEditor.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /******************************************************************************/
  2. /******************************************************************************/
  3. class IconEditor : PropWin
  4. {
  5. class Change : Edit::_Undo::Change
  6. {
  7. ElmIcon data;
  8. virtual void create(ptr user)override;
  9. virtual void apply(ptr user)override;
  10. };
  11. static void Render();
  12. void render();
  13. Matrix matrix();
  14. Box box ();
  15. static flt GetDist(C Box&box); // avoid changing this func as it will break old icon settings
  16. flt getDist(); // !! assumes that viewport and obj are already set !!
  17. static void Draw(Viewport &viewport);
  18. void draw(bool final=false);
  19. void makeIcon();
  20. bool make_do;
  21. UID elm_id;
  22. Elm *elm;
  23. bool changed, changed_file, no_scale;
  24. flt prop_max_x;
  25. ObjectPtr obj;
  26. AnimatedSkeleton skel;
  27. SkelAnim skel_anim;
  28. Button undo, redo, locate, make;
  29. ViewportSkin viewport;
  30. IconSettings settings;
  31. Property *var, *nos;
  32. int mesh_variation;
  33. Memc<ParamEditor::MeshVariation> mesh_variations;
  34. Edit::Undo<Change> undos; void undoVis();
  35. ElmIcon* data()C;
  36. static void PreChanged(C Property &prop);
  37. static void Changed(C Property &prop);
  38. static void Object ( IconEditor &ie, C Str &text);
  39. static Str Object (C IconEditor &ie );
  40. static void Variation( IconEditor &ie, C Str &text);
  41. static Str Variation(C IconEditor &ie );
  42. static void Settings ( IconEditor &ie, C Str &text);
  43. static Str Settings (C IconEditor &ie );
  44. static void Animation( IconEditor &ie, C Str &text);
  45. static Str Animation(C IconEditor &ie );
  46. static void AnimPos ( IconEditor &ie, C Str &text);
  47. static Str AnimPos (C IconEditor &ie );
  48. static void Make (IconEditor &editor);
  49. static void Undo (IconEditor &editor);
  50. static void Redo (IconEditor &editor);
  51. static void Locate(IconEditor &editor);
  52. void setObj();
  53. void meshVariationChanged();
  54. void create();
  55. void toGui();
  56. virtual IconEditor& hide ( ) override;
  57. virtual Rect sizeLimit( )C override;
  58. virtual IconEditor& rect (C Rect &rect) override;
  59. void flush();
  60. void setChanged(bool file=false);
  61. void reloadSettings();
  62. void set(Elm *elm);
  63. void activate(Elm *elm);
  64. void toggle (Elm *elm);
  65. void elmChanged(C UID &elm_id);
  66. void erasing(C UID &elm_id);
  67. public:
  68. IconEditor();
  69. };
  70. /******************************************************************************/
  71. /******************************************************************************/
  72. extern IconEditor IconEdit;
  73. /******************************************************************************/