Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NON-MODULAR] More characters slots and droplist instead of buttons #99

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
/// Ensures that we always load the last used save, QOL
var/default_slot = 1
/// The maximum number of slots we're allowed to contain
var/max_save_slots = 3
var/max_save_slots = 15 // DOPPLER EDIT: moar slots

/// Bitflags for communications that are muted
var/muted = NONE
Expand Down Expand Up @@ -107,7 +107,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
try_savefile_type_migration()
unlock_content = !!parent.IsByondMember()
if(unlock_content)
max_save_slots = 8
max_save_slots = 30 // DOPPLER EDIT: moar slots
else
CRASH("attempted to create a preferences datum without a client or mock!")
load_savefile()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import { exhaustiveCheck } from 'common/exhaustive';
import { useState } from 'react';

import { useBackend } from '../../backend';
import { Button, Stack } from '../../components';
import {
Dropdown,
Flex,
Stack,
} from '../../components'; /* DOPPLER EDIT: Adds in Dropdown and Flex */
import { Window } from '../../layouts';
import { AntagsPage } from './AntagsPage';
import { PreferencesMenuData } from './data';
Expand All @@ -29,24 +33,29 @@ const CharacterProfiles = (props: {
onClick: (index: number) => void;
profiles: (string | null)[];
}) => {
const { profiles } = props;
const { profiles, activeSlot, onClick } =
props; /* DOPPLER EDIT: activeSlot and onClick */

return (
<Stack justify="center" wrap>
{profiles.map((profile, slot) => (
<Stack.Item key={slot}>
<Button
selected={slot === props.activeSlot}
onClick={() => {
props.onClick(slot);
}}
fluid
>
{profile ?? 'New Character'}
</Button>
</Stack.Item>
))}
</Stack>
<Flex /* DOPPLER EDIT START: Dropdown instead of using buttons */
align="center"
justify="center"
>
<Flex.Item width="25%">
<Dropdown
width="100%"
selected={activeSlot as unknown as string}
displayText={profiles[activeSlot]}
options={profiles.map((profile, slot) => ({
value: slot,
displayText: profile ?? 'New Character',
}))}
onSelected={(slot) => {
onClick(slot);
}}
/>
</Flex.Item>
</Flex> /* DOPPLER EDIT END */
);
};

Expand Down Expand Up @@ -108,11 +117,15 @@ export const CharacterPreferenceWindow = (props) => {
profiles={data.character_profiles}
/>
</Stack.Item>
{/* // DOPPLER EDIT: Hide Byond premium banner

{!data.content_unlocked && (
<Stack.Item align="center">
Buy BYOND premium for more slots!
</Stack.Item>
)}

*/}
<Stack.Divider />
<Stack.Item>
<Stack fill>
Expand Down
Loading