Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create rjson.scl #337

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

create rjson.scl #337

wants to merge 4 commits into from

Conversation

17183248569
Copy link
Contributor

@17183248569 17183248569 commented Aug 13, 2022

the function format() is too weak. so i create this scl to improve it.

define:
text-like value: entity, string, text, [will allow item after item_display_name is added]

usage:
import('rjson',...import('rjson'))

added functions:
fset_color/font/insertion/click/format(text-like value to be edit, value)
translate(key, ...with(text-like values))
keybind(key)
hovertext(text-like value as base,text-like value as hover)

examples:
translate('chat.type.text',player,text);

x=''+fset_color('eee','red')+fset_insertion(format('e eee'),'click!');
print(hovertext(x,x))

图片

print(fset_font(keybind('key.inventory'),'alt')) //print e in enchanting table font

@Ghoulboy78 Ghoulboy78 marked this pull request as draft August 13, 2022 15:05
@Ghoulboy78
Copy link
Collaborator

Converting this to draft since it's waiting on a fabric-carpet pr

@Ghoulboy78 Ghoulboy78 added new-app About adding a new app on-hold Waiting for something somewhere labels Aug 13, 2022
@17183248569 17183248569 marked this pull request as ready for review August 30, 2022 11:28
@Ghoulboy78 Ghoulboy78 removed the on-hold Waiting for something somewhere label Aug 31, 2022
Copy link
Collaborator

@Ghoulboy78 Ghoulboy78 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't understand some parts of the code well enough to review them.
That's not to say it's bad code, but I cannot understand the reasons behind parts of the code.
Could you put more comments just in general?

programs/libraries/rjson.scl Outdated Show resolved Hide resolved
programs/libraries/rjson.scl Outdated Show resolved Hide resolved
programs/libraries/rjson.scl Show resolved Hide resolved
programs/libraries/rjson.scl Outdated Show resolved Hide resolved
Comment on lines +2 to +4
if(0, //if you are using an old version, change it to 1
//workaround for old version
//raw-json string to text
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't you use system_info('game_version') to try and do this automatically?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-app About adding a new app
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants