1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2024-12-28 23:06:38 +02:00

welcome modal

This commit is contained in:
danielmartin0 2024-09-07 17:37:24 +01:00
parent 41c04ee9ac
commit 26ba5478b2
12 changed files with 117 additions and 53 deletions

View File

@ -100,7 +100,7 @@ require 'utils.remote_chunks'
--require 'maps.chronosphere.main'
--![[Adventure as a crew of pirates]]--
--require 'maps.pirates.main'
require 'maps.pirates.main'
--![[Launch rockets in increasingly harder getting worlds.]]--
--require 'maps.journey.main'

View File

@ -4,7 +4,7 @@ softmod_info_header_after_version_number= ===
softmod_info_body_1=News and chat: getcomfy.eu/discord
softmod_info_game_description_1=Game Description
softmod_info_game_description_2=Set sail in this multiplayer scenario. Collect resources and fuel the ship in order to survive as many leagues as possible. The ship moves with code magic. Each crew has a captain, who performs actions such as deciding when the boat leaves. Doubloons can be spent at various markets throughout the game.\n\nGame progression is significantly slowed the smaller the crew.\n\n[font=default-bold]Win condition:[/font] Travel 1000 leagues.\n[font=default-bold]Lose condition:[/font] The ship runs out of fuel, or a cannon is destroyed.
softmod_info_game_description_2=Set sail in this multiplayer scenario. Collect resources and fuel the ship in order to survive as many leagues as possible. Each crew has a captain, who performs actions such as deciding when the boat leaves. Doubloons can be spent at various markets throughout the game. Game progression is slower for smaller crews. Mysteries await!\n\n[font=default-bold]Win condition:[/font] Travel 1000 leagues.\n[font=default-bold]Lose condition:[/font] The ship runs out of fuel, or a cannon is destroyed.
# softmod_info_bugs_1=Known issues
# softmod_info_bugs_2=•
@ -16,12 +16,12 @@ softmod_info_tips_1=Features of the game that are hard to work out alone
softmod_info_tips_2=• The captain can steer the boat from the crow's nest by placing 50 rail signals in one of the blue boxes.\n• Resources granted to the ship appear in the captain's cabin.\n• Charging a silo drains power from everything else on its network.\n• The quantity of ore available on an island is independent of the order in which you break rocks.\n• Passive pollution ramps up over time on each island.\n• The strength of attacks is proportional to the number of remaining nests. (The time-based rate of evolution is proportional to nests too, but destroying a nest will immediately jump evolution by most of the amount it 'would have' made had it survived.)\n• item-on-ground entities on the deck are moved to the cabin when the boat moves, for performance reasons.\n• Commands: /ccolor gives you a fun color. /classinfo {classname} gives the description of the named class. To manage your class, use /take {classname} or /giveup.
softmod_info_updates_1=Significant recent changes
softmod_info_updates_2=v1.5.2\n• Elite biters now also appear in Easy/Normal difficulties from league 800.\n• Elite biters now also spawn 4 non-elite biters on death.\n• When player rejoins the game within 1 minute, he will spawn where he was when he left, instead of on the boat.\n• "Kovarex-enrichment-process" recipe is now researched by default\n• Bugfixes.\n\nv1.5.1\n• Greatly increased biter wave sizes on harder difficulties.\n• Reduced amount of resources and rewards that can be acquired. However all rewards (such as plates from chests and coin rewards from launching rocket) now scale with leagues.\n• Possible fix for some desync cases.\n• Bugfixes.
softmod_info_updates_2=v1.6.0\n• TBC\n\nv1.5.2\n• Elite biters now also appear in Easy/Normal difficulties from league 800.\n• Elite biters now also spawn 4 non-elite biters on death.\n• When player rejoins the game within 1 minute, he will spawn where he was when he left, instead of on the boat.\n• "Kovarex-enrichment-process" recipe is now researched by default\n• Bugfixes.\n\nv1.5.1\n• Greatly increased biter wave sizes on harder difficulties.\n• Reduced amount of resources and rewards that can be acquired. However all rewards (such as plates from chests and coin rewards from launching rocket) now scale with leagues.\n• Possible fix for some desync cases.\n• Bugfixes.
softmod_info_credits_1=Credits
softmod_info_credits_2=Pirate Ship designed and coded by thesixthroc. Updates from Piratux. Comfy codebase and help from Gerkiz, Hanakocz and Mew @ Comfy Industries (https://getcomfy.eu). Some island structure blueprints contributed by Mattisso.\n\nCome chat with us: https://getcomfy.eu/discord\n\n"Those white gloves. I'll never forget them 'till the day I die." - Dr. John
softmod_info_credits_2=Designed and developed by thesixthroc. Updates from Piratux. Comfy codebase and help from Gerkiz, Hanakocz and Mew @ Comfy Industries (https://getcomfy.eu). Island structure blueprints contributed by Mattisso.\n\nCome chat with us: https://getcomfy.eu/discord\n\n"Those white gloves. I'll never forget them 'till the day I die." - Dr. John
softmod_info_credits_2_old=Softmod designed and written by thesixthroc. Comfy codebase help from Gerkiz, Hanakocz and Mew @ Comfy Industries (https://getcomfy.eu). Some island structure blueprints were contributed by Mattisso. Gold sprite by Clint Bellanger. Parrot sprites by @pixelthen.\n\n"Those white gloves. I'll never forget them 'till the day I die." - Dr. John
thesixthroc_support_toast=Support Pirate Ship scenario design at ko-fi.com/thesixthroc
thesixthroc_support_toast=Support Pirate Ship at ko-fi.com/thesixthroc
softmod_info_body_promote=by thesixthroc
softmod_info_body_promote_old2=patreon.com/thesixthroc
@ -76,9 +76,9 @@ parrot_cave_tip_1=That island looks suspiciously dark... I'm scared! Squawk!
parrot_captain_first_time_in_cabin_hint=Squawk! Captains and officers can buy rail signals to steer the ship!
parrot_cliff_explosive_tip=Cliff explosives? These look so powerful, they could blow away those annoying chests in the hold. Squawk!
parrot_buried_treasure_tip=Squawk! If X marks the spot - use an item to dig with!
parrot_captain_left_protected_run=Uh oh, looks like the captain left. Since this is protected run, the captain role will not be redistributed.
parrot_player_joins_protected_run_with_no_captain=This run has captain protection turned on, so you will have to wait for captain to come back to control the ship.
parrot_create_new_crew_tip=You can always join/create another run from the lobby by exiting current run by clicking red flag on top then clicking Quit Crew.
parrot_captain_left_protected_run=Uh oh, looks like the captain left. Since this is protected crew, the captain role will not be redistributed.
parrot_player_joins_protected_run_with_no_captain=This crew has captain protection turned on, so you will have to wait for captain to come back to control the ship.
parrot_create_new_crew_tip=You can always join/create another crew from the lobby by exiting current crew by clicking red flag on top then clicking Quit Crew.
difficulty_easy=Easy
difficulty_normal=Normal
@ -107,8 +107,8 @@ victory_continue_reminder=If you wish to continue the game, click up top.
crew_disband_tick_message=The crew will disband in 20 seconds.
protected_run_lock_expired=Protection of __1__ run has expired. Captain role will not be locked anymore when the captain leaves.
private_run_lock_expired=Private lock of __1__ run has expired. Anyone can join this crew now.
protected_run_lock_expired=Protection of __1__ crew has expired. Captain role will not be locked anymore when the captain leaves.
private_run_lock_expired=Private lock of __1__ crew has expired. Anyone can join this crew now.
plank=__1__ planked __2__!
plank_error_invalid_player=Command error: Player is not a crewmember.
@ -331,14 +331,15 @@ warn_nearly_afk_captain=Note: If you go idle as captain for too long, the role p
# error_class_assign_unavailable_class=Class error: No spare class of that type is available.
welcome_main_1=You've spawned in the lobby.
welcome_main_2=To board an existing crew (or create a new one), click 'Crews' in the top-left.
welcome_end=Click to dismiss.
personal_join_string_1=You have joined the crew '__1__' [Capacity __2__].
personal_join_string_2=You have joined the crew '__1__' [Capacity __2__, Difficulty [color=__3__,__4__,__5__] __6__[/color]].
player_join_game_info=Welcome! You're currently in the lobby. To hop into action, you can click "Crews" button up top to create a crew or choose an existing crew to join.
player_joins_protected_run_with_no_captain=This run has captain protection turned on, so you will have to wait for captain to come back to control the ship.
create_new_crew_tip=You can always join/create another run from the lobby by exiting current run by clicking red flag on top then clicking Quit Crew.
player_joins_protected_run_with_no_captain=This crew has captain protection turned on, so you will have to wait for captain to come back to control the ship.
create_new_crew_tip=You can always join/create another crew from the lobby by exiting current crew by clicking red flag on top then clicking Quit Crew.
goto_oldest_crew_with_large_capacity=There are multiple crews on this server. You have been placed in the oldest crew with large capacity.
goto_oldest_crew=There are multiple crews on this server. You have been placed in the oldest.
@ -358,8 +359,8 @@ crew_leave=__1__ left the crew.
crew_launch=[__1__] Launched.
crew_disband=[__1__] Disbanded after __2__.
proposal_propose=__1__ proposed the run __2__ [Capacity __3__].
proposal_propose_private=__1__ proposed the private run __2__ [Capacity __3__].
proposal_propose=__1__ proposed the crew __2__ [Capacity __3__].
proposal_propose_private=__1__ proposed the private crew __2__ [Capacity __3__].
proposal_retracted=Proposal __1__ retracted.
proposal_abandoned=Proposal __1__ abandoned.
@ -508,9 +509,9 @@ gui_progress_leagues=__1__ leagues
gui_progress_current_location=Current location: __1__
gui_progress_time_of_day=Time of day: __1__
gui_runs_play=Play
gui_runs_ongoing_runs=Ongoing Runs
gui_runs_ongoing_runs_helpful_tip=To join a run, first select it in the table below.
gui_runs_play=Crews
gui_runs_ongoing_runs=Ongoing Crews
gui_runs_ongoing_runs_helpful_tip=To join a crew, first select it in the table below.
gui_runs_ongoing_runs_spectate=Spectate
gui_runs_ongoing_runs_join_crew=Join Crew
gui_runs_ongoing_runs_return_to_lobby=Return to Lobby
@ -528,32 +529,32 @@ gui_runs_proposal_maker_no_limit=No limit
gui_runs_proposal_maker_protected=Protected
gui_runs_proposal_maker_protected_tooltip=Enables captain protection, which locks captain role when captain leaves or becomes afk (unless there are officers) instead of distributing the role to random crew member.\nCaptain protection expires if the crew is empty or inactive for __1__ hours.
gui_runs_proposal_maker_private=Private
gui_runs_proposal_maker_private_tooltip=Sets your run to private, which protects the run by password.\nOnce the run has launched, only people who know password will be able to join the crew.\nPrivate run becomes public if the crew is empty or inactive for __1__ hours.
gui_runs_proposal_maker_private_tooltip=Sets your crew to private, which protects the crew by password.\nOnce the crew has launched, only people who know password will be able to join the crew.\nPrivate crew becomes public if the crew is empty or inactive for __1__ hours.
gui_runs_proposal_maker_password=Password
gui_runs_proposal_maker_confirm_password=Confirm Password
gui_runs_proposal_maker_error_protected_run_limit=All protected run slots are occupied. Wait until protected run slots free up to create your own.
gui_runs_proposal_maker_error_private_run_limit=All private run slots are occupied. Wait until private run slots free up to create your own.
gui_runs_proposal_maker_error_protected_run_limit=All protected crew slots are occupied. Wait until protected crew slots free up to create your own.
gui_runs_proposal_maker_error_private_run_limit=All private crew slots are occupied. Wait until private crew slots free up to create your own.
gui_runs_proposal_maker_error_private_run_password_no_match=Passwords do not match.
gui_runs_proposal_maker_error_private_run_password_empty=Passwords can't be empty.
gui_join_protected_run_info=This run is protected.\nThis means when captain leaves the game, other members won't get the captain role (unless there are officers).\nCaptain protection expires in __1__:__2__:__3__
gui_join_private_run_info=This run is private.\nPlease enter a password to join the crew.\nThis run will become public in __1__:__2__:__3__
gui_join_protected_run_info=This crew is protected.\nThis means when captain leaves the game, other members won't get the captain role (unless there are officers).\nCaptain protection expires in __1__:__2__:__3__
gui_join_private_run_info=This crew is private.\nPlease enter a password to join the crew.\nThis crew will become public in __1__:__2__:__3__
gui_join_private_run_error_wrong_password=The password you've entered is incorrect.
gui_runs_launch=Launch run
gui_runs_launch=Launch crew
gui_runs_launch_error_1=Gather endorsements from more pirates.
gui_runs_launch_error_2=The number of concurrent runs on the server has reached the cap set by the admins.
gui_runs_launch_error_3=Can't launch; at least one run needs high player capacity.
gui_runs_launch_error_4=No sloops available. Join an existing run instead.
gui_runs_launch_error_5=Can't create the proposal, because there are too many crews. Join some existing crew run instead.
gui_runs_launch_error_2=The number of concurrent crews on the server has reached the cap set by the admins.
gui_runs_launch_error_3=Can't launch; at least one crew needs high player capacity.
gui_runs_launch_error_4=No sloops available. Join an existing crew instead.
gui_runs_launch_error_5=Can't create the proposal, because there are too many crews. Join some existing crew crew instead.
gui_runs_wait_to_join=Wait to join... __1__
gui_info_main_tooltip=Notes and updates on Pirate Ship.
gui_crews=Crews
gui_crews_main_tooltip=View the ongoing runs, and make proposals for new ones.
gui_crews_main_tooltip=View the ongoing crews, and make proposals for new ones.
gui_minimap_main_tooltip=View the outside world.

View File

@ -246,7 +246,6 @@ warn_nearly_afk_captain=Примечание: если вы слишком до
# error_class_assign_unavailable_class=Ошибка класса: нет запасного класса такого типа.
personal_join_string_1=Вы присоединились к команде '__1__' [Вместимость __2__].
personal_join_string_2=Вы присоединились к команде '__1__' [Вместимость __2__, Сложность [color=__3__,__4__,__5__] __6__[/color]].
player_join_game_info=Добро пожаловать! Вы сейчас находитесь в лобби. Чтобы приступить к делу, вы можете нажать кнопку «Команды» вверху, чтобы создать команду, или выбрать существующую команду, к которой вы хотите присоединиться.
player_joins_protected_run_with_no_captain=В этом заплыве включена защита капитана, поэтому вам придётся подождать, пока капитан вернётся, чтобы управлять кораблём.
create_new_crew_tip=Вы всегда можете присоединиться/создать другой заплыв из лобби, выйдя из текущего заплыва, щёлкнув красный флажок вверху, а затем нажав «Выйти из команды».
goto_oldest_crew_with_large_capacity=На этом сервере несколько команд. Вы были помещены в старейший экипаж с большой вместимостью.

View File

@ -38,6 +38,7 @@ local Ores = require 'maps.pirates.ores'
local Server = require 'utils.server'
-- local Modifers = require 'player_modifiers'
local GuiWelcome = require 'maps.pirates.gui.welcome'
local tick_tack_trap = require 'maps.pirates.locally_maintained_comfy_forks.tick_tack_trap' --'enemy' force, but that's okay
@ -1534,7 +1535,7 @@ local function event_on_player_joined_game(event)
Common.ensure_chunks_at(surface, spawnpoint, 5)
end
Common.notify_player_expected(player, { 'pirates.player_join_game_info' })
GuiWelcome.show_welcome_window(player)
player.force = Common.lobby_force_name

View File

@ -12,8 +12,6 @@ local Common = require 'maps.pirates.common'
local IslandEnum = require 'maps.pirates.surfaces.islands.island_enum'
-- this file is an API to all the balance tuning knobs
-- Kraken related parameters
Public.biter_swim_speed = 1.5

View File

@ -426,7 +426,6 @@ function Public.is_officer(player_index)
end
end
-- lifted shamelessly from biter battles, since I haven't done balancing work on this:
function Public.surplus_evo_biter_damage_modifier(surplus_evo)
return Math.floor(surplus_evo / 2 * 1000) / 1000 --is this floor needed?
end

View File

@ -7,7 +7,7 @@ local _inspect = require 'utils.inspect'.inspect
local Public = {}
Public.scenario_id_name = 'pirates'
Public.version_string = '1.5.2' --major.minor.patch versioning, to match factorio mod portal
Public.version_string = '1.6.0' --major.minor.patch versioning, to match factorio mod portal
Public.blueprint_library_allowed = true
Public.blueprint_importing_allowed = true

View File

@ -28,6 +28,7 @@ local Event = require 'utils.event'
local CustomEvents = require 'maps.pirates.custom_events'
local IslandEnum = require 'maps.pirates.surfaces.islands.island_enum'
local Kraken = require 'maps.pirates.surfaces.sea.kraken'
local GuiWelcome = require 'maps.pirates.gui.welcome'
local ComfyGui = require 'utils.gui'
ComfyGui.set_disabled_tab('Scoreboard', true)
@ -1263,13 +1264,14 @@ local function on_gui_click(event)
-- Public.fuel.toggle_window(player)
-- Public.fuel.full_update(player)
else
if GuiWelcome.handle_click then GuiWelcome.handle_click(event) end
if GuiRuns.click then GuiRuns.click(event) end
if GuiCrew.click then GuiCrew.click(event) end
if GuiClasses.click then GuiClasses.click(event) end
if GuiFuel.click then GuiFuel.click(event) end
if GuiMinimap.click then GuiMinimap.click(event) end
if GuiInfo.click then GuiInfo.click(event) end
end
end
end
local function on_gui_location_changed(event)

View File

@ -17,7 +17,7 @@ local Public = {}
local window_name = 'info'
local width = 430
local width = 400
@ -225,9 +225,9 @@ function Public.full_update(player)
local flow2 = flow
-- warning, if you make these too small, it loses 'Click to dismiss.'
-- This is really really dumb, to have to change these manually. But sadly I couldn't get the window to look like that and also be expandable.
-- This is really really dumb, to have to change these manually. But sadly we couldn't get the window to look like that and also be expandable.
if flow2.selected_tab_index == 1 then
flow2.style.height = 400
flow2.style.height = 360
elseif flow2.selected_tab_index == 2 then
flow2.style.height = 490
elseif flow2.selected_tab_index == 3 then

View File

@ -0,0 +1,75 @@
-- This file is part of thesixthroc's Pirate Ship softmod, licensed under GPLv3 and stored at https://github.com/danielmartin0/ComfyFactorio-Pirates.
local Public = {}
function Public.show_welcome_window(player)
if player.gui.center['welcome_window'] then player.gui.center['welcome_window'].destroy() end
local frame = player.gui.center.add{
type = 'frame',
name = 'welcome_window',
direction = 'vertical'
}
frame.style.width = 240
-- frame.style.color = {r = 0.5, g = 0, b = 0, a = 0.5}
local title_flow = frame.add{type = 'flow', direction = 'horizontal'}
title_flow.style.horizontal_align = 'center'
title_flow.style.top_margin = 10
title_flow.style.width = 220
local colors = {
{r=1, g=0.5, b=0.5},
{r=1, g=0.7, b=0.5},
{r=1, g=1, b=0.5},
{r=0.7, g=1, b=0.5},
{r=0.5, g=0.7, b=1},
{r=0.7, g=0.5, b=1}
}
-- Todo: Localize
local welcome = {'W', 'E', 'L', 'C', 'O', 'M', 'E', '!'}
for i, letter in ipairs(welcome) do
local label = title_flow.add{type = 'label', caption = letter}
label.style.font = 'default-large-bold'
label.style.font_color = colors[(i-1) % #colors + 1]
end
local message = frame.add{type = 'label', caption = {'pirates.welcome_main_1'}}
message.style.font = 'default'
message.style.horizontal_align = 'center'
message.style.single_line = false
message.style.top_margin = 12
message.style.width = 220
message.style.rich_text_setting = defines.rich_text_setting.enabled
local message = frame.add{type = 'label', caption = {'pirates.welcome_main_2'}}
message.style.font = 'default'
message.style.horizontal_align = 'center'
message.style.single_line = false
message.style.top_margin = 10
message.style.width = 220
message.style.rich_text_setting = defines.rich_text_setting.enabled
local close_instruction = frame.add{type = 'label', caption = {'pirates.welcome_end'}}
close_instruction.style.font = 'default-small'
close_instruction.style.horizontal_align = 'center'
close_instruction.style.top_margin = 20
close_instruction.style.width = 220
end
function Public.handle_click(event)
if event.element and event.element.valid then
local player = game.players[event.player_index]
if player.gui.center['welcome_window'] then
if event.element.name == 'welcome_window' or event.element.parent.name == 'welcome_window' then
player.gui.center['welcome_window'].destroy()
return true
end
end
end
return false
end
return Public

View File

@ -15,10 +15,6 @@ The scenario is quite complex, but there are ways to get started, even if you do
Make sure to use debug=true in control.lua
]]
--[[
personal note for thesixthroc looking at this in XX years: my design notes are all in Obsidian (edit: mostly moved to Github Projects)
]]
--[[
Convention for Factorio blueprints in this folder: Use Snap to grid -> Relative, Offset of zeroes.
We record tiles and entities separately. For tiles, we use the factorio dev approved 'concrete trick', painting each tile type separately as concrete. The concrete BP will typically need an offset, since it doesn't remember the center of the entities BP — we configure this offset in the Lua rather than the BP itself, since it's easier to edit that way.
@ -28,9 +24,7 @@ The scenario is quite complex, but there are ways to get started, even if you do
-- require 'modules.biters_yield_coins'
require 'modules.biter_noms_you'
require 'modules.no_deconstruction_of_neutral_entities'
require 'maps.pirates.custom_events' --probably do this before anything else
require 'utils.server'
local _inspect = require 'utils.inspect'.inspect
-- local Modifers = require 'player_modifiers'
@ -38,11 +32,8 @@ local BottomFrame = require 'utils.gui.bottom_frame'
local Autostash = require 'modules.autostash'
local AntiGrief = require 'utils.antigrief'
require 'modules.inserter_drops_pickup'
local PiratesApiOnTick = require 'maps.pirates.api_on_tick'
local ClassPiratesApiOnTick = require 'maps.pirates.roles.tick_functions'
require 'maps.pirates.commands'
require 'maps.pirates.math'
local Memory = require 'maps.pirates.memory'
@ -76,7 +67,7 @@ local Math = require 'maps.pirates.math'
local Public = {}
-- parrot sprites from https://elthen.itch.io/2d-pixel-art-parrot-sprites, licensed appropriately
-- parrot sprites from https://elthen.itch.io/2d-pixel-art-parrot-sprites
local jetty_delayed = Token.register(
-- function(data)
@ -84,6 +75,7 @@ local jetty_delayed = Token.register(
Surfaces.Lobby.place_lobby_jetty_and_boats()
end
)
local function on_init()
Memory.global_reset_memory()
local global_memory = Memory.get_global_memory()

File diff suppressed because one or more lines are too long