diff --git a/docs/changelog_v3.3.x.md b/docs/changelog_v3.3.x.md index ec162b514..61b63d1bd 100644 --- a/docs/changelog_v3.3.x.md +++ b/docs/changelog_v3.3.x.md @@ -17,6 +17,9 @@ These change logs represent the work that has been going on within prison. # 3.3.0-alpha.17 2024-04-29 +* **GUI Tools messages: refined the messages and hooked them up.** + + * **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. diff --git a/prison-core/src/main/java/tech/mcprison/prison/gui/PrisonCoreGuiMessages.java b/prison-core/src/main/java/tech/mcprison/prison/gui/PrisonCoreGuiMessages.java index 6f4406150..e9bdbbd4b 100644 --- a/prison-core/src/main/java/tech/mcprison/prison/gui/PrisonCoreGuiMessages.java +++ b/prison-core/src/main/java/tech/mcprison/prison/gui/PrisonCoreGuiMessages.java @@ -145,15 +145,25 @@ protected String guiPageToolsCloseMsg() { .getLocalizable( "core_gui__page_tools_close" ) .localize(); } + protected String guiPageToolsGoBackMsg() { + + return Prison.get().getLocaleManager() + .getLocalizable( "core_gui__page_tools_go_back" ) + .localize(); + } private String formmatPageToolsPlaceholders( String msg, int currentPage, int maxPage ) { + if ( maxPage < 1 ) { + maxPage = 1; + } int priorPage = currentPage == 1 ? 1 : currentPage - 1; int nextPage = currentPage == maxPage ? maxPage : currentPage + 1; - msg = msg.replace("{prior_page}", Integer.toString(priorPage) ) + msg = msg.replace("{first_page}", "1" ) + .replace("{prior_page}", Integer.toString(priorPage) ) .replace("{current_page}", Integer.toString(currentPage)) .replace("{next_page}", Integer.toString(nextPage)) - .replace("{max_page}", Integer.toString(maxPage)) + .replace("{last_page}", Integer.toString(maxPage)) ; return msg; @@ -166,6 +176,14 @@ protected String guiPageToolsCloseMsg( int currentPage, int maxPage ) { return formmatPageToolsPlaceholders( msg, currentPage, maxPage ); } + protected String guiPageToolsFirstPageMsg( int currentPage, int maxPage ) { + + String msg = Prison.get().getLocaleManager() + .getLocalizable( "core_gui__page_tools_first_page" ) + .localize(); + + return formmatPageToolsPlaceholders( msg, currentPage, maxPage ); + } protected String guiPageToolsPriorPageMsg( int currentPage, int maxPage ) { String msg = Prison.get().getLocaleManager() @@ -190,6 +208,15 @@ protected String guiPageToolsNextPageMsg( int currentPage, int maxPage ) { return formmatPageToolsPlaceholders( msg, currentPage, maxPage ); } + protected String guiPageToolsLastPageMsg( int currentPage, int maxPage ) { + + String msg = Prison.get().getLocaleManager() + .getLocalizable( "core_gui__page_tools_last_page" ) + .localize(); + + return formmatPageToolsPlaceholders( msg, currentPage, maxPage ); + } + protected String guiPriceMsg( Double price ) { diff --git a/prison-core/src/main/resources/lang/core/de_DE.properties b/prison-core/src/main/resources/lang/core/de_DE.properties index 1b6528f90..fa3866cf2 100644 --- a/prison-core/src/main/resources/lang/core/de_DE.properties +++ b/prison-core/src/main/resources/lang/core/de_DE.properties @@ -185,11 +185,14 @@ 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} +# {first_page} {prior_page} {current_page} {next_page} {last_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__page_tools_go_back=&3Go Back +core_gui__page_tools_first_page=&3Prior page: {first_page} of {last_page} +core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {last_page} +core_gui__page_tools_current_page=&3Current page: {current_page} of {last_page} +core_gui__page_tools_next_page=&3Next page: {next_page} of {last_page} +core_gui__page_tools_last_page=&3Last page: {last_page} of {last_page} core_gui__money_earned=&3You earned &a$%1 diff --git a/prison-core/src/main/resources/lang/core/en_GB.properties b/prison-core/src/main/resources/lang/core/en_GB.properties index 0b45c3642..469ec9e69 100644 --- a/prison-core/src/main/resources/lang/core/en_GB.properties +++ b/prison-core/src/main/resources/lang/core/en_GB.properties @@ -185,11 +185,14 @@ 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} +# {first_page} {prior_page} {current_page} {next_page} {last_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__page_tools_go_back=&3Go Back +core_gui__page_tools_first_page=&3Prior page: {first_page} of {last_page} +core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {last_page} +core_gui__page_tools_current_page=&3Current page: {current_page} of {last_page} +core_gui__page_tools_next_page=&3Next page: {next_page} of {last_page} +core_gui__page_tools_last_page=&3Last page: {last_page} of {last_page} core_gui__money_earned=&3You earned &a$%1 diff --git a/prison-core/src/main/resources/lang/core/en_US.properties b/prison-core/src/main/resources/lang/core/en_US.properties index 597163676..19f7bb39a 100644 --- a/prison-core/src/main/resources/lang/core/en_US.properties +++ b/prison-core/src/main/resources/lang/core/en_US.properties @@ -185,11 +185,14 @@ 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} +# {first_page} {prior_page} {current_page} {next_page} {last_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__page_tools_go_back=&3Go Back +core_gui__page_tools_first_page=&3Prior page: {first_page} of {last_page} +core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {last_page} +core_gui__page_tools_current_page=&3Current page: {current_page} of {last_page} +core_gui__page_tools_next_page=&3Next page: {next_page} of {last_page} +core_gui__page_tools_last_page=&3Last page: {last_page} of {last_page} core_gui__money_earned=&3You earned &a$%1 diff --git a/prison-core/src/main/resources/lang/core/es_ES.properties b/prison-core/src/main/resources/lang/core/es_ES.properties index d0adba4eb..071440daf 100644 --- a/prison-core/src/main/resources/lang/core/es_ES.properties +++ b/prison-core/src/main/resources/lang/core/es_ES.properties @@ -185,11 +185,14 @@ 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} +# {first_page} {prior_page} {current_page} {next_page} {last_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__page_tools_go_back=&3Go Back +core_gui__page_tools_first_page=&3Prior page: {first_page} of {last_page} +core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {last_page} +core_gui__page_tools_current_page=&3Current page: {current_page} of {last_page} +core_gui__page_tools_next_page=&3Next page: {next_page} of {last_page} +core_gui__page_tools_last_page=&3Last page: {last_page} of {last_page} core_gui__money_earned=&3You earned &a$%1 diff --git a/prison-core/src/main/resources/lang/core/fi_FI.properties b/prison-core/src/main/resources/lang/core/fi_FI.properties index 0674ff645..10574cbf5 100644 --- a/prison-core/src/main/resources/lang/core/fi_FI.properties +++ b/prison-core/src/main/resources/lang/core/fi_FI.properties @@ -185,11 +185,14 @@ 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} +# {first_page} {prior_page} {current_page} {next_page} {last_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__page_tools_go_back=&3Go Back +core_gui__page_tools_first_page=&3Prior page: {first_page} of {last_page} +core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {last_page} +core_gui__page_tools_current_page=&3Current page: {current_page} of {last_page} +core_gui__page_tools_next_page=&3Next page: {next_page} of {last_page} +core_gui__page_tools_last_page=&3Last page: {last_page} of {last_page} core_gui__money_earned=&3You earned &a$%1 diff --git a/prison-core/src/main/resources/lang/core/fr_FR.properties b/prison-core/src/main/resources/lang/core/fr_FR.properties index 073fe9206..a9d319fad 100644 --- a/prison-core/src/main/resources/lang/core/fr_FR.properties +++ b/prison-core/src/main/resources/lang/core/fr_FR.properties @@ -185,11 +185,14 @@ 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} +# {first_page} {prior_page} {current_page} {next_page} {last_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__page_tools_go_back=&3Go Back +core_gui__page_tools_first_page=&3Prior page: {first_page} of {last_page} +core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {last_page} +core_gui__page_tools_current_page=&3Current page: {current_page} of {last_page} +core_gui__page_tools_next_page=&3Next page: {next_page} of {last_page} +core_gui__page_tools_last_page=&3Last page: {last_page} of {last_page} core_gui__money_earned=&3Vous avez gagné &a$%1 diff --git a/prison-core/src/main/resources/lang/core/hu_HU.properties b/prison-core/src/main/resources/lang/core/hu_HU.properties index b4073a609..7e4062aa0 100644 --- a/prison-core/src/main/resources/lang/core/hu_HU.properties +++ b/prison-core/src/main/resources/lang/core/hu_HU.properties @@ -185,11 +185,14 @@ 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} +# {first_page} {prior_page} {current_page} {next_page} {last_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__page_tools_go_back=&3Go Back +core_gui__page_tools_first_page=&3Prior page: {first_page} of {last_page} +core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {last_page} +core_gui__page_tools_current_page=&3Current page: {current_page} of {last_page} +core_gui__page_tools_next_page=&3Next page: {next_page} of {last_page} +core_gui__page_tools_last_page=&3Last page: {last_page} of {last_page} core_gui__money_earned=&3You earned &a$%1 diff --git a/prison-core/src/main/resources/lang/core/it_IT.properties b/prison-core/src/main/resources/lang/core/it_IT.properties index e71de8c6a..1a2f28993 100644 --- a/prison-core/src/main/resources/lang/core/it_IT.properties +++ b/prison-core/src/main/resources/lang/core/it_IT.properties @@ -185,11 +185,14 @@ 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} +# {first_page} {prior_page} {current_page} {next_page} {last_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__page_tools_go_back=&3Go Back +core_gui__page_tools_first_page=&3Prior page: {first_page} of {last_page} +core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {last_page} +core_gui__page_tools_current_page=&3Current page: {current_page} of {last_page} +core_gui__page_tools_next_page=&3Next page: {next_page} of {last_page} +core_gui__page_tools_last_page=&3Last page: {last_page} of {last_page} core_gui__money_earned=&3You earned &a$%1 diff --git a/prison-core/src/main/resources/lang/core/nl_BE.properties b/prison-core/src/main/resources/lang/core/nl_BE.properties index d7bc76f04..4ad3da75f 100644 --- a/prison-core/src/main/resources/lang/core/nl_BE.properties +++ b/prison-core/src/main/resources/lang/core/nl_BE.properties @@ -185,11 +185,14 @@ 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} +# {first_page} {prior_page} {current_page} {next_page} {last_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__page_tools_go_back=&3Go Back +core_gui__page_tools_first_page=&3Prior page: {first_page} of {last_page} +core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {last_page} +core_gui__page_tools_current_page=&3Current page: {current_page} of {last_page} +core_gui__page_tools_next_page=&3Next page: {next_page} of {last_page} +core_gui__page_tools_last_page=&3Last page: {last_page} of {last_page} core_gui__money_earned=&3You earned &a$%1 diff --git a/prison-core/src/main/resources/lang/core/nl_NL.properties b/prison-core/src/main/resources/lang/core/nl_NL.properties index 1eba1da5a..88f1a3261 100644 --- a/prison-core/src/main/resources/lang/core/nl_NL.properties +++ b/prison-core/src/main/resources/lang/core/nl_NL.properties @@ -185,11 +185,14 @@ 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} +# {first_page} {prior_page} {current_page} {next_page} {last_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__page_tools_go_back=&3Go Back +core_gui__page_tools_first_page=&3Prior page: {first_page} of {last_page} +core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {last_page} +core_gui__page_tools_current_page=&3Current page: {current_page} of {last_page} +core_gui__page_tools_next_page=&3Next page: {next_page} of {last_page} +core_gui__page_tools_last_page=&3Last page: {last_page} of {last_page} core_gui__money_earned=&3You earned &a$%1 diff --git a/prison-core/src/main/resources/lang/core/pt_PT.properties b/prison-core/src/main/resources/lang/core/pt_PT.properties index 813a39b0e..30f5072b9 100644 --- a/prison-core/src/main/resources/lang/core/pt_PT.properties +++ b/prison-core/src/main/resources/lang/core/pt_PT.properties @@ -185,11 +185,14 @@ 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} +# {first_page} {prior_page} {current_page} {next_page} {last_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__page_tools_go_back=&3Go Back +core_gui__page_tools_first_page=&3Prior page: {first_page} of {last_page} +core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {last_page} +core_gui__page_tools_current_page=&3Current page: {current_page} of {last_page} +core_gui__page_tools_next_page=&3Next page: {next_page} of {last_page} +core_gui__page_tools_last_page=&3Last page: {last_page} of {last_page} core_gui__money_earned=&3You earned &a$%1 diff --git a/prison-core/src/main/resources/lang/core/ro_RO.properties b/prison-core/src/main/resources/lang/core/ro_RO.properties index 4322a22fc..aa7a2f680 100644 --- a/prison-core/src/main/resources/lang/core/ro_RO.properties +++ b/prison-core/src/main/resources/lang/core/ro_RO.properties @@ -185,11 +185,14 @@ 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} +# {first_page} {prior_page} {current_page} {next_page} {last_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__page_tools_go_back=&3Go Back +core_gui__page_tools_first_page=&3Prior page: {first_page} of {last_page} +core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {last_page} +core_gui__page_tools_current_page=&3Current page: {current_page} of {last_page} +core_gui__page_tools_next_page=&3Next page: {next_page} of {last_page} +core_gui__page_tools_last_page=&3Last page: {last_page} of {last_page} core_gui__money_earned=&3You earned &a$%1 diff --git a/prison-core/src/main/resources/lang/core/zh-CN.properties b/prison-core/src/main/resources/lang/core/zh-CN.properties index 45dea7d4a..6a036fd92 100644 --- a/prison-core/src/main/resources/lang/core/zh-CN.properties +++ b/prison-core/src/main/resources/lang/core/zh-CN.properties @@ -185,11 +185,14 @@ 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} +# {first_page} {prior_page} {current_page} {next_page} {last_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__page_tools_go_back=&3Go Back +core_gui__page_tools_first_page=&3Prior page: {first_page} of {last_page} +core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {last_page} +core_gui__page_tools_current_page=&3Current page: {current_page} of {last_page} +core_gui__page_tools_next_page=&3Next page: {next_page} of {last_page} +core_gui__page_tools_last_page=&3Last page: {last_page} of {last_page} core_gui__money_earned=&3You earned &a$%1 diff --git a/prison-core/src/main/resources/lang/core/zh_TW.properties b/prison-core/src/main/resources/lang/core/zh_TW.properties index 754f827cb..d8daac534 100644 --- a/prison-core/src/main/resources/lang/core/zh_TW.properties +++ b/prison-core/src/main/resources/lang/core/zh_TW.properties @@ -185,11 +185,14 @@ 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} +# {first_page} {prior_page} {current_page} {next_page} {last_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__page_tools_go_back=&3Go Back +core_gui__page_tools_first_page=&3Prior page: {first_page} of {last_page} +core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {last_page} +core_gui__page_tools_current_page=&3Current page: {current_page} of {last_page} +core_gui__page_tools_next_page=&3Next page: {next_page} of {last_page} +core_gui__page_tools_last_page=&3Last page: {last_page} of {last_page} core_gui__money_earned=&3You earned &a$%1 diff --git a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/gui/SpigotGUIMenuTools.java b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/gui/SpigotGUIMenuTools.java index dfc9eb63e..4ddb6322c 100644 --- a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/gui/SpigotGUIMenuTools.java +++ b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/gui/SpigotGUIMenuTools.java @@ -12,6 +12,7 @@ import com.cryptomorin.xseries.XMaterial; import tech.mcprison.prison.Prison; +import tech.mcprison.prison.gui.PrisonCoreGuiMessages; import tech.mcprison.prison.spigot.gui.guiutility.Button; import tech.mcprison.prison.spigot.gui.guiutility.ButtonLore; import tech.mcprison.prison.spigot.gui.guiutility.PrisonGUI; @@ -19,6 +20,7 @@ import tech.mcprison.prison.util.Text; public class SpigotGUIMenuTools + extends PrisonCoreGuiMessages { public static final String GUI_MENU_TOOLS_PAGE = "GUIPage"; @@ -476,8 +478,11 @@ public Button createButtonBack( GUIMenuPageData pageData, int position ) { newPageData.setCommandToRun( pageData.getCommandGoBack() ); newPageData.setCommandGoBack( null ); + String msgClose = guiPageToolsCloseMsg(); + String msgGoBack = guiPageToolsGoBackMsg(); + String message = pageData.getCommandGoBack().equalsIgnoreCase( "close" ) ? - "Close" : "Go Back"; + msgClose : msgGoBack; // ButtonLore buttonLore = createButtonLore( true, newPageData, 0 ); ButtonLore buttonLore = null; @@ -501,7 +506,8 @@ public Button createButtonPageOne( GUIMenuPageData pageData, int position ) { int pageNumber = 1; - String message = "Page 1 of " + pageData.getPageLast(); + String msg = guiPageToolsFirstPageMsg( pageData.getPage(), pageData.getPageLast() ); +// String message = "Page 1 of " + pageData.getPageLast(); // ButtonLore buttonLore = createButtonLore( active, pageData, pageNumber ); ButtonLore buttonLore = null; @@ -511,7 +517,7 @@ public Button createButtonPageOne( GUIMenuPageData pageData, int position ) { XMaterial xMat = !active ? menuStateOff2 : menuStateOn2; - Button guiButton = new Button( pos, xMat, pageNumber, buttonLore, message ); + Button guiButton = new Button( pos, xMat, pageNumber, buttonLore, msg ); addButtonNBT( guiButton, pageData, pageNumber ); @@ -522,9 +528,11 @@ public Button createButtonPagePrior( GUIMenuPageData pageData, int position ) { boolean active = !useDisabledButtons ||pageData.getPagePrior() > 0; + String msg = guiPageToolsPriorPageMsg( pageData.getPage(), pageData.getPageLast() ); + int pageNumber = pageData.getPagePrior() < 1 ? 1 : pageData.getPagePrior(); - + int lastPageNumber = pageData.getPageLast() < 1 ? 1 : pageData.getPageLast(); @@ -532,7 +540,7 @@ public Button createButtonPagePrior( GUIMenuPageData pageData, int position ) { return createButtonMenuBackground( pageData, position ); } - String message = "Page " + pageNumber + " of " + lastPageNumber; +// String message = "Page " + pageNumber + " of " + lastPageNumber; // ButtonLore buttonLore = createButtonLore( active, pageData, pageNumber ); ButtonLore buttonLore = null; @@ -542,7 +550,7 @@ public Button createButtonPagePrior( GUIMenuPageData pageData, int position ) { XMaterial xMat = !active ? menuStateOff1 : menuStateOn1; - Button guiButton = new Button( pos, xMat, pageNumber, buttonLore, message ); + Button guiButton = new Button( pos, xMat, pageNumber, buttonLore, msg ); addButtonNBT( guiButton, pageData, pageNumber ); @@ -553,7 +561,9 @@ public Button createButtonPageCurrent( GUIMenuPageData pageData, int position ) int pageNumber = pageData.getPage(); - String message = "Page " + pageNumber + " of " + pageData.getPageLast(); + String msg = guiPageToolsCurrentPageMsg( pageData.getPage(), pageData.getPageLast() ); + +// String message = "Page " + pageNumber + " of " + pageData.getPageLast(); // ButtonLore buttonLore = createButtonLore( false, pageData, pageNumber ); ButtonLore buttonLore = null; @@ -562,7 +572,7 @@ public Button createButtonPageCurrent( GUIMenuPageData pageData, int position ) XMaterial xMat = XMaterial.COMPASS; - Button guiButton = new Button( pos, xMat, pageNumber, buttonLore, message ); + Button guiButton = new Button( pos, xMat, pageNumber, buttonLore, msg ); addButtonNBT( guiButton, pageData, pageNumber ); @@ -573,6 +583,9 @@ public Button createButtonPageNext( GUIMenuPageData pageData, int position ) { boolean active = !useDisabledButtons ||pageData.getPageNext() > 0; + String msg = guiPageToolsNextPageMsg( pageData.getPage(), pageData.getPageLast() ); + + int pageNumber = pageData.getPageNext() < 1 ? pageData.getPageLast() : pageData.getPageNext(); @@ -583,7 +596,7 @@ public Button createButtonPageNext( GUIMenuPageData pageData, int position ) { return createButtonMenuBackground( pageData, position ); } - String message = "Page " + pageNumber + " of " + lastPageNumber; +// String message = "Page " + pageNumber + " of " + lastPageNumber; // ButtonLore buttonLore = createButtonLore( active, pageData, pageNumber ); ButtonLore buttonLore = null; @@ -593,7 +606,7 @@ public Button createButtonPageNext( GUIMenuPageData pageData, int position ) { XMaterial xMat = !active ? menuStateOff1 : menuStateOn1; - Button guiButton = new Button( pos, xMat, pageNumber, buttonLore, message ); + Button guiButton = new Button( pos, xMat, pageNumber, buttonLore, msg ); addButtonNBT( guiButton, pageData, pageNumber ); @@ -604,10 +617,12 @@ public Button createButtonPageLast( GUIMenuPageData pageData, int position ) { boolean active = !useDisabledButtons ||pageData.getPage() < pageData.getPageLast(); + String msg = guiPageToolsLastPageMsg( pageData.getPage(), pageData.getPageLast() ); + int pageNumber = pageData.getPageLast() < 1 ? pageData.getPageLast() : pageData.getPageLast(); - String message = "Page " + pageNumber + " of " + pageData.getPageLast(); +// String message = "Page " + pageNumber + " of " + pageData.getPageLast(); ButtonLore buttonLore = null; // ButtonLore buttonLore = createButtonLore( active, pageData, pageNumber ); @@ -617,7 +632,7 @@ public Button createButtonPageLast( GUIMenuPageData pageData, int position ) { XMaterial xMat = !active ? menuStateOff2 : menuStateOn2; - Button guiButton = new Button( pos, xMat, pageNumber, buttonLore, message ); + Button guiButton = new Button( pos, xMat, pageNumber, buttonLore, msg ); addButtonNBT( guiButton, pageData, pageNumber );