Skip to content

Commit 47fc609

Browse files
authoredFeb 6, 2025
Command (#151)
1 parent ada2036 commit 47fc609

File tree

140 files changed

+2342
-17635
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+2342
-17635
lines changed
 

‎client/src/action_buttons.rs

+8-6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use crate::render_context::RenderContext;
77
use server::action::Action;
88
use server::content::advances::get_advance_by_name;
99
use server::content::custom_actions::{CustomAction, CustomActionType};
10+
use server::game::GameState;
1011
use server::playing_actions::{PlayingAction, PlayingActionType};
1112
use server::resource::ResourceType;
1213

@@ -80,7 +81,7 @@ fn global_move(rc: &RenderContext) -> StateUpdate {
8081
fn custom_action_tooltip(custom_action_type: &CustomActionType) -> String {
8182
match custom_action_type {
8283
CustomActionType::ConstructWonder => "Construct a wonder".to_string(),
83-
CustomActionType::ForcedLabor => get_advance_by_name("Absolute Power").description,
84+
CustomActionType::AbsolutePower => get_advance_by_name("Absolute Power").description,
8485
CustomActionType::VotingIncreaseHappiness => get_advance_by_name("Voting").description,
8586
CustomActionType::FreeEconomyCollect => get_advance_by_name("Free Economy").description,
8687
}
@@ -94,7 +95,7 @@ fn generic_custom_action(custom_action_type: &CustomActionType) -> Option<Custom
9495
// handled explicitly
9596
None
9697
}
97-
CustomActionType::ForcedLabor => Some(CustomAction::ForcedLabor),
98+
CustomActionType::AbsolutePower => Some(CustomAction::ForcedLabor),
9899
}
99100
}
100101

@@ -104,10 +105,11 @@ pub fn base_or_custom_available(
104105
custom: &CustomActionType,
105106
) -> bool {
106107
rc.can_play_action(action)
107-
|| rc
108-
.game
109-
.get_available_custom_actions(rc.shown_player.index)
110-
.contains(custom)
108+
|| (rc.game.state == GameState::Playing
109+
&& rc
110+
.game
111+
.get_available_custom_actions(rc.shown_player.index)
112+
.contains(custom))
111113
}
112114

113115
pub fn base_or_custom_action(

‎client/src/assets.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ impl Assets {
217217

218218
fn custom_actions() -> HashMap<CustomActionType, Texture2D> {
219219
[(
220-
CustomActionType::ForcedLabor,
220+
CustomActionType::AbsolutePower,
221221
load_png(include_bytes!("../assets/slavery-whip-svgrepo-com.png")),
222222
)]
223223
.iter()

0 commit comments

Comments
 (0)