Skip to content

Commit

Permalink
(Pull) Welcome message (runs once) #66
Browse files Browse the repository at this point in the history
  • Loading branch information
FrutyX authored Nov 9, 2022
2 parents e9d86eb + 23d538d commit 616066f
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 0 deletions.
5 changes: 5 additions & 0 deletions source/core/locale/cs.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ gca_languages['cs'] = {
message_empty : "Gildovní zprávy jsou prázdné",
message_exclude_me : "Vyloučit mne",

// Welcome message - text
welcome_addon : "Vítá vás Gladiatus Crazy Addon!",
welcome_version : "Aktuální nainstalovaná verze je",
welcome_changelog : "Přehled změn",

// Button bar buttons
guild_market_goto : "Gildovní tržiště",
guild_storage_goto : "Skladiště",
Expand Down
5 changes: 5 additions & 0 deletions source/core/locale/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ gca_languages["en"] = {
message_sent_failed : "Failed to sent message",
message_empty : "The message is empty",
message_exclude_me : "Exclude me",

// Welcome message - text
welcome_addon : "Welcome to Gladiatus Crazy Addon!",
welcome_version : "The current installed version is",
welcome_changelog : "Changelogs",

// Button bar buttons
guild_market_goto : "Go to guild's market",
Expand Down
Binary file added source/core/resources/icons/icon_64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions source/core/source/gca.data.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

// Data
var gca_data = {
//Welcome message
data : {welcomeOnce: true},
// Get a value
get : function(name, defvalue){
if(this.data[name] != undefined)
Expand Down
2 changes: 2 additions & 0 deletions source/core/source/gca.tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -1657,6 +1657,8 @@ var gca_tools = {
var button = document.createElement("input");
button.setAttribute("type", "button");
button.className = "awesome-button big";
button.style.width = "auto";
button.style.minWidth = "60px";
button.value = text;
this.buttons_wrapper.appendChild(button);

Expand Down
25 changes: 25 additions & 0 deletions source/core/source/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ var gca_global = {

// Resolve Game Modes
this.gameModePreResolve();

// Welcome message
this.welcomeMessage();

// If Event bar was active
(gca_data.section.get("cache", "event_bar_active", 0) && (gca_options.bool("global","shortcuts_bar") || gca_options.bool("global","auction_status_bar") || gca_options.bool("global","extended_hp_xp_info")) &&
Expand Down Expand Up @@ -425,6 +428,28 @@ var gca_global = {
if (!localStorage.getItem('gca_rtl'))
localStorage.setItem('gca_rtl', 'true');
},

//Welcome message, runs only once
welcomeMessage: function () {
if (gca_data.get("welcomeOnce", true)) {
var modal = new gca_tools.Modal(
gca_locale.get("global", "welcome_addon"),
null,
() => {
modal.destroy();
},
() => {
window.open('https://github.com/DinoDevs/GladiatusCrazyAddon/releases', '_blank'),
modal.show();
});
modal.img.src = gca_resources.folder + 'icons/icon_64.png';
modal.body(gca_locale.get("global", "welcome_version") + " " + gca.version + ".");
modal.button(gca_locale.get("general", "ok"), true);
modal.button(gca_locale.get("global", "welcome_changelog"), false);
modal.show();
gca_data.set("welcomeOnce", false);
}
},

// Display stuff
display : {
Expand Down

0 comments on commit 616066f

Please sign in to comment.