sso-elements-fmk 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a1557cd39c57399cb8864bd05d13a42b08a13be5815cdd8d6b136d09ba765108
4
- data.tar.gz: 3531bf8d59858c74d1e1378a0c2c48516b281adb957a2b49a15e0deb9aff06a4
3
+ metadata.gz: a2c4d8e727e906f0f3796714afd8e6a62fa3d8666ef8412bd0b4ba918f600d44
4
+ data.tar.gz: 85b2ba159a66bbffee1b2e391a019f66302be1a85463fc233e25f2592e3f8dda
5
5
  SHA512:
6
- metadata.gz: ea03d916aedfc30c1504f9e67bbaa11074e1765530737fbdf8145873e43559df01ae2b56d1ee5f7422719aa24da544068d0ca1539672b1eb7b1094db35545dc9
7
- data.tar.gz: 4e56abeac32ab6b3164fd167b216cfd72a35eb69f0152575c2e9a817502a1703b5ad7676d5d8b5bce23247f09dc4aeab8aa56a35b5ced9eba1274988130235bb
6
+ metadata.gz: 56aea11df641f1933a8e4aa6f0dae027c75e80529c63ab624fe7d31cfa3ab2ac21dfa28e49ddead894b0c446a942753e2ec546af02d9289c14faf9283bd898be
7
+ data.tar.gz: 5cb949760e78bfb7289e9123d5bd8839d7b416de20e4f7b90af137cc49d097c3899ff918ba36903f749466bdc77fb71778aba6a8c90173bbbebedb245203eb7c
data/README.md CHANGED
@@ -1,24 +1,58 @@
1
1
  # SSO::Elements::Fmk
2
2
 
3
- TODO: Delete this and the text below, and describe your gem
4
-
5
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/sso/elements/fmk`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Simple SSO elements editor for Ruby
6
4
 
7
5
  ## Installation
8
6
 
9
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
10
-
11
7
  Install the gem and add to the application's Gemfile by executing:
12
8
 
13
- $ bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
9
+ $ bundle add sso-elements-fmk
14
10
 
15
11
  If bundler is not being used to manage dependencies, install the gem by executing:
16
12
 
17
- $ gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
13
+ $ gem install sso-elements-fmk
18
14
 
19
15
  ## Usage
20
16
 
21
- TODO: Write usage instructions here
17
+ Here you can see a basic sample of how to create an NPC
18
+
19
+ ```ruby
20
+ require 'sso/elements/fmk'
21
+
22
+ # Creates a new collection
23
+ collection = SSO::Elements::Collection.new
24
+
25
+ # Loads a custom config
26
+ collection.load_config!(150)
27
+
28
+ # Load all elements from file
29
+ collection.load_elements!('./lib/sso/elements/samples/elements.data')
30
+
31
+ # Gets Npc Essence table
32
+ npc_essence = collection.table('NpcEssence')
33
+
34
+ # Gets a random NPC
35
+ some_random_npc = npc_essence.find_element_by_id 4850
36
+
37
+ # Clones the npc into a new one
38
+ npc = some_random_npc.clone
39
+
40
+ # Set new npc custom properties
41
+ npc.id = 120031
42
+ npc.name = 'Donovan'
43
+ npc.item_exchange_service = 0
44
+ npc.file_model = 2023
45
+ npc.file_icon = 4713
46
+ npc.name_prof_prefix = 'Just someone'
47
+
48
+ # Adds the new npc to the collection
49
+ npc_essence.add_element(npc)
50
+
51
+ # Persists elements into a new file
52
+ collection.save!('./lib/sso/elements/samples/new_elements.data')
53
+ ```
54
+
55
+ More samples can be found [here](https://github.com/kuroro7/sso-elements-fmk/tree/master/examples)
22
56
 
23
57
  ## Development
24
58
 
@@ -28,11 +62,11 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
28
62
 
29
63
  ## Contributing
30
64
 
31
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/sso-elements-fmk. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/sso-elements-fmk/blob/master/CODE_OF_CONDUCT.md).
65
+ Bug reports and pull requests are welcome on GitHub at https://github.com/kuroro7/sso-elements-fmk. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/sso-elements-fmk/blob/master/CODE_OF_CONDUCT.md).
32
66
 
33
67
  ## License
34
68
 
35
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
69
+ The gem is available as open source under the terms of the [LGPL License](https://www.gnu.org/licenses/lgpl-3.0.txt).
36
70
 
37
71
  ## Code of Conduct
38
72
 
@@ -0,0 +1,33 @@
1
+ require 'sso/elements/fmk'
2
+
3
+ # Creates a new collection
4
+ collection = SSO::Elements::Collection.new
5
+
6
+ # Loads a custom config
7
+ collection.load_config!(150)
8
+
9
+ # Load all elements from file
10
+ collection.load_elements!('./lib/sso/elements/samples/elements.data')
11
+
12
+ # Gets Npc Essence table
13
+ npc_essence = collection.table('NpcEssence')
14
+
15
+ # Gets a random NPC
16
+ some_random_npc = npc_essence.find_element_by_id 4850
17
+
18
+ # Clones the npc into a new one
19
+ npc = some_random_npc.clone
20
+
21
+ # Set new npc custom properties
22
+ npc.id = 120031
23
+ npc.name = 'Donovan'
24
+ npc.item_exchange_service = 0
25
+ npc.file_model = 2023
26
+ npc.file_icon = 4713
27
+ npc.name_prof_prefix = 'Just someone'
28
+
29
+ # Adds the new npc to the collection
30
+ npc_essence.add_element(npc)
31
+
32
+ # Persists elements into a new file
33
+ collection.save!('./lib/sso/elements/samples/new_elements.data')
@@ -3,7 +3,7 @@
3
3
  module SSO
4
4
  module Elements
5
5
  module Fmk
6
- VERSION = "0.1.1"
6
+ VERSION = "0.1.2"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sso-elements-fmk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - kuroro
@@ -25,6 +25,7 @@ files:
25
25
  - LICENSE.txt
26
26
  - README.md
27
27
  - Rakefile
28
+ - examples/npc_creation.rb
28
29
  - lib/sso/elements/collection.rb
29
30
  - lib/sso/elements/config.rb
30
31
  - lib/sso/elements/configs/PW_1.0.2_v150.cfg