Skip to content

Commit deeedeb

Browse files
committed
oh oops missed these
1 parent cd7a030 commit deeedeb

2 files changed

Lines changed: 20 additions & 28 deletions

File tree

Internal-Documentation.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,26 @@ Restarts the game.
4141
#### `SMODS.get_optional_features()`
4242
Inserts all enabled optional features by injected mods into the `SMODS.optional_features` table.
4343
#### `SMODS.localize_box(lines, args)`
44-
Handles localizing description boxes within a localization entry.
44+
Handles localizing description boxes within a localization entry. Given a `lines` table parsed by `loc_parse_string()`, returns the UI structure for a description line.
45+
- `args` can be a table with the following parameters:
46+
- `vars`: like the ones returned by `loc_vars`, it can similarly also contain a `colours` table.
47+
- `scale`, `text_colour`, `shadow`, `default_col`
48+
49+
Example:
50+
```lua
51+
-- Parses the whole description for Joker
52+
local text_table = loc_parse_string(G.localization.descriptions.Joker.j_joker.text)
53+
local nodes = {}
54+
for k, v in ipairs(text_table) do
55+
nodes[#nodes+1] = SMODS.localize_box(v)
56+
end
57+
-- It can then be used in a node like this:
58+
local ui_node = {
59+
n=G.UIT.R,
60+
config={align = "cm"},
61+
nodes=nodes
62+
}
63+
```
4564

4665
## Calculation
4766
These functions are used for handling calculation events.

Utility.md

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ Recalculates the debuff state of a card.
117117
#### `SMODS.merge_lists(...) -> table`
118118
Takes any number of 2D arrays. Flattens the input into a 1D array that contains all elements once in the order they first appear and removes any duplicates.
119119
This can be used to merge results from poker hand evaluation to create a combined hand.
120-
#### `SMODS.merge_defaults(t, defaults) -> table`
121-
Starting with `t`, inserts any key-value pairs from `defaults` that don't already exist in `t` into `t`. Returns `t`, the result of the merge. `nil` inputs count as {}; `false` inputs count as a table where every possible key maps to `false`. Therefore, `t == nil` is weak and falls back to `defaults`. `t == false` explicitly ignores `defaults`. (This function might not return a table, due to the above)
122120
#### `SMODS.get_blind_amount(ante) -> number`
123121
Provides score requirements for higher stages of ante scaling. If you want to implement your own scaling rules, you should modify this function.
124122
#### `SMODS.stake_from_index(index) -> string`
@@ -192,10 +190,6 @@ Function to draw a certain number of cards to hand, calling the relevant calcula
192190
#### `SMODS.is_poker_hand_visible(handname) -> boolean`
193191
This function checks whether a poker hand is visible in the poker hands menu.
194192
- `handname` - string of poker hand name
195-
#### `SMODS.restart_game()`
196-
Restarts the game.
197-
#### `SMODS.add_to_pool(prototype_obj, args) -> boolean`
198-
This function handles the `in_pool` call to each object when creating a pool, and if it returns `true` the object is added to the pool. `prototype_obj` will be the prototype of the object of the set being polled (i.e. an `SMODS.Center`, `SMODS.Blind`, `SMODS.Tag`, `SMODS.Rank`, `SMODS.Suit`, etc.) The `args` table is optional, and I would recommend searching in your IDE for the function to see the different `args` tables.
199193
*(Calls to `get_current_pool` will add an `args` table of `{source = _append}` where `_append` is the 4th argument of `get_current_pool`)*
200194
#### `SMODS.create_sprite(x, y, width, height, atlas_key, pos) -> Sprite|AnimatedSprite`
201195
*(Added in 1221a)* Handles creation of `Sprite` objects with the correct atlas type.
@@ -205,27 +199,6 @@ This function handles the `in_pool` call to each object when creating a pool, an
205199
*(Added in 1501a)* Wrapper for `get_current_pool` that will exclude any `"UNAVAILABLE"` values in the pool, therefore giving a list of valid keys only.
206200
#### `SMODS.size_of_pool(pool) -> integer`
207201
Returns the number of valid keys in a pool obtained with `get_current_pool`.
208-
#### `SMODS.localize_box(lines, args) -> table`
209-
Given a `lines` table parsed by `loc_parse_string()`, returns the UI structure for a description line.
210-
- `args` can be a table with the following parameters:
211-
- `vars`: like the ones returned by `loc_vars`, it can similarly also contain a `colours` table.
212-
- `scale`, `text_colour`, `shadow`, `default_col`
213-
214-
Example:
215-
```lua
216-
-- Parses the whole description for Joker
217-
local text_table = loc_parse_string(G.localization.descriptions.Joker.j_joker.text)
218-
local nodes = {}
219-
for k, v in ipairs(text_table) do
220-
nodes[#nodes+1] = SMODS.localize_box(v)
221-
end
222-
-- It can then be used in a node like this:
223-
local ui_node = {
224-
n=G.UIT.R,
225-
config={align = "cm"},
226-
nodes=nodes
227-
}
228-
```
229202

230203
## Joker Effects
231204

0 commit comments

Comments
 (0)