Skip to content

Commit

Permalink
Initial setup of the GUI tools messages that are at the bottom of a p…
Browse files Browse the repository at this point in the history
…age.

Setup the handling of the messages and added the messages to all of the language files.
Support for prior, current, and next page. Also close.
  • Loading branch information
rbluer committed Apr 29, 2024
1 parent dc2d0e7 commit 7557b13
Show file tree
Hide file tree
Showing 16 changed files with 198 additions and 15 deletions.
7 changes: 6 additions & 1 deletion docs/changelog_v3.3.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@
These change logs represent the work that has been going on within prison.


# 3.3.0-alpha.17 2024-04-28
# 3.3.0-alpha.17 2024-04-29


* **Initial setup of the GUI tools messages that are at the bottom of a page.**
Setup the handling of the messages and added the messages to all of the language files.
Support for prior, current, and next page. Also close.


* **Update the plugin.yml and removed the permissions configs since they were generating errors (lack of a schema) and the perms and handled through the prison command handler.**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,58 @@ protected String guiPagePriorMsg() {
.getLocalizable( "core_gui__page_prior" )
.localize();
}

protected String guiPageToolsCloseMsg() {

return Prison.get().getLocaleManager()
.getLocalizable( "core_gui__page_tools_close" )
.localize();
}
private String formmatPageToolsPlaceholders( String msg, int currentPage, int maxPage ) {

int priorPage = currentPage == 1 ? 1 : currentPage - 1;
int nextPage = currentPage == maxPage ? maxPage : currentPage + 1;

msg = msg.replace("{prior_page}", Integer.toString(priorPage) )
.replace("{current_page}", Integer.toString(currentPage))
.replace("{next_page}", Integer.toString(nextPage))
.replace("{max_page}", Integer.toString(maxPage))
;

return msg;
}
protected String guiPageToolsCloseMsg( int currentPage, int maxPage ) {

String msg = Prison.get().getLocaleManager()
.getLocalizable( "core_gui__page_tools_close" )
.localize();

return formmatPageToolsPlaceholders( msg, currentPage, maxPage );
}
protected String guiPageToolsPriorPageMsg( int currentPage, int maxPage ) {

String msg = Prison.get().getLocaleManager()
.getLocalizable( "core_gui__page_tools_prior_page" )
.localize();

return formmatPageToolsPlaceholders( msg, currentPage, maxPage );
}
protected String guiPageToolsCurrentPageMsg( int currentPage, int maxPage ) {

String msg = Prison.get().getLocaleManager()
.getLocalizable( "core_gui__page_tools_current_page" )
.localize();

return formmatPageToolsPlaceholders( msg, currentPage, maxPage );
}
protected String guiPageToolsNextPageMsg( int currentPage, int maxPage ) {

String msg = Prison.get().getLocaleManager()
.getLocalizable( "core_gui__page_tools_next_page" )
.localize();

return formmatPageToolsPlaceholders( msg, currentPage, maxPage );
}


protected String guiPriceMsg( Double price ) {
Expand Down
11 changes: 10 additions & 1 deletion prison-core/src/main/resources/lang/core/de_DE.properties
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
# like to share, please contact a staff member on our Discord server.
#Thanks for your contributions!
#
messages__version=9
messages__version=10
messages__auto_refresh=true


Expand Down Expand Up @@ -182,6 +182,15 @@ core_gui__right_click_and_shift_to_toggle=&3Right-Click and shift to toggle.
core_gui__page_next=&3Next page.
core_gui__page_prior=&3Prior page.

# Note: The core_gui__page_tools_ messages all use the following placeholders
# so you can structure them any way you need to. You not no have to use
# any of them, but you can also use all of them.
# {prior_page} {current_page} {next_page} {max_page}
core_gui__page_tools_close=&3Close
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {max_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {max_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {max_page}


core_gui__money_earned=&3You earned &a$%1
core_gui__price=&3Price: %1
Expand Down
11 changes: 10 additions & 1 deletion prison-core/src/main/resources/lang/core/en_GB.properties
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
# like to share, please contact a staff member on our Discord server.
#Thanks for your contributions!
#
messages__version=9
messages__version=10
messages__auto_refresh=true


Expand Down Expand Up @@ -182,6 +182,15 @@ core_gui__right_click_and_shift_to_toggle=&3Right-Click and shift to toggle.
core_gui__page_next=&3Next page.
core_gui__page_prior=&3Prior page.

# Note: The core_gui__page_tools_ messages all use the following placeholders
# so you can structure them any way you need to. You not no have to use
# any of them, but you can also use all of them.
# {prior_page} {current_page} {next_page} {max_page}
core_gui__page_tools_close=&3Close
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {max_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {max_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {max_page}


core_gui__money_earned=&3You earned &a$%1
core_gui__price=&3Price: %1
Expand Down
11 changes: 10 additions & 1 deletion prison-core/src/main/resources/lang/core/en_US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
# like to share, please contact a staff member on our Discord server.
#Thanks for your contributions!
#
messages__version=10
messages__version=11
messages__auto_refresh=true


Expand Down Expand Up @@ -182,6 +182,15 @@ core_gui__right_click_and_shift_to_toggle=&3Right-Click and shift to toggle.
core_gui__page_next=&3Next page.
core_gui__page_prior=&3Prior page.

# Note: The core_gui__page_tools_ messages all use the following placeholders
# so you can structure them any way you need to. You not no have to use
# any of them, but you can also use all of them.
# {prior_page} {current_page} {next_page} {max_page}
core_gui__page_tools_close=&3Close
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {max_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {max_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {max_page}


core_gui__money_earned=&3You earned &a$%1
core_gui__price=&3Price: %1
Expand Down
11 changes: 10 additions & 1 deletion prison-core/src/main/resources/lang/core/es_ES.properties
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
# like to share, please contact a staff member on our Discord server.
#Thanks for your contributions!
#
messages__version=9
messages__version=10
messages__auto_refresh=true


Expand Down Expand Up @@ -182,6 +182,15 @@ core_gui__right_click_and_shift_to_toggle=&3Right-Click and shift to toggle.
core_gui__page_next=&3Next page.
core_gui__page_prior=&3Prior page.

# Note: The core_gui__page_tools_ messages all use the following placeholders
# so you can structure them any way you need to. You not no have to use
# any of them, but you can also use all of them.
# {prior_page} {current_page} {next_page} {max_page}
core_gui__page_tools_close=&3Close
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {max_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {max_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {max_page}


core_gui__money_earned=&3You earned &a$%1
core_gui__price=&3Price: %1
Expand Down
11 changes: 10 additions & 1 deletion prison-core/src/main/resources/lang/core/fi_FI.properties
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
# like to share, please contact a staff member on our Discord server.
#Thanks for your contributions!
#
messages__version=10
messages__version=11
messages__auto_refresh=true


Expand Down Expand Up @@ -182,6 +182,15 @@ core_gui__right_click_and_shift_to_toggle=&3Right-Click and shift to toggle.
core_gui__page_next=&3Next page.
core_gui__page_prior=&3Prior page.

# Note: The core_gui__page_tools_ messages all use the following placeholders
# so you can structure them any way you need to. You not no have to use
# any of them, but you can also use all of them.
# {prior_page} {current_page} {next_page} {max_page}
core_gui__page_tools_close=&3Close
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {max_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {max_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {max_page}


core_gui__money_earned=&3You earned &a$%1
core_gui__price=&3Price: %1
Expand Down
11 changes: 10 additions & 1 deletion prison-core/src/main/resources/lang/core/fr_FR.properties
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
# like to share, please contact a staff member on our Discord server.
#Thanks for your contributions!
#
messages__version=10
messages__version=11
messages__auto_refresh=true


Expand Down Expand Up @@ -182,6 +182,15 @@ core_gui__right_click_and_shift_to_toggle=&3Clique-droit et maj pour basculer.
core_gui__page_next=&3Page suivante.
core_gui__page_prior=&3Page précedente.

# Note: The core_gui__page_tools_ messages all use the following placeholders
# so you can structure them any way you need to. You not no have to use
# any of them, but you can also use all of them.
# {prior_page} {current_page} {next_page} {max_page}
core_gui__page_tools_close=&3Close
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {max_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {max_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {max_page}


core_gui__money_earned=&3Vous avez gagné &a$%1
core_gui__price=&3Prix: %1
Expand Down
11 changes: 10 additions & 1 deletion prison-core/src/main/resources/lang/core/hu_HU.properties
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
# like to share, please contact a staff member on our Discord server.
#Thanks for your contributions!
#
messages__version=9
messages__version=10
messages__auto_refresh=true


Expand Down Expand Up @@ -182,6 +182,15 @@ core_gui__right_click_and_shift_to_toggle=&3Right-Click and shift to toggle.
core_gui__page_next=&3Next page.
core_gui__page_prior=&3Prior page.

# Note: The core_gui__page_tools_ messages all use the following placeholders
# so you can structure them any way you need to. You not no have to use
# any of them, but you can also use all of them.
# {prior_page} {current_page} {next_page} {max_page}
core_gui__page_tools_close=&3Close
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {max_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {max_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {max_page}


core_gui__money_earned=&3You earned &a$%1
core_gui__price=&3Price: %1
Expand Down
11 changes: 10 additions & 1 deletion prison-core/src/main/resources/lang/core/it_IT.properties
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
# like to share, please contact a staff member on our Discord server.
#Thanks for your contributions!
#
messages__version=9
messages__version=10
messages__auto_refresh=true


Expand Down Expand Up @@ -182,6 +182,15 @@ core_gui__right_click_and_shift_to_toggle=&3Right-Click and shift to toggle.
core_gui__page_next=&3Next page.
core_gui__page_prior=&3Prior page.

# Note: The core_gui__page_tools_ messages all use the following placeholders
# so you can structure them any way you need to. You not no have to use
# any of them, but you can also use all of them.
# {prior_page} {current_page} {next_page} {max_page}
core_gui__page_tools_close=&3Close
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {max_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {max_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {max_page}


core_gui__money_earned=&3You earned &a$%1
core_gui__price=&3Price: %1
Expand Down
11 changes: 10 additions & 1 deletion prison-core/src/main/resources/lang/core/nl_BE.properties
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
# like to share, please contact a staff member on our Discord server.
#Thanks for your contributions!
#
messages__version=9
messages__version=10
messages__auto_refresh=true


Expand Down Expand Up @@ -182,6 +182,15 @@ core_gui__right_click_and_shift_to_toggle=&3Right-Click and shift to toggle.
core_gui__page_next=&3Next page.
core_gui__page_prior=&3Prior page.

# Note: The core_gui__page_tools_ messages all use the following placeholders
# so you can structure them any way you need to. You not no have to use
# any of them, but you can also use all of them.
# {prior_page} {current_page} {next_page} {max_page}
core_gui__page_tools_close=&3Close
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {max_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {max_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {max_page}


core_gui__money_earned=&3You earned &a$%1
core_gui__price=&3Price: %1
Expand Down
11 changes: 10 additions & 1 deletion prison-core/src/main/resources/lang/core/nl_NL.properties
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
# like to share, please contact a staff member on our Discord server.
#Thanks for your contributions!
#
messages__version=9
messages__version=10
messages__auto_refresh=true


Expand Down Expand Up @@ -182,6 +182,15 @@ core_gui__right_click_and_shift_to_toggle=&3Right-Click and shift to toggle.
core_gui__page_next=&3Next page.
core_gui__page_prior=&3Prior page.

# Note: The core_gui__page_tools_ messages all use the following placeholders
# so you can structure them any way you need to. You not no have to use
# any of them, but you can also use all of them.
# {prior_page} {current_page} {next_page} {max_page}
core_gui__page_tools_close=&3Close
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {max_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {max_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {max_page}


core_gui__money_earned=&3You earned &a$%1
core_gui__price=&3Price: %1
Expand Down
11 changes: 10 additions & 1 deletion prison-core/src/main/resources/lang/core/pt_PT.properties
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
# like to share, please contact a staff member on our Discord server.
#Thanks for your contributions!
#
messages__version=5
messages__version=6
messages__auto_refresh=true


Expand Down Expand Up @@ -182,6 +182,15 @@ core_gui__right_click_and_shift_to_toggle=&3Clique-Direito e shift para ativar/d
core_gui__page_next=&3Pagina seguinte.
core_gui__page_prior=&3Pagina anterior.

# Note: The core_gui__page_tools_ messages all use the following placeholders
# so you can structure them any way you need to. You not no have to use
# any of them, but you can also use all of them.
# {prior_page} {current_page} {next_page} {max_page}
core_gui__page_tools_close=&3Close
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {max_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {max_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {max_page}


core_gui__money_earned=&3You earned &a$%1
core_gui__price=&3Preco: %1
Expand Down
11 changes: 10 additions & 1 deletion prison-core/src/main/resources/lang/core/ro_RO.properties
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
#


messages__version=4
messages__version=5
messages__auto_refresh=true


Expand Down Expand Up @@ -182,6 +182,15 @@ core_gui__right_click_and_shift_to_toggle=&3Right-Click and shift to toggle.
core_gui__page_next=&3Next page.
core_gui__page_prior=&3Prior page.

# Note: The core_gui__page_tools_ messages all use the following placeholders
# so you can structure them any way you need to. You not no have to use
# any of them, but you can also use all of them.
# {prior_page} {current_page} {next_page} {max_page}
core_gui__page_tools_close=&3Close
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {max_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {max_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {max_page}


core_gui__money_earned=&3You earned &a$%1
core_gui__price=&3Price: %1
Expand Down
11 changes: 10 additions & 1 deletion prison-core/src/main/resources/lang/core/zh-CN.properties
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
# like to share, please contact a staff member on our Discord server.
#Thanks for your contributions!
#
messages__version=8
messages__version=9
messages__auto_refresh=true


Expand Down Expand Up @@ -182,6 +182,15 @@ core_gui__right_click_and_shift_to_toggle=&3右键单击并按住shift键切换
core_gui__page_next=&3下一页
core_gui__page_prior=&3上一页

# Note: The core_gui__page_tools_ messages all use the following placeholders
# so you can structure them any way you need to. You not no have to use
# any of them, but you can also use all of them.
# {prior_page} {current_page} {next_page} {max_page}
core_gui__page_tools_close=&3Close
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {max_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {max_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {max_page}


core_gui__money_earned=&3You earned &a$%1
core_gui__price=&3价格:%1
Expand Down

0 comments on commit 7557b13

Please sign in to comment.